After my latest patch I ran the map to test some new features and some crazy stuff happened. The trigger actually fired twice for one particular player in multiple games. However after running two other consecutive games without that player I experienced no problems.
Both triggers were simple dialog clicked events.
One dialog is clicked for each player to choose a team the second one to choose a hero. The map has actions that state which player chose what team and hero. When I watched the replay I noticed after he clicked his dialog the game registered that he had clicked his dialog twice which isn't possible because the first action of the event is to hide the dialog. We ran two games with this same player (I was unable to contact him) and in both instances when he clicked his dialog items to choose his team or his hero the triggers actually fired twice. In one instance it actually created two heros for this mysterious player. I've been running these dialog events for months now and this has never ever happened.
Just to do some testing I then ran two more games with the previous unpatched version and the patched version without this player and everything worked properly.
The only common denominator is that somehow this player was causing a glitch in the system? But correlation does not always equal causation.
Is it possible for a player to click his dialog button twice before the action hides it from the player?
Yes, multiple click events can trigger by clicking quickly, especially during lag moments. The clicks can occur before the dialog is hidden.
Despite that, there could also be something else that's going on in your trig code that causes this.
You can use a mouse program to click at high speeds for testing.
Several solutions exist:
1. you can turn the trigger off as the first action and then re-enable it at the end of the trigger actions.
2. use a wait action, local variable and some trigger actions to check for multiple clicks.
3. use a variable with a variable lock
4. there are other options, but i cant remember atm.
Each solution may cause complications with the rest of your trigger code depending on what your doing. Choose based off what will not interfere with the rest of your trig code.
i think all of the mentioned solutions do have unwanted sideffects (other ppl not able to click buttons etc)
there is one solution to this i use in all of my maps. It prevents fast click and the even worse evil the shift click
Event: Dialog Item is clicked
Conditions: Dialog Item is enabled == True
Variables: var OPTION = Enable
Actions:
Disable used Dialog Item
DO YOUR STUFF (you can set your OPTION variable to disable if you should be able to click it only once, use a switch statement for all different buttons)
OPTION used dialog Item (enable as default)
you can also check my signature, download any map and look for ButtonUse trigger.
Wow! I was unaware of the shift click and ability to click twice. funkyusername... With your proposed solution that would still effectively disable the button on the rare occasion that someone click twice rather then every time with turning the trigger off.
Thanks for the info guys. Crazy things people can do to break your game. Lol. Always our responsibility to make it unbreakable if possible.
After my latest patch I ran the map to test some new features and some crazy stuff happened. The trigger actually fired twice for one particular player in multiple games. However after running two other consecutive games without that player I experienced no problems.
Both triggers were simple dialog clicked events.
One dialog is clicked for each player to choose a team the second one to choose a hero. The map has actions that state which player chose what team and hero. When I watched the replay I noticed after he clicked his dialog the game registered that he had clicked his dialog twice which isn't possible because the first action of the event is to hide the dialog. We ran two games with this same player (I was unable to contact him) and in both instances when he clicked his dialog items to choose his team or his hero the triggers actually fired twice. In one instance it actually created two heros for this mysterious player. I've been running these dialog events for months now and this has never ever happened.
Just to do some testing I then ran two more games with the previous unpatched version and the patched version without this player and everything worked properly.
The only common denominator is that somehow this player was causing a glitch in the system? But correlation does not always equal causation.
Is it possible for a player to click his dialog button twice before the action hides it from the player?
You better show the triggers, the problem could be other thing.
@onlyleviathan: Go
Yes, multiple click events can trigger by clicking quickly, especially during lag moments. The clicks can occur before the dialog is hidden.
Despite that, there could also be something else that's going on in your trig code that causes this.
You can use a mouse program to click at high speeds for testing.
Several solutions exist:
1. you can turn the trigger off as the first action and then re-enable it at the end of the trigger actions.
2. use a wait action, local variable and some trigger actions to check for multiple clicks.
3. use a variable with a variable lock
4. there are other options, but i cant remember atm.
Each solution may cause complications with the rest of your trigger code depending on what your doing. Choose based off what will not interfere with the rest of your trig code.
i think all of the mentioned solutions do have unwanted sideffects (other ppl not able to click buttons etc)
there is one solution to this i use in all of my maps. It prevents fast click and the even worse evil the shift click
Event: Dialog Item is clicked
Conditions: Dialog Item is enabled == True
Variables: var OPTION = Enable
Actions:
Disable used Dialog Item
DO YOUR STUFF (you can set your OPTION variable to disable if you should be able to click it only once, use a switch statement for all different buttons)
OPTION used dialog Item (enable as default)
you can also check my signature, download any map and look for ButtonUse trigger.
@FunkyUserName: Go
Wow! I was unaware of the shift click and ability to click twice. funkyusername... With your proposed solution that would still effectively disable the button on the rare occasion that someone click twice rather then every time with turning the trigger off.
Thanks for the info guys. Crazy things people can do to break your game. Lol. Always our responsibility to make it unbreakable if possible.
@onlyleviathan: Go
no, the second click would be ignored due to the condition at the start of the trigger, also just disable/enable for the triggering player.