Hi guys.
My problem is not how to create and use them... it's more that I discovered a bug which is pretty dangerous for the gameplay if you don't pay attention in your triggers.
Note that the problem did not occur while testing the map solo (aka not over battle.net)! Everything worked fine then.
So I have a simple trigger, firing when a dialog control is pressed. A condition filters out all events so that it only fires when this one button is pressed.
The actions are then to increase a integer variable by 1, to hide (and deactivate) the button. Then a function is run the update the UI, this function will only activate and show the button again if the player has enough minerals. All of these actions are run in the same thread.
So, the problem is that this will be buggy when playing on battle.net when the player clicks the button fast! I'm not meaning that you have to click like hell, but only quite fast. The problem seems to be that the button isn't hidden instantaneously, but with a pretty high delay.
Well, this post is mainly to warn those like me, that mainly do local testing and think that triggers will be as fast (and save) as they are when hitting "test map". ;)
So, when you have a dialog event, often this will be a button that is pressed, make sure that you set your conditions and filters at the start of the trigger and always keep in mind that the event might occur even though you think that the button should not even be visible/activated!
Using the UI only for program flow is not safe. However, triggers and variables are. If you set a variable when the button is pressed, and use that variable as a check to prevent future presses, it will always work. Even if the UI is glitchy.
Yep that's how I managed to make my stuff bug free again. But I didn't think that the event "button Xpressed" ever could occur twice when the action is "hide button X".
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi guys.
My problem is not how to create and use them... it's more that I discovered a bug which is pretty dangerous for the gameplay if you don't pay attention in your triggers.
Note that the problem did not occur while testing the map solo (aka not over battle.net)! Everything worked fine then.
So I have a simple trigger, firing when a dialog control is pressed. A condition filters out all events so that it only fires when this one button is pressed.
The actions are then to increase a integer variable by 1, to hide (and deactivate) the button. Then a function is run the update the UI, this function will only activate and show the button again if the player has enough minerals. All of these actions are run in the same thread.
So, the problem is that this will be buggy when playing on battle.net when the player clicks the button fast! I'm not meaning that you have to click like hell, but only quite fast. The problem seems to be that the button isn't hidden instantaneously, but with a pretty high delay.
Well, this post is mainly to warn those like me, that mainly do local testing and think that triggers will be as fast (and save) as they are when hitting "test map". ;)
So, when you have a dialog event, often this will be a button that is pressed, make sure that you set your conditions and filters at the start of the trigger and always keep in mind that the event might occur even though you think that the button should not even be visible/activated!
Using the UI only for program flow is not safe. However, triggers and variables are. If you set a variable when the button is pressed, and use that variable as a check to prevent future presses, it will always work. Even if the UI is glitchy.
Yep that's how I managed to make my stuff bug free again. But I didn't think that the event "button Xpressed" ever could occur twice when the action is "hide button X".