I have a trigger set up so when i player presses a button it makes a unit and destroys the unit who has the button. Instead of making 1 hero it makes 2.
Does it make a 2nd unit every single time, or just sometimes? You don't seem to be disabling or hiding the button at all, so it would be possible to repeatedly click the button to continually spawn units. If that is the issue you could add a condition of the dialog item being visible/active, then set it to inactive/hidden in your trigger. If you don't want that aesthetic, you could use a boolean value for the same effect.
I was able to fix the problem the cooldown to train the unit was at 0 and shouldve been higher than the amount of time it took to kill the Hero Select.
Do note that the button could be pressed multiple times to give you multiple units in multiplayer. This is the result of unavoidable network latency.
Add a condition to the trigger to test if the cocoon is alive or disable the trigger to prevent this from happening. Such a test will fail after the first time the trigger runs or the trigger will be prevented from running again if disabled. Hiding or disabling the button is not enough as the game does not check if a button press synchronized event is valid or not. This means that triggers can still be fired by a button or UI element that is meant to be disabled and in theory a cheating player could create such interaction with disabled and hidden objects with a third party tool.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I have a trigger set up so when i player presses a button it makes a unit and destroys the unit who has the button. Instead of making 1 hero it makes 2.
Does it make a 2nd unit every single time, or just sometimes? You don't seem to be disabling or hiding the button at all, so it would be possible to repeatedly click the button to continually spawn units. If that is the issue you could add a condition of the dialog item being visible/active, then set it to inactive/hidden in your trigger. If you don't want that aesthetic, you could use a boolean value for the same effect.
@ZMilla93: Go
It spawns 2 everytime and i only click the button once before the hero selection (the unit being killed) is killed.
@ZMilla93: Go
It spawns 2 everytime and i only click the button once before the hero selection (the unit being killed) is killed.
@WesMan00: Go
I was able to fix the problem the cooldown to train the unit was at 0 and shouldve been higher than the amount of time it took to kill the Hero Select.
Do note that the button could be pressed multiple times to give you multiple units in multiplayer. This is the result of unavoidable network latency.
Add a condition to the trigger to test if the cocoon is alive or disable the trigger to prevent this from happening. Such a test will fail after the first time the trigger runs or the trigger will be prevented from running again if disabled. Hiding or disabling the button is not enough as the game does not check if a button press synchronized event is valid or not. This means that triggers can still be fired by a button or UI element that is meant to be disabled and in theory a cheating player could create such interaction with disabled and hidden objects with a third party tool.