It's nitpicking, but you should know that this Special Effect call leaks:
-
Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
You create the effect, it will play its animation, and then it just... sits there. Never gets deleted or anything. Do this too many times and your map will start to eat up your RAM, get ridiculously laggy, and eventually crash (if you leak waaaay too many things). To resolve this you can do:
-
Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
-
Special Effect - Destroy (last created special effect)
However, this forces the effect to play its death animation which might not work for you (could display nothing at all if the effect has no death animation or could play an animation you don't want). To solve this you can do:
-
Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
-
Set MY_SFX_VARIABLE = (last created special effect)
-
Wait 0.50 game-time seconds //This can be whatever duration is necessary to play the animation you want to see, maybe 0.10-2.00 seconds
-
Special Effect - Destroy MY_SFX_VARIABLE
As you've learned, though, variables created in the variable editor are global and can thus be modified by any trigger at any time. So if you were to run a second trigger that used the same MY_SFX_VARIABLE while the Wait X seconds is happening, it would get overwritten and you'd never delete the first sfx (the second would get deleted 'twice'). The only way around this is with local variables, which you can only have in GUI via custom scripts. For most purposes (yours included as I understand it) the fix I posted above will work-- just make sure to add the wait at the end of the trigger if you need it at all (so you don't pause the execution of important parts of code), use a new variable for each trigger, and make sure to set it to
(last created special effect)
right after you create the effect.
For a more complete solution (one that solves the leak, doesn't involve a new variable for every trigger, and won't overwrite variables when the trigger runs more than one time simultaneously), check out Vexorian's post in
this thread. It does involve some custom scripts, but understanding what he's doing and why he's doing it will give you good insight into how to wrangle the WC3 trigger GUI into doing what you want.
______
Everything I said above also applies to locations, like
(Center of 地区 002 <gen>)
in
-
Unit - Create 1 (Unit-type of Mountain King 0001 <gen>) for Player 1 (Red) at (Center of 地区 002 <gen>) facing Default building facing degrees
The point gets 'made' when you invoke
(Center of 地区 002 <gen>)
but then never gets removed/recycled. For example, units get automatically recycled when they die/decay/dissipate and thus you don't have to do anything like this for units-- most wc3 data types don't have an automatic recycler, and some don't need them (string, integer, real, boolean). To solve this you actually
have to use a custom script:
-
Set TEMP_LOC = (Center of 地区 002 <gen>)
-
Unit - Create 1 (Unit-type of Mountain King 0001 <gen>) for Player 1 (Red) at TEMP_LOC facing Default building facing degrees
-
Custom script: call RemoveLocation(udg_TEMP_LOC)
Note that capitalization matters in the custom script, and inside the () you'll always want to put "udg_+<whatever your variable name is>". udg_ stands for user defined global.
If this seems like a chore it's better to learn to do now than wonder why your map is all laggy for no reason and have to change
every trigger in your map.