Sorry, I don't have much time to give this full detail, but I have a problem. I can't get a trigger to not trigger it's own event, even after turning it off during the trigger execution.
An example of my Problem is if I have (this is only an example, it's not my trigger)
Event - Any Dialog Item is Used by Any Player type Checked
Action - Used Dialog Item is Checked = true
If I try turning off the trigger before doing the action the trigger still loops on itself, and for some reason I can't get it to not do so. My map has a different looking trigger and each execution is laggy because of this. Anyone have a solution? Again sorry I don't have enough time to fully describe, I hope this is enough detail.
Edit: An FYI, the debug window will show whether or not the trigger is running multiple times as a result of triggering itself.
I would suggest to set a global boolean. Add a check to the trigger if (boolean) then set boolean = false and skip remaining actions. Set the boolean before changing the dialog item in the trigger.
I would suggest to set a global boolean. Add a check to the trigger if (boolean) then set boolean = false and skip remaining actions. Set the boolean before changing the dialog item in the trigger.
Unfortunately I have tried that, and the trigger still fires, and the trigger simply firing creates a spike of lag, and this is only with me testing it, can't imagine 12 players doing it at once.
I don't understand why the "Turn trigger off" doesn't work the same way it did in warcraft 3's editor, if I turned off the trigger there, it's events never fire. Yet this one makes them fire if the trigger trigger's it's own events.
The lag spike is probably caused by the debug window. If you go for a performance test, always publish the map and test in battlenet. Using the test button and debug window hurt performance a LOT.
If the boolean doesn't work, you did something wrong. Just like disabling the trigger.
There is a small delay between the trigger and the start of the next trigger, so if you do stuff like
it won't work, because the event for changing the dialog stuff would trigger, after the whole trigger finished. Same, if you did set the boolean before and after the setting.
The lag spike is probably caused by the debug window. If you go for a performance test, always publish the map and test in battlenet. Using the test button and debug window hurt performance a LOT.
If the boolean doesn't work, you did something wrong. Just like disabling the trigger.
There is a small delay between the trigger and the start of the next trigger, so if you do stuff like
it won't work, because the event for changing the dialog stuff would trigger, after the whole trigger finished. Same, if you did set the boolean before and after the setting.
The debug menu is not the cause of the lag spikes, I started it up AFTER the lag spikes started to try and find a source, it's from then that I noticed that my trigger was running multiple times at once.
There is a small delay between the trigger and the start of the next trigger
After reading what you said I decided to try doing this
Set boolean[player] = false
set dialog item stuff
wait 0.1 seconds
Set boolean[player] = true
And now the trigger no longer loops, the "wait" is very important as it keeps the trigger off for that small delay you mentioned, so I had to make the boolean an array (1 for each player), thank you for telling me that very enlightening piece of information. The only time I see this being an issue is if the player happens to click more than 1 dialog item within a tenth of a second, which I am not worried about. That solves my problem now.
I believe it is something to do with one of the 1.3x patches that caused some triggers to fire twice in quick succession, even when the coding is flawless.
I did a similar thing by adding a global variable with a wait, to stop it firing twice in quick succession. It was working fine then after one of the patches it wasn't, without me even touching that code ... go figure. Do what Zack said.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Sorry, I don't have much time to give this full detail, but I have a problem. I can't get a trigger to not trigger it's own event, even after turning it off during the trigger execution.
An example of my Problem is if I have (this is only an example, it's not my trigger)
Event - Any Dialog Item is Used by Any Player type Checked
Action - Used Dialog Item is Checked = true
If I try turning off the trigger before doing the action the trigger still loops on itself, and for some reason I can't get it to not do so. My map has a different looking trigger and each execution is laggy because of this. Anyone have a solution? Again sorry I don't have enough time to fully describe, I hope this is enough detail.
Edit: An FYI, the debug window will show whether or not the trigger is running multiple times as a result of triggering itself.
I would suggest to set a global boolean. Add a check to the trigger if (boolean) then set boolean = false and skip remaining actions. Set the boolean before changing the dialog item in the trigger.
Unfortunately I have tried that, and the trigger still fires, and the trigger simply firing creates a spike of lag, and this is only with me testing it, can't imagine 12 players doing it at once.
I don't understand why the "Turn trigger off" doesn't work the same way it did in warcraft 3's editor, if I turned off the trigger there, it's events never fire. Yet this one makes them fire if the trigger trigger's it's own events.
The lag spike is probably caused by the debug window. If you go for a performance test, always publish the map and test in battlenet. Using the test button and debug window hurt performance a LOT.
If the boolean doesn't work, you did something wrong. Just like disabling the trigger.
There is a small delay between the trigger and the start of the next trigger, so if you do stuff like
it won't work, because the event for changing the dialog stuff would trigger, after the whole trigger finished. Same, if you did set the boolean before and after the setting.
The debug menu is not the cause of the lag spikes, I started it up AFTER the lag spikes started to try and find a source, it's from then that I noticed that my trigger was running multiple times at once.
After reading what you said I decided to try doing this
Set boolean[player] = false set dialog item stuff wait 0.1 seconds Set boolean[player] = true
And now the trigger no longer loops, the "wait" is very important as it keeps the trigger off for that small delay you mentioned, so I had to make the boolean an array (1 for each player), thank you for telling me that very enlightening piece of information. The only time I see this being an issue is if the player happens to click more than 1 dialog item within a tenth of a second, which I am not worried about. That solves my problem now.
I believe it is something to do with one of the 1.3x patches that caused some triggers to fire twice in quick succession, even when the coding is flawless.
I did a similar thing by adding a global variable with a wait, to stop it firing twice in quick succession. It was working fine then after one of the patches it wasn't, without me even touching that code ... go figure. Do what Zack said.