I want to make a series of timers for a car in my game (one for each of 9 possible weapons). I have my car variables stored in a record. One variable in the record is "WeaponCooldown" which is an array of timers (size 9).
When I start one of the timers it doesn't expire ever. I put in a repeat debug to tell me the time remaining and it always says: 1.01 seconds, even though I started the timer to last only .1 seconds. When I start the time for 1 second it says it has 1 second remaining over and over.
Are there problems with arrays and timers that I'm not aware of?
UPDATE:
I took the arrays out of the record and made a two-dimensional array of timers: the first dimension was the player number (1= player 1, etc.), and the second dimension was the weapon on the car. So array (1,9) was the first player's ninth weapon. In any case, that didnt' work either, and the timer just seemed paused the whole time. I decided to just make my own timers out of reals and a repeat trigger. Long story short, if anyone knows what happened here let me know, but don't put in too much effort unless you're curious as well. I do have a work around for this.
When I start one of the timers it doesn't expire ever. I put in a repeat debug to tell me the time remaining and it always says: 1.01 seconds, even though I started the timer to last only .1 seconds. When I start the time for 1 second it says it has 1 second remaining over and over.
Are there problems with arrays and timers that I'm not aware of?
UPDATE:
I took the arrays out of the record and made a two-dimensional array of timers: the first dimension was the player number (1= player 1, etc.), and the second dimension was the weapon on the car. So array (1,9) was the first player's ninth weapon. In any case, that didnt' work either, and the timer just seemed paused the whole time. I decided to just make my own timers out of reals and a repeat trigger. Long story short, if anyone knows what happened here let me know, but don't put in too much effort unless you're curious as well. I do have a work around for this.
Last edited: