I'm having an issue with adding kill rewards in a defense map. The kills you get scale into the thousands, and you can kill anywhere up to 6 units in under a second's time, so I need a variable to block the trigger from running more than once when fired. I have created such a trigger.
The specific trigger runs once a player reaches 1500 kills, and triggers a boolean local variable to true when it fires, failing the conditions so that the trigger will not repeat. I have the conditions set to require that the local boolean variable be != true, and Player[playernumber] kills == 1500. The very first action in the trigger is flipping the boolean so it will be sure to fail conditions as quickly as possible.
However, the issue I'm having is that the trigger will fire more than once regardless, even if the boolean is set to true despite the conditions I set. The event is "Any Unit Dies," but should only run if the conditions are met.. I'm starting to get frustrated with it, haha.
Is there something I'm missing with this? Is there something extra I need to do for local variables to register or something? It's almost as if the variable I created doesn't exist.. I haven't tried a global variable, since I figured it was unnecessary for something that only happens once.
I'm having an issue with adding kill rewards in a defense map. The kills you get scale into the thousands, and you can kill anywhere up to 6 units in under a second's time, so I need a variable to block the trigger from running more than once when fired. I have created such a trigger.
The specific trigger runs once a player reaches 1500 kills, and triggers a boolean local variable to true when it fires, failing the conditions so that the trigger will not repeat. I have the conditions set to require that the local boolean variable be != true, and Player[playernumber] kills == 1500. The very first action in the trigger is flipping the boolean so it will be sure to fail conditions as quickly as possible.
However, the issue I'm having is that the trigger will fire more than once regardless, even if the boolean is set to true despite the conditions I set. The event is "Any Unit Dies," but should only run if the conditions are met.. I'm starting to get frustrated with it, haha.
Is there something I'm missing with this? Is there something extra I need to do for local variables to register or something? It's almost as if the variable I created doesn't exist.. I haven't tried a global variable, since I figured it was unnecessary for something that only happens once.
Thank you for your time.
VA
You see the problem is that the local variable is LOCAL. It only applies for one trigger instance, and not multiple instances. I think you might need a global variable if you are doing something like this.
Greetings,
I'm having an issue with adding kill rewards in a defense map. The kills you get scale into the thousands, and you can kill anywhere up to 6 units in under a second's time, so I need a variable to block the trigger from running more than once when fired. I have created such a trigger.
The specific trigger runs once a player reaches 1500 kills, and triggers a boolean local variable to true when it fires, failing the conditions so that the trigger will not repeat. I have the conditions set to require that the local boolean variable be != true, and Player[playernumber] kills == 1500. The very first action in the trigger is flipping the boolean so it will be sure to fail conditions as quickly as possible.
However, the issue I'm having is that the trigger will fire more than once regardless, even if the boolean is set to true despite the conditions I set. The event is "Any Unit Dies," but should only run if the conditions are met.. I'm starting to get frustrated with it, haha.
Is there something I'm missing with this? Is there something extra I need to do for local variables to register or something? It's almost as if the variable I created doesn't exist.. I haven't tried a global variable, since I figured it was unnecessary for something that only happens once.
Thank you for your time.
~VA
Post the trigger and I think you put this thread in the wrong sub-forum, it's for trigger help not data if I'm understand correct.
You see the problem is that the local variable is LOCAL. It only applies for one trigger instance, and not multiple instances. I think you might need a global variable if you are doing something like this.
and yes, this should be in the Trigger forum.
@Zolstice: Go
Oh, sorry for that. I didn't notice the other sub-forum!