The action
"Custom script" is actually a JASS-line, used in GUI-format.
This line
always starts with
"call" when removing leaks and is
case sensitive.'
When removing leaks, the rough code goes like this:
-
Custom script: call <Variable-specific code>(udg_<variable name>[array])
But I doubt that makes a lot of sense ^^
Variable types + Remove code
Point (location): "RemoveLocation"
Unit Group (group): "DestroyGroup"
Player Group (force): "DestroyForce"
Those are the only 3 you'll probably need when using Custom scripts for removing leaks.
I'll use a location leak as an example, so it becomes:
Custom script: call RemoveLocation"
Looking good so far, but we have to tell the code which location we need to remove.
I will add a variable called "loc" (point variable without array).
Variables in GUI are User Defined Globals (shortened as udg), so we need to put "udg_" in front of our variable (not in the variable editor, but in the custom script =.=).
Also, you need to put the variable you want to remove between brackets.
It becomes:
"Custom script: call RemoveLocation(udg_loc)"
Note: now the variable would've been cleared if we didn't use an array...
(this is the standard form for variables without array).
The array needs to be put between square brackets, let's say we have used loc[1], so it becomes:
"Custom script: call RemoveLocation(udg_loc[1])"
And we're done!
Final Trigger:
-
Actions
-

Set loc[1] = (Center of (Playable map area))
-

Unit - Create 1 Footman for Player 1 (Red) at loc[1] facing Default building facing degrees
-

Custom script: call RemoveLocation(udg_loc[1])
More information on custom scripts: learn JASS... since a Custom script is a JASS-line, it's sometimes just better to learn JASS xD