The following are custom functions that addresses the ammo unit or other unit other than the main unit created. This simple guide is basically to help other fellow map or modmakers who are still struggling to address the other unit other than the main unit as stated.
1. Get Unit Closest to Unit Group with less than Distance
Options : Function
Return Type : Unit
Parameters : Unit = Triggering Unit <Unit>
Unit Group = Empty Unit Group <Unit Group>
Distance = 0.0 <Real>
Hint : This function addresses the Unit from Unit Group that is closest to the triggering unit/main unit with distance of
less than.
Actions :-
If then Else Conditions
If
-> Distance between (Position of Unit [Parameter]) and Position of (Closest Unit to (Position of Unit [Parameter]) in
Unit Group [Parameter]))) <Distance [Parameter]
Then
-> Return (Closest Unit to (Position of Unit [Parameter]) in Unit Group [Parameter])
-> Return No Unit [Preset]
2. Get Created Unit/Magazine Unit from Arm Magazine Ability
Options : Function
Return Type : Unit
Parameters : Ability = No Game Link <Game Link - Ability - Arm Magazine>
Hint : This function addresses the created unit from the arm magazine ability.
Used in conjunction with Unit Is Created event.
Actions:-
If Then Else Conditions
If
-> (Ability that created unit) == Ability [Parameter]
Then
-> Return (Created unit)
-> Return No Unit [Preset]
3. Get Magazine Ammo Unit from Unit Effect
Options : Function
Return Type : Unit
Hint : This function addresses the magazine unit from unit.
Hi guys,
The following are custom functions that addresses the ammo unit or other unit other than the main unit created. This simple guide is basically to help other fellow map or modmakers who are still struggling to address the other unit other than the main unit as stated.
1. Get Unit Closest to Unit Group with less than Distance
Options : Function
Return Type : Unit
Parameters : Unit = Triggering Unit <Unit>
Unit Group = Empty Unit Group <Unit Group>
Distance = 0.0 <Real>
Hint : This function addresses the Unit from Unit Group that is closest to the triggering unit/main unit with distance of
less than.
Actions :-
If then Else Conditions
If
-> Distance between (Position of Unit [Parameter]) and Position of (Closest Unit to (Position of Unit [Parameter]) in
Unit Group [Parameter]))) < Distance [Parameter]
Then
-> Return (Closest Unit to (Position of Unit [Parameter]) in Unit Group [Parameter])
-> Return No Unit [Preset]
2. Get Created Unit/Magazine Unit from Arm Magazine Ability
Options : Function
Return Type : Unit
Parameters : Ability = No Game Link <Game Link - Ability - Arm Magazine>
Hint : This function addresses the created unit from the arm magazine ability.
Used in conjunction with Unit Is Created event.
Actions:-
If Then Else Conditions
If
-> (Ability that created unit) == Ability [Parameter]
Then
-> Return (Created unit)
-> Return No Unit [Preset]
3. Get Magazine Ammo Unit from Unit Effect
Options : Function
Return Type : Unit
Hint : This function addresses the magazine unit from unit.
Used in conjunction with Effect Used event.
Actions:-
Return (Triggering Effect Unit(Target))
Thanks.
To use the functions as in the above, create and set the Unit variable to the function as stated.
Done. Await further feedback or comments.