Global Timer... could this be added?

I was thinking about how to manage Buffs and Debuff across scenes, and even tho i could probably make it work with some global variables, the simple and easy way would be with a Global Timer…

While opening this Feature Request, i saw that @Silver-Streak had already made the same request…

@arthuro555 mentions that this could be easy to implement… and then the thread was closed…

What happened?

Global timers would be something so useful to have, cant this be implemented? :frowning:

1 Like

@MagicBiscuit this is a good idea.

How to make a global timer

First, we need to make a Second scene timer for the scenes that we want to have the global timer

Now, we need to make a global variable that will be the timer value

So, every second in the scene, the global timer will increase one second

Now, make the same code in the scenes that you want to have the timer

And… Your global timer is ready! Now you can verify it values to make conditions!

I hope you like my reply <3

1 Like

I figured i could do something like that :slight_smile:

If we could have it as just a regular event, like the other timers, i think it might be a bit better tho, specially if it seems easy to implement.

Thanks anyways tho! That was very helpful :smiley:

Just one thing tho… you have to change the “1 Second” for the lowest possible number that the timer registers… i have no idea what it is, but it should be something like “0.01 Seconds”.

If you leave it at “1 Second”, even tho it will work just fine, its gonna be inaccurate, since a second is a very long time, while changing scenes the timer will reset, and if the second isnt up yet, the counter wont go up… at the end of it all, the difference could be very significant, specially if your using it for a speed running timer or something along those lines.

A built in accurate global timer would be a great and useful addition to GDevelop :slight_smile:

1 Like

this can be an extension

Yeah, you are right, a single event is so much better! And thanks for the 0,01 seconds idea!