Modify timer action?

Is it possible to reduce a timer if a certain condition is meet? Like every 5 seconds my respawn timer should be reduced by 99.5%, and keep doing that infinitely?

I guess yes with the use of variables.

According you have a var called “MyCustomValue”:

Timer “myTimer” is greater than “MyCustomValue”
– Do MyCustomValue - (0.5/100*MyCustomValue) to MyCustomValue
– Reset “myTimer”

I guess this should work, but i’m not sure if timer condition allows expression/variable… If not, you’ll have to check time differently, maybe with the use of “TimeDelta()”.

This worked perfectly thank you

Maybe not anyway, it seems like the timer ignores the variables value and keep reducing the number at a rapid rate ← which is not what i want. It just didn’t seems like that at first, too trigger happy^

I guess it’s because the example reduces the variable and spawn enemies every “variable” seconds. I mean, if the variable is 5, in 5 seconds it will be reduced to 4.975, and in only 4.975 seconds it will be reduced again, do you get it?, the reduction speed is increased.

From the first post you say you want the spawn variable to be reduced every 5 seconds, so you need two timers: A timer to spawn enemies every X seconds, and a timer reducing X to 99.5% every 5 seconds:

[code]Conditions: “Spawn” timer is greater than Variable(spawn_counter) seconds
Actions: Create enemy at x ; y
Reset timer “Spawn”

Conditions: “SpawnSpeed” timer is greater than 5 seconds
Actions: Do * 0.995 to the variable spawn_counter
Reset timer “SpawnSpeed”[/code]
Note I’m using a multiplication symbol in the action that modifies the “spawn_counter” variable, Do * 0.995 to the variable X is the same than Do = Variable(X) * 0.995 to the variable X :slight_smile: