I have two triggers. I have three buttons and three checkboxes, and the function of the first trigger is to, in case the button corresponding to the checkbox is pressed, check of the corresponding checkbox and uncheck the two other checkboxes that I have. The other trigger simply checks the used dialog item (checkbox) in case and unchecks the two others. The goal of this is to make only one checkbox selectable at a time.
To prevent the trigger from looping I've made sure that the trigger that detects a change in the checkboxes is shut of while the trigger checks and unchecks the checkboxes. It didn't work apparently, as it is looping like crazy. Checking one checkbox works, but when I try to check off another it goes into a lopp (while it's supposed to uncheck the first box)
Try adding a small wait before turning the trigger back on.
For some reason the "checked" event also fires from checking/unchecking a checkbox with triggers. However, it also seems to have some sort of delay that makes it necessary to add a small wait.
Another thing you might try is to add a condition that checks if the triggering player (aka the checkbox checker) is a user to avoid it firing from the triggered-check. But i cant tell if this works since i dont know what played ID(s) is used by the triggered action. Its possible that it always uses the ID of the player thats checkbox-state is changed. (For example "All players" could mean that it basically loops through all players and forces the picked player to change the checked state)
What you're saying is that turning of a trigger takes more time than checking of a checkbox for the engine, and therefore it checks the checkbox before turning off the trigger?
EDIT: OK, it doesn't loop now, but it doesn't change either. If i for example press the "terran checkbox" I cannot check any of the two other checkboxes - it changes briefly but then checks the original box again.
What you're saying is that turning of a trigger takes more time than checking of a checkbox for the engine, and therefore it checks the checkbox before turning off the trigger?
This is essentially correct. From my tests, checking a checkbox via trigger fires instantly, while disabling a trigger is executed on the next game loop tick.
I would recommend setting a global boolean variable, which is checked in your other trigger, since setting these is executed instantly as well. Also, I recommend testing on Battle.net, because the delay sometimes influences this behavior (I had a working trigger in singleplayer, which started to loop in online play).
I have two triggers. I have three buttons and three checkboxes, and the function of the first trigger is to, in case the button corresponding to the checkbox is pressed, check of the corresponding checkbox and uncheck the two other checkboxes that I have. The other trigger simply checks the used dialog item (checkbox) in case and unchecks the two others. The goal of this is to make only one checkbox selectable at a time.
To prevent the trigger from looping I've made sure that the trigger that detects a change in the checkboxes is shut of while the trigger checks and unchecks the checkboxes. It didn't work apparently, as it is looping like crazy. Checking one checkbox works, but when I try to check off another it goes into a lopp (while it's supposed to uncheck the first box)
Try adding a small wait before turning the trigger back on.
For some reason the "checked" event also fires from checking/unchecking a checkbox with triggers. However, it also seems to have some sort of delay that makes it necessary to add a small wait.
Another thing you might try is to add a condition that checks if the triggering player (aka the checkbox checker) is a user to avoid it firing from the triggered-check. But i cant tell if this works since i dont know what played ID(s) is used by the triggered action. Its possible that it always uses the ID of the player thats checkbox-state is changed. (For example "All players" could mean that it basically loops through all players and forces the picked player to change the checked state)
@Mille25: Go
What you're saying is that turning of a trigger takes more time than checking of a checkbox for the engine, and therefore it checks the checkbox before turning off the trigger?
EDIT: OK, it doesn't loop now, but it doesn't change either. If i for example press the "terran checkbox" I cannot check any of the two other checkboxes - it changes briefly but then checks the original box again.
This is essentially correct. From my tests, checking a checkbox via trigger fires instantly, while disabling a trigger is executed on the next game loop tick.
I would recommend setting a global boolean variable, which is checked in your other trigger, since setting these is executed instantly as well. Also, I recommend testing on Battle.net, because the delay sometimes influences this behavior (I had a working trigger in singleplayer, which started to loop in online play).
@Kueken531: Go
Did you see my edit? ^^