Ok, so this is how it works. A custom script is Jass but you are using it in the GUI form. Jass is the language of wc3. It stands for Just Another Scripting Syntax. The GUI version is
-
Unit - Add Locust to (triggering unit)
The Custom Script version looks like this:
-
Custom script: call UnitAddAbility(GetTriggerUnit(), 'Aloc')
Since we have no Locust in GUI we need the custom script.
So here we have (triggering unit) in the GUI which is translated to GetTriggerUnit() in Jass.
Also, the ability Locust has an ID number which is Aloc.
You can set these thing to variables like so:
-
Set UnitVariable = (Last created unit)
-
Custom script: set udg_IntegerVariable = 'Aloc'
udg stands for undeclared global. This is a variable. A variable can be anything. Like x is a variable in Algebra.
the prefix "udg_" must be used before a variable in Jass.
The Custom Script I showed you has 3 parts. Some scripts have fewer or more parts.
1. The call. This is what the function will do. Here is it "UnitAddAbility" pretty simple right?
2. The subject. This is the thing which the call will act upon. Here is it a unit.
3. The object. This is the object which will be added by the call to the subject. Here it is a number or "integer." (yes even though it is letters it is an integer, don't ask me why.)
In sum, Custom Script: call TheCall(TheSubject, TheObject).
-
Custom script: call UnitAddAbility(udg_UnitVariable, 'Aloc')
-
------- Example using the variable -------
-
Custom script: call UnitAddAbility(GetLastCreatedUnit(), 'Aloc')
-
------- Example using (last created unit) in Jass -------
-
Custom script: call UnitAddAbility(GetTriggerUnit(), 'Aloc')
-
------- Example using (triggering unit) in Jass -------
-
Custom script: call UnitAddAbility(udg_UnitVariable, udg_IntegerVariable)
-
------- Example using both variables -------
-
Custom script: call UnitRemoveAbility(udg_UnitVariable, udg_IntegerVariable)
-
------- Example removing using both variables -------