is it a button everyone is able to use or just a single player? (if it suits your situation you could just turn the trigger off then wait half a second and turn it back on)
there is no wait between my actions. i always try to avoid waits inside triggers that can be executed more often.
if it would be linear, turning off the button has to work but it doesn't.
my new approach is now to have a trigger for each player and i'll check the number of trigger instances (<= 1) otherwise it won't be executed, but i have to test it online first.
I dont get your logic. You are wondering why a trigger executes multiple times when activating the button immediately after deactivating it?
Quote:
if it would be linear, turning off the button has to work but it doesn't.
The exact opposite is the case. Its linear, so at first it executes all actions of the trigger which gets run. After that it continues with checking for events. At that point the button is active again, and therefore the trigger will run again.
If you want to avoid players spamming the button you will need to create a boolean variable for each player, set it to true once the button gets pressed, wait X seconds and setting it back to false. Then, when the button is clicked, you can check whether this variable is false and ignore the click if it isnt.
i forgot to say that i am using this for all my buttons in the map and this button will be hidden once it is pressed. so it cannot be pressed again.
ok this makes sense if there is a queue for these events.
click 1 and click 2, click 2 queued and click 1 runs then click 2 runs.
ok need to test this, thx alot
hi there at the all knowing sc2mapster community.
i need help here:
Event - Dialog Button used
Condition - Button is active == true
Actions - Deactivate Triggering Button ....ACTIONS...... Activate Button
this doesn't prevent fast clicking on that button which causes the trigger to fire at least twice.
is there anything i missed to prevent that?
i have tried lots of conditions but it seems to be pretty much paralell.
thx in advance
@FunkyUserName: Go
is it a button everyone is able to use or just a single player? (if it suits your situation you could just turn the trigger off then wait half a second and turn it back on)
everbody can use this trigger right now, but even if i would turn this trigger off it would fire twice because it's paralell
Does the following describe what you are doing?
Event - Dialog Button used
Condition - Button is active == true
Actions - Deactivate Triggering Button ....ACTIONS......wait( something like: 0.5, real time).... Activate Button
I assume that you have no wait or a too small wait in there.
Multiple clicks on the button will fire the event multiple times. My experience tells me that SC2's trigger execution is linear and not parallel.
@Ahli634: Go
there is no wait between my actions. i always try to avoid waits inside triggers that can be executed more often. if it would be linear, turning off the button has to work but it doesn't.
my new approach is now to have a trigger for each player and i'll check the number of trigger instances (<= 1) otherwise it won't be executed, but i have to test it online first.
I dont get your logic. You are wondering why a trigger executes multiple times when activating the button immediately after deactivating it?
The exact opposite is the case. Its linear, so at first it executes all actions of the trigger which gets run. After that it continues with checking for events. At that point the button is active again, and therefore the trigger will run again.
If you want to avoid players spamming the button you will need to create a boolean variable for each player, set it to true once the button gets pressed, wait X seconds and setting it back to false. Then, when the button is clicked, you can check whether this variable is false and ignore the click if it isnt.
i forgot to say that i am using this for all my buttons in the map and this button will be hidden once it is pressed. so it cannot be pressed again.
ok this makes sense if there is a queue for these events.
click 1 and click 2, click 2 queued and click 1 runs then click 2 runs.
ok need to test this, thx alot
....edit..... works