Your problem is the order in which you do the if checks.
You start off with the timer at 30, and add 8. So now it's 38.
Your next if checks if it's 38, and it is.. so adding 8 more. Now it's 46.
the next if fires if it's 46. Bad luck, it is 46.
...and so on.
There are a few options to fix this, but the easiest as far as I can see would be to reverse the order of the checks. Start with your highest and check lower and lower. Now, if your timer is increased, the check for that higher timer has already been done, so it won't fire immediately.
...or use a local boolean variable that makes sure that the timer is only increased once each time the trigger runs.
I get the feeling that the entire procedure can be done with only one if check but using a few more variables that keeps track of which timer step you are currently on, but since you already have the trigger set up, might as well keep it I guess. Don't really matter as long as you get it to work as intended.
Edit:
Yeah, the trigger could be cleaned up quite a bit by removing redundant steps. But I think it's more important that you do it your way, so that you understand your own triggers.
I'm unsure exactly how switches work in the galaxy editor, but using that instead of if then might also solve the problem (assuming it only allows one case to be chosen, even if the variables change halfway through).
It would help if we had a bigger picture to look at. Copy your entire trigger as text and paste it here in code tags. It's better to see exactly what you did. Right now I'm sitting here guessing what your trigger looks like from your description.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Yeah, that's the way it should work, but as I haven't used it here yet, I didn't want to say anything for certain.
Your problem is the order in which you do the if checks.
You start off with the timer at 30, and add 8. So now it's 38.
Your next if checks if it's 38, and it is.. so adding 8 more. Now it's 46.
the next if fires if it's 46. Bad luck, it is 46.
...and so on.
There are a few options to fix this, but the easiest as far as I can see would be to reverse the order of the checks. Start with your highest and check lower and lower. Now, if your timer is increased, the check for that higher timer has already been done, so it won't fire immediately.
...or use a local boolean variable that makes sure that the timer is only increased once each time the trigger runs.
I get the feeling that the entire procedure can be done with only one if check but using a few more variables that keeps track of which timer step you are currently on, but since you already have the trigger set up, might as well keep it I guess. Don't really matter as long as you get it to work as intended.
Edit:
Yeah, the trigger could be cleaned up quite a bit by removing redundant steps. But I think it's more important that you do it your way, so that you understand your own triggers.
I'm unsure exactly how switches work in the galaxy editor, but using that instead of if then might also solve the problem (assuming it only allows one case to be chosen, even if the variables change halfway through).
It would help if we had a bigger picture to look at. Copy your entire trigger as text and paste it here in code tags. It's better to see exactly what you did. Right now I'm sitting here guessing what your trigger looks like from your description.