weird timer issue. rule works, unless i use timer :(
I have a simple rule, when the goodguy's hps is equal to or less than 0, change scene to 'game over' scene.
Which works fine.
But if I put in a timer, and use 'after' and 'run to completion' or not use 'run to completion', even if it's just a second or two, nothing happens. So like, 'when goodguy hps are equal to, or less than 0, timer, AFTER 2 seconds, then spawn 'game over' scene.
Even deleted the actor and put him back in, which sometimes fixes an issue of making a change at it not taking effect, but still no luck.
Le what gives?
Which works fine.
But if I put in a timer, and use 'after' and 'run to completion' or not use 'run to completion', even if it's just a second or two, nothing happens. So like, 'when goodguy hps are equal to, or less than 0, timer, AFTER 2 seconds, then spawn 'game over' scene.
Even deleted the actor and put him back in, which sometimes fixes an issue of making a change at it not taking effect, but still no luck.
Le what gives?
Comments
If you say 'after two seconds' that 2 seconds has to start at a given point.
So if the rule is is not based on a specific event, it will just trigger at the start of the scene.
e.g You can put it in a rule, when enemy collides with hero
if hero hp = 0
after 2 seconds
change scene.
----------
"Honey Tribe is not only a remarkably endearing little game, but it's also incredibly addictive." Pocket Gamer
"...a touch above the rest in the endless running genre" 148apps.com
Say hi on Twitter
Like us on Facebook
www.HoneyTribeStudios.com
Works fine.
Unless I want to put a timer on the scene ending.
If before the scene change occurs, I just put a timer on holding off on the scene ending for any amount of time and it never happens.
I have the timer rule on the player's actor inside the rule where he dies at 0 or less hps. It works and changes scenes, UNLESS I put in a timer.
What's odd, is I probably have 100 timers in all kinds of things, from badguy and goodguy fire rates, bullet and gun rotations, badguy movement and spawn. I have them all over the place, they all work fine.
I have a lot of them, in more complicated things than just a change scene, but i'm totally baffled why it just isn't working.
ok, I figured it out. I had the rule to change the scene on the actor that dies. Even if I check 'run to completion' it never happens if the actor is already dead. I moved the rule to the score display actor, but the same thing, when player's hps are 0 or less, change scene, and it works.
Guess the actor has to be on screen for the rule to take place, EVEN if you check 'run to completion'
Ah well, thanks for the help HTS.