Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events from SDK 1.10 or higher not triggering #9

Closed
rodistic opened this issue Feb 8, 2021 · 7 comments
Closed

Events from SDK 1.10 or higher not triggering #9

rodistic opened this issue Feb 8, 2021 · 7 comments

Comments

@rodistic
Copy link

rodistic commented Feb 8, 2021

Hello there,

just creating an a little application to test out the telemetry sdk and got headache when i tried to use following events.

game refuel-paid
game fine
job cancelled
and more

all of those events are markes as only working with SDK 1.10 and above. but they just wont get triggerd.
I'm using the SCS SDK v1.10.6

@YeapGuy
Copy link

YeapGuy commented Feb 9, 2021

I can't reproduce. Some of the events (specifically the refuel ones) are a bit wacky, but they do trigger for me. Can you send a snippet your code?

@rodistic
Copy link
Author

rodistic commented Feb 9, 2021

`const truckSimTelemetry = require("trucksim-telemetry")

const telemetry = truckSimTelemetry()

telemetry.job.on('cancelled', function(args){
//code
})

`

cancelled doesnst trigger that way but Job Started event worked that way. I also checked the data arrays of the event array. the active state of Job Cancelled wont change from false to true

@kniffen
Copy link
Owner

kniffen commented Feb 10, 2021

HI.

Make sure you call the watch function to watch the game for changes in order to trigger the events, see example.
Also make sure that the interval is not too long, as some events only stay active for a short while.

@rodistic
Copy link
Author

Hey thanks for the answer, of course i have the watch function, just forgot to put it in the code. currently i have a interval of 3500 but also tried 500, is that still to long?

@kniffen
Copy link
Owner

kniffen commented Feb 10, 2021

I recommend 100ms (it's the default), you can go as low as 10ms but you might run into memory issues due to how the plugin and javascript garbage collection works.

@rodistic
Copy link
Author

so tried to set the watch interval on 100ms,80ms,50ms. And i must say it so inconsistent that it doesnt make sense to implement it. The only problem ist that the Object , for example the fine Object changes the amount and the offence when an fine is done but the active attribute seems to trigger for a teenie weenie itsy bitsy time span. so it is luck if i catch an event or not . Might it be possible to change the speed of the active attribute? So that it is alive for 200ms or like that?

@kniffen
Copy link
Owner

kniffen commented Feb 12, 2021

You are correct that it's inconsistent, I've noticed that myself with testing, especially with the fine event.
I think it's mainly a problem with the plugin itself, see the issue linked below.

RenCloud/scs-sdk-plugin#38

@kniffen kniffen closed this as completed Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants