I have an object that spawns multiple times. For each instance, I need to start a regular timer.
But every object spawned has a different instance variable containing the time in seconds to start that timer.
So, I was trying to change the timer tag based on another instance variable, an ID. This way, the tag changes each time, and so does the On Timer tag.
Loop spawning objects
OBJECT Start Timer _ "Name"&Object.InstanceVariableName for Object.InstanceVariableTime seconds (Regular)
OBJECT On timer "Name"&ObjectInstanceVariableName Actions
It works for the first set of spawned objects, but every time I change the instance variables to start a new set of objects with different a timer setup, the previous set of timers stops.
However, if I change the program and create different Timer Tags hardcoded, like:
Inside the loop
if "Name"&ObjectInstanceVariableName = Name1 then Start Timer "Name1"
if "Name"&ObjectInstanceVariableName = Name2 then Start Timer "Name2"
On Timer "Name 1" Actions
The setup works perfectly, and the previous timers don't stop.
My question is:
Is there a way to start multiple timers with tags that are variable strings and not "hardcoded" names? How do I do that?
(I have also tried to use a string global variable that was set before the Start Timer and was set to be the timer's tag and on timer trigger, but that didn't work as well, I thought it could be a "string problem" or something)