I haven't read the whole tutorial, I just took a glance at it, but I didn't see the correction to another very common error, so I'll just post it here (feel free to add to the main post):
Error
Sometimes people make triggers which can be repeated, but the person doesn't know that, let's consider this example:
Anywhere = variable for any region
Error Trigger:
Any Trigger
Events
Unit - a unit enters Anywhere
Conditions Actions
Do something
If the map is multiplayer, you see the error right away: If one player is near another and they both enter the region, the trigger will be executed twice, or the ammount of times equal to the number of units which entered the region.
Also, singleplayer maps get bugs too. If, for example, the map is too long and the person loses in the final boss. He wants to know what happens on the end, so he puts "Whosyourdaddy" and rushes to the final boss, not killing the creeps. The same error happens when his character and the creeps after him enter the region.
Now, for the fix. I found a way to deal with this ever since I began making maps, because I usually make multiplayer maps for my brother and I to play, so I had this problem a lot.
Fixed Trigger:
Any Trigger
Events
Unit - a unit enters Anywhere
Conditions Actions
Trigger - Turn off (This trigger) Do Something
Do this on every trigger you make, one more line won't kill you and you will avoid any future bug which you might spend hours trying to find the source. (note: this bug happens for any kind of action, but most commonly on units entering regions, that's why this is the example)
Do NOT put the "Turn off (This trigger)" at the end of the trigger, if your trigger lasts for some time, there could be enough time for another unit to get into that region, causing the same bug, so always put it on first line.
Also note that you can turn the trigger on anytime you want using the following:
Turn Trigger On:
Any Trigger 2
Events
Something happens
Conditions Actions
Trigger - Turn on Any Trigger
__________________
Remember, always + rep those who help you. This gives people an incentive to help you (not to say you would get + rep if you helped someone too )
Or... You set up some conditions instead of turning off the trigger.
Also this tutorial is about leak removal and optimization, which I suggest you should take a good look at.
It's got nothing to do with what you where saying.
__________________
Knowledge and patience is key to success.
Knowledge is acquired through a learning process either theoretically or practically.
The more you know and can keep your calm, the more successfull you will be in life.
Yeah, I was planning on looking at it soon, also, even if not added to the main post, one tip there won't hurt anyone, will it? Plus, it can be helpfull (and tbh I have no idea where to put it, I'm not gonna create a new thread just for one lil tip, it's kinda a waste of space)
Also, sometimes you don't want a condition on the trigger (ex: red player unit enters region), you want all the players to be able to start the trigger or something, making doing a condition way harder than simply putting a "Turn off (This trigger)"
__________________
Remember, always + rep those who help you. This gives people an incentive to help you (not to say you would get + rep if you helped someone too )
If you turn trigger off it will disable actions for other players, but maybe you want to give +250 exp to each player hero that enter certain region.
I suggest boolean array in this case.
Code:
Events:
-Unit Enter THIS region
Conditions:
Actions:
If B[PlayerNumber] == false then
set B[PlayerNumber] = true
---- Actions ----
endif
I use this as raw example it really doesn't mater will you code it with GUI or script idea is same.
Dear Bribe, I have a question for you: On the way to remove that lightning is not correct (my World Edit Trigger blocks that has this script) you can explain?
Ah, I don't have the editor on this computer so I didn't know that. I will update it later. :)
Also, for (Triggering Player), it only works for PlayerUnitEvent/PlayerEvent (when converted to JASS) events. The region event isn't. But thanks for that, I see that the main post's statement was a bit broad so I will try to find time to update it for which GUI ones work and which ones don't.