Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
You are using an out of date browser. It may not display this or other websites correctly. You should upgrade or use an alternative browser.
Triggers
Han Han's Battalion System.w3x
Variables
Battalion System
Read Me
Read Me pt2
Read Me pt3
---------------------------
Footman Create
Knight Create
Archer Create
Order Move
Order Attack Move
Order Patrol
Order Stop
Order Hold Position
Order Defend
Order UnDefend
Order Charge
Replace
Remove Dead Units from Groups
Pre Placed Units
Enter map-specific custom script code below. This text will be included in the map script after variables are declared and before any trigger code.
Name
Type
is_array
initial_value
PrePlacedUnits
group
No
ReplaceUnitNumber
integer
No
TempPoint
location
No
UnitNumber
integer
No
0
Ham Ham's Battalion System - Read-me Pt1.
This is a system that allows you to control hundreds of units at the same time.
GIVE ME CREDITS IF YOU USE THIS ON YOUR MAP.
Now, I will explain how it works:
"CREATE" TRIGGERS
The Create triggers creates the whole group after its trained. You dont train the units directly in the Barracks. You must make a dummy unit with the desired time and price and food costs, and make the barracks able to train this unit. Set the dummy unit's food cost the total food consumed by the squad. (e.g.: if you want a squad of 6 footmen that consumes 2 food each, the training dummy must cost 12 food.)
After this unit is trained, the Create triggers will create the battalions. You need one new Create trigger for every new unit that you want to see this system working on it.
"ORDER" TRIGGERS
This gives the squad an order when the captain gives an order. For every new squad type you add, you need to put in these triggers the following actions:.
This is an e.g. that you must write a new Move order for the "new unit":
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Ordered unit)) Equal to "New Captain"
Then - Actions
Set TempPoint = (Target point of issued order)
Unit Group - Order (Units owned by (Owner of (Ordered unit)) matching (((Unit-type of (Matching unit)) Equal to New Soldier) and ((Custom value of (Matching unit)) Equal to (Custom value of (Ordered unit))))) to Move To TempPoint
Custom script: call RemoveLocation(udg_TempPoint)
Else - Actions
Ham Ham's Battalion System - Read-me Pt2
This is a system that allows you to control hundreds of units at the same time.
GIVE ME CREDITS IF YOU USE THIS ON YOUR MAP.
REPLACE TRIGGER
When a captain die, this trigger choses a random soldier from the squad, and promotes it to a captain, making it control the remaining soldiers.
For every new squad type you add, you need to put in this trigger the following actions:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Dying unit)) Equal to "New Captain Type"
Then - Actions
Set ReplaceUnitNumber = (Custom value of (Dying unit))
Unit Group - Pick every unit in (Random 1 units from (Units owned by (Owner of (Dying unit)) matching (((Unit-type of (Matching unit)) Equal to "New soldier Tupe") and (((Matching unit) is alive) Equal to True)))) and do (Actions)
Loop - Actions
Unit - Replace (Picked unit) with a "New Captain Type" using The old unit's relative life and mana
Unit - Set the custom value of (Last replaced unit) to ReplaceUnitNumber
Else - Actions
REMOVE DEAD UNITS FROM GROUPS TRIGGER
This trigger is to prevent a dead soldier to be promoted to captain when the group captain dies. This causes the game to crash.
For every new squad unit type, both captain and soldier, you must put the condition (Unit-type of (Dying unit)) Equal to "New Unit" on this trigger conditions.
Ham Ham's Battalion System - Read-me Pt3
This is a system that allows you to control hundreds of units at the same time.
GIVE ME CREDITS IF YOU USE THIS ON YOUR MAP.
PRE PLACED UNITS TRIGGER
Automaticaly generates pre-placed captains' troops. For every new squad you add, make the following action:
Unit Group - Pick every unit in (Units of type "New Captain") and do (Actions)
Loop - Actions
Set UnitNumber = (UnitNumber + 1)
Unit - Set the custom value of (Picked unit) to UnitNumber
-------- Now, let's create the troops --------
Set TempPoint = (Position of (Picked unit))
Unit - Create 1 "New Soldier" for (Owner of (Picked unit)) at TempPoint facing (Facing of (Picked unit)) degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Unit - Create 1 "New Soldier" for (Owner of (Picked unit)) at TempPoint facing (Facing of (Picked unit)) degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
etecetera....
Dont destroy the groups before creating them, otherwise the starting units will be created for Player 1 only.
Yes, it leaks, but just a little. But dont worry, This leak will only be created once, it means its not enough to destroy your map :P
Thanks and have fun.
Unit Group - Pick every unit in (Units of type Captain) and do (Actions)
Loop - Actions
-------- First, lets set the group number --------
Set UnitNumber = (UnitNumber + 1)
Unit - Set the custom value of (Picked unit) to UnitNumber
-------- Now, let's create the troops --------
Set TempPoint = (Position of (Picked unit))
Unit - Create 1 Footman for (Owner of (Picked unit)) at TempPoint facing (Facing of (Picked unit)) degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Unit - Create 1 Footman for (Owner of (Picked unit)) at TempPoint facing (Facing of (Picked unit)) degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Unit - Create 1 Footman for (Owner of (Picked unit)) at TempPoint facing (Facing of (Picked unit)) degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Unit - Create 1 Footman for (Owner of (Picked unit)) at TempPoint facing (Facing of (Picked unit)) degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Unit - Create 1 Footman for (Owner of (Picked unit)) at TempPoint facing (Facing of (Picked unit)) degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Custom script: call RemoveLocation(udg_TempPoint)
Creates footmen when they are trained.
Footman Create
Events
Unit - A unit Finishes training a unit
Conditions
(Unit-type of (Trained unit)) Equal to Train Footmen
Actions
-------- First, lets set the group number --------
Set Variable Set UnitNumber = (UnitNumber + 1)
Unit - Set the custom value of (Trained unit) to UnitNumber
-------- Now, let's create the troops --------
Set Variable Set TempPoint = (Position of (Trained unit))
Unit - Create 1 . Captain for (Owner of (Trained unit)) at TempPoint facing 0.00 degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Set Variable Set TempPoint = (Position of (Trained unit))
Unit - Create 1 . Footman for (Owner of (Trained unit)) at TempPoint facing 0.00 degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Set Variable Set TempPoint = (Position of (Trained unit))
Unit - Create 1 . Footman for (Owner of (Trained unit)) at TempPoint facing 0.00 degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Set Variable Set TempPoint = (Position of (Trained unit))
Unit - Create 1 . Footman for (Owner of (Trained unit)) at TempPoint facing 0.00 degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Set Variable Set TempPoint = (Position of (Trained unit))
Unit - Create 1 . Footman for (Owner of (Trained unit)) at TempPoint facing 0.00 degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Set Variable Set TempPoint = (Position of (Trained unit))
Unit - Create 1 . Footman for (Owner of (Trained unit)) at TempPoint facing 0.00 degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Custom script: call RemoveLocation(udg_TempPoint)
Creates knights when they are trained.
Knight Create
Events
Unit - A unit Finishes training a unit
Conditions
(Unit-type of (Trained unit)) Equal to Train Knights
Actions
-------- First, lets set the group number --------
Set Variable Set UnitNumber = (UnitNumber + 1)
Unit - Set the custom value of (Trained unit) to UnitNumber
-------- Now, let's create the troops --------
Set Variable Set TempPoint = (Position of (Trained unit))
Unit - Create 1 . Knight Captain for (Owner of (Trained unit)) at TempPoint facing 0.00 degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Set Variable Set TempPoint = (Position of (Trained unit))
Unit - Create 1 . Knight for (Owner of (Trained unit)) at TempPoint facing 0.00 degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Set Variable Set TempPoint = (Position of (Trained unit))
Unit - Create 1 . Knight for (Owner of (Trained unit)) at TempPoint facing 0.00 degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Set Variable Set TempPoint = (Position of (Trained unit))
Unit - Create 1 . Knight for (Owner of (Trained unit)) at TempPoint facing 0.00 degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Set Variable Set TempPoint = (Position of (Trained unit))
Unit - Create 1 . Knight for (Owner of (Trained unit)) at TempPoint facing 0.00 degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Set Variable Set TempPoint = (Position of (Trained unit))
Unit - Create 1 . Knight for (Owner of (Trained unit)) at TempPoint facing 0.00 degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Custom script: call RemoveLocation(udg_TempPoint)
Creates archers when they are trained.
Archer Create
Events
Unit - A unit Finishes training a unit
Conditions
(Unit-type of (Trained unit)) Equal to Train Archers
Actions
-------- First, lets set the group number --------
Set Variable Set UnitNumber = (UnitNumber + 1)
Unit - Set the custom value of (Trained unit) to UnitNumber
-------- Now, let's create the troops --------
Set Variable Set TempPoint = (Position of (Trained unit))
Unit - Create 1 . Archer Captain for (Owner of (Trained unit)) at TempPoint facing 0.00 degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Set Variable Set TempPoint = (Position of (Trained unit))
Unit - Create 1 . Archer for (Owner of (Trained unit)) at TempPoint facing 0.00 degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Set Variable Set TempPoint = (Position of (Trained unit))
Unit - Create 1 . Archer for (Owner of (Trained unit)) at TempPoint facing 0.00 degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Set Variable Set TempPoint = (Position of (Trained unit))
Unit - Create 1 . Archer for (Owner of (Trained unit)) at TempPoint facing 0.00 degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Set Variable Set TempPoint = (Position of (Trained unit))
Unit - Create 1 . Archer for (Owner of (Trained unit)) at TempPoint facing 0.00 degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Set Variable Set TempPoint = (Position of (Trained unit))
Unit - Create 1 . Archer for (Owner of (Trained unit)) at TempPoint facing 0.00 degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Custom script: call RemoveLocation(udg_TempPoint)
Order Move
Events
Unit - A unit Is issued an order targeting a point
Conditions
Or - Any (Conditions) are true
Conditions
(Issued order) Equal to (Order(smart))
(Issued order) Equal to (Order(move))
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Ordered unit)) Equal to Captain
Then - Actions
Set Variable Set TempPoint = (Target point of issued order)
Unit Group - Order (Units owned by (Owner of (Ordered unit)) matching (((Unit-type of (Matching unit)) Equal to Footman) and ((Custom value of (Matching unit)) Equal to (Custom value of (Ordered unit)))).) to Move To . TempPoint
Custom script: call RemoveLocation(udg_TempPoint)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Ordered unit)) Equal to Knight Captain
Then - Actions
Set Variable Set TempPoint = (Target point of issued order)
Unit Group - Order (Units owned by (Owner of (Ordered unit)) matching (((Unit-type of (Matching unit)) Equal to Knight) and ((Custom value of (Matching unit)) Equal to (Custom value of (Ordered unit)))).) to Move To . TempPoint
Custom script: call RemoveLocation(udg_TempPoint)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Ordered unit)) Equal to Archer Captain
Then - Actions
Set Variable Set TempPoint = (Target point of issued order)
Unit Group - Order (Units owned by (Owner of (Ordered unit)) matching (((Unit-type of (Matching unit)) Equal to Archer) and ((Custom value of (Matching unit)) Equal to (Custom value of (Ordered unit)))).) to Move To . TempPoint
Custom script: call RemoveLocation(udg_TempPoint)
Else - Actions
Order Attack Move
Events
Unit - A unit Is issued an order targeting a point
Conditions
And - All (Conditions) are true
Conditions
(Issued order) Not equal to (Order(smart))
(Issued order) Not equal to (Order(move))
(Issued order) Not equal to (Order(patrol))
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Ordered unit)) Equal to Captain
Then - Actions
Set Variable Set TempPoint = (Target point of issued order)
Unit Group - Order (Units owned by (Owner of (Ordered unit)) matching (((Unit-type of (Matching unit)) Equal to Footman) and ((Custom value of (Matching unit)) Equal to (Custom value of (Ordered unit)))).) to Attack-Move To . TempPoint
Custom script: call RemoveLocation(udg_TempPoint)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Ordered unit)) Equal to Knight Captain
Then - Actions
Set Variable Set TempPoint = (Target point of issued order)
Unit Group - Order (Units owned by (Owner of (Ordered unit)) matching (((Unit-type of (Matching unit)) Equal to Knight) and ((Custom value of (Matching unit)) Equal to (Custom value of (Ordered unit)))).) to Attack-Move To . TempPoint
Custom script: call RemoveLocation(udg_TempPoint)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Ordered unit)) Equal to Archer Captain
Then - Actions
Set Variable Set TempPoint = (Target point of issued order)
Unit Group - Order (Units owned by (Owner of (Ordered unit)) matching (((Unit-type of (Matching unit)) Equal to Archer) and ((Custom value of (Matching unit)) Equal to (Custom value of (Ordered unit)))).) to Attack-Move To . TempPoint
Custom script: call RemoveLocation(udg_TempPoint)
Else - Actions
Order Patrol
Events
Unit - A unit Is issued an order targeting a point
Conditions
Or - Any (Conditions) are true
Conditions
(Issued order) Equal to (Order(patrol))
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Ordered unit)) Equal to Captain
Then - Actions
Set Variable Set TempPoint = (Target point of issued order)
Unit Group - Order (Units owned by (Owner of (Ordered unit)) matching (((Unit-type of (Matching unit)) Equal to Footman) and ((Custom value of (Matching unit)) Equal to (Custom value of (Ordered unit)))).) to Patrol To . TempPoint
Custom script: call RemoveLocation(udg_TempPoint)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Ordered unit)) Equal to Knight Captain
Then - Actions
Set Variable Set TempPoint = (Target point of issued order)
Unit Group - Order (Units owned by (Owner of (Ordered unit)) matching (((Unit-type of (Matching unit)) Equal to Knight) and ((Custom value of (Matching unit)) Equal to (Custom value of (Ordered unit)))).) to Patrol To . TempPoint
Custom script: call RemoveLocation(udg_TempPoint)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Ordered unit)) Equal to Archer Captain
Then - Actions
Set Variable Set TempPoint = (Target point of issued order)
Unit Group - Order (Units owned by (Owner of (Ordered unit)) matching (((Unit-type of (Matching unit)) Equal to Archer) and ((Custom value of (Matching unit)) Equal to (Custom value of (Ordered unit)))).) to Patrol To . TempPoint
Custom script: call RemoveLocation(udg_TempPoint)
Else - Actions
Order Stop
Events
Unit - A unit Is issued an order with no target
Conditions
Or - Any (Conditions) are true
Conditions
(Issued order) Equal to (Order(stop))
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Ordered unit)) Equal to Captain
Then - Actions
Unit Group - Order (Units owned by (Owner of (Ordered unit)) matching (((Unit-type of (Matching unit)) Equal to Footman) and ((Custom value of (Matching unit)) Equal to (Custom value of (Ordered unit)))).) to Stop
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Ordered unit)) Equal to Knight Captain
Then - Actions
Unit Group - Order (Units owned by (Owner of (Ordered unit)) matching (((Unit-type of (Matching unit)) Equal to Knight) and ((Custom value of (Matching unit)) Equal to (Custom value of (Ordered unit)))).) to Stop
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Ordered unit)) Equal to Archer Captain
Then - Actions
Unit Group - Order (Units owned by (Owner of (Ordered unit)) matching (((Unit-type of (Matching unit)) Equal to Archer) and ((Custom value of (Matching unit)) Equal to (Custom value of (Ordered unit)))).) to Stop
Else - Actions
Order Hold Position
Events
Unit - A unit Is issued an order with no target
Conditions
Or - Any (Conditions) are true
Conditions
(Issued order) Equal to (Order(holdposition))
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Ordered unit)) Equal to Captain
Then - Actions
Unit Group - Order (Units owned by (Owner of (Ordered unit)) matching (((Unit-type of (Matching unit)) Equal to Footman) and ((Custom value of (Matching unit)) Equal to (Custom value of (Ordered unit)))).) to Hold Position
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Ordered unit)) Equal to Knight Captain
Then - Actions
Unit Group - Order (Units owned by (Owner of (Ordered unit)) matching (((Unit-type of (Matching unit)) Equal to Knight) and ((Custom value of (Matching unit)) Equal to (Custom value of (Ordered unit)))).) to Hold Position
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Ordered unit)) Equal to Archer Captain
Then - Actions
Unit Group - Order (Units owned by (Owner of (Ordered unit)) matching (((Unit-type of (Matching unit)) Equal to Archer) and ((Custom value of (Matching unit)) Equal to (Custom value of (Ordered unit)))).) to Hold Position
Else - Actions
Order Defend
Events
Unit - A unit Is issued an order with no target
Conditions
(Unit-type of (Ordered unit)) Equal to Captain
Or - Any (Conditions) are true
Conditions
(Issued order) Equal to (Order(defend))
Actions
Unit Group - Order (Units owned by (Owner of (Ordered unit)) matching (((Unit-type of (Matching unit)) Equal to Footman) and ((Custom value of (Matching unit)) Equal to (Custom value of (Ordered unit)))).) to Human Footman - Defend
Unit - Order (Ordered unit) to Stop .
Order UnDefend
Events
Unit - A unit Is issued an order with no target
Conditions
(Unit-type of (Ordered unit)) Equal to Captain
Or - Any (Conditions) are true
Conditions
(Issued order) Equal to (Order(undefend))
Actions
Unit Group - Order (Units owned by (Owner of (Ordered unit)) matching (((Unit-type of (Matching unit)) Equal to Footman) and ((Custom value of (Matching unit)) Equal to (Custom value of (Ordered unit)))).) to Human Footman - Stop Defend
Unit - Order (Ordered unit) to Stop .
Order Charge
Events
Unit - A unit Is issued an order with no target
Conditions
(Unit-type of (Ordered unit)) Equal to Knight Captain
Or - Any (Conditions) are true
Conditions
(Issued order) Equal to (Order(berserk))
Actions
Unit Group - Order (Units owned by (Owner of (Ordered unit)) matching (((Unit-type of (Matching unit)) Equal to Knight) and ((Custom value of (Matching unit)) Equal to (Custom value of (Ordered unit)))).) to Orc Troll Berserker - Berserk
Automaticaly picks a random soldier from the battalion and promotes it to a Captain when the group Captain dies.
Replace
Events
Unit - A unit Dies
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Dying unit)) Equal to Captain
Then - Actions
Set Variable Set ReplaceUnitNumber = (Custom value of (Dying unit))
Unit Group - Pick every unit in (Random 1 units from (Units owned by (Owner of (Dying unit)) matching (((Unit-type of (Matching unit)) Equal to Footman) and (((Matching unit) is alive) Equal to True)).)) and do (Actions)
Loop - Actions
Unit - Replace (Picked unit) with a Captain using The old unit's relative life and mana
Unit - Set the custom value of (Last replaced unit) to ReplaceUnitNumber
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Dying unit)) Equal to Archer Captain
Then - Actions
Set Variable Set ReplaceUnitNumber = (Custom value of (Dying unit))
Unit Group - Pick every unit in (Random 1 units from (Units owned by (Owner of (Dying unit)) matching (((Unit-type of (Matching unit)) Equal to Archer) and (((Matching unit) is alive) Equal to True)).)) and do (Actions)
Loop - Actions
Unit - Replace (Picked unit) with a Archer Captain using The old unit's relative life and mana
Unit - Set the custom value of (Last replaced unit) to ReplaceUnitNumber
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Dying unit)) Equal to Knight Captain
Then - Actions
Set Variable Set ReplaceUnitNumber = (Custom value of (Dying unit))
Unit Group - Pick every unit in (Random 1 units from (Units owned by (Owner of (Dying unit)) matching (((Unit-type of (Matching unit)) Equal to Knight) and (((Matching unit) is alive) Equal to True)).)) and do (Actions)
Loop - Actions
Unit - Replace (Picked unit) with a Knight Captain using The old unit's relative life and mana
Unit - Set the custom value of (Last replaced unit) to ReplaceUnitNumber
Else - Actions
This prevents game to crash by promoting an already dead soldier when the captain dies.
Remove Dead Units from Groups
Events
Unit - A unit Dies
Conditions
Or - Any (Conditions) are true
Conditions
(Unit-type of (Dying unit)) Equal to Footman
(Unit-type of (Dying unit)) Equal to Archer
(Unit-type of (Dying unit)) Equal to Knight
(Unit-type of (Dying unit)) Equal to Archer Captain
(Unit-type of (Dying unit)) Equal to Captain
(Unit-type of (Dying unit)) Equal to Knight Captain
Actions
Unit - Set the custom value of (Dying unit) to 0
Creates pre-placed units.
Pre-place a captain, and the soldiers will be created automaticaly when game starts.
Pre Placed Units
Events
Time - Elapsed game time is 0.00 seconds
Conditions
Actions
Unit Group - Pick every unit in (Units of type Captain) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Custom value of (Picked unit)) Equal to 0
Then - Actions
-------- First, lets set the group number --------
Set Variable Set UnitNumber = (UnitNumber + 1)
Unit - Set the custom value of (Picked unit) to UnitNumber
-------- Now, let's create the troops --------
Set Variable Set TempPoint = (Position of (Picked unit))
Unit - Create 1 . Footman for (Owner of (Picked unit)) at TempPoint facing (Facing of (Picked unit)) degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Unit - Create 1 . Footman for (Owner of (Picked unit)) at TempPoint facing (Facing of (Picked unit)) degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Unit - Create 1 . Footman for (Owner of (Picked unit)) at TempPoint facing (Facing of (Picked unit)) degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Unit - Create 1 . Footman for (Owner of (Picked unit)) at TempPoint facing (Facing of (Picked unit)) degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Unit - Create 1 . Footman for (Owner of (Picked unit)) at TempPoint facing (Facing of (Picked unit)) degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Custom script: call RemoveLocation(udg_TempPoint)
Else - Actions
Unit Group - Pick every unit in (Units of type Knight Captain) and do (Actions)
Loop - Actions
-------- First, lets set the group number --------
Set Variable Set UnitNumber = (UnitNumber + 1)
Unit - Set the custom value of (Picked unit) to UnitNumber
-------- Now, let's create the troops --------
Set Variable Set TempPoint = (Position of (Picked unit))
Unit - Create 1 . Knight for (Owner of (Picked unit)) at TempPoint facing (Facing of (Picked unit)) degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Unit - Create 1 . Knight for (Owner of (Picked unit)) at TempPoint facing (Facing of (Picked unit)) degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Unit - Create 1 . Knight for (Owner of (Picked unit)) at TempPoint facing (Facing of (Picked unit)) degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Unit - Create 1 . Knight for (Owner of (Picked unit)) at TempPoint facing (Facing of (Picked unit)) degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Unit - Create 1 . Knight for (Owner of (Picked unit)) at TempPoint facing (Facing of (Picked unit)) degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Custom script: call RemoveLocation(udg_TempPoint)
Unit Group - Pick every unit in (Units of type Archer Captain) and do (Actions)
Loop - Actions
-------- First, lets set the group number --------
Set Variable Set UnitNumber = (UnitNumber + 1)
Unit - Set the custom value of (Picked unit) to UnitNumber
-------- Now, let's create the troops --------
Set Variable Set TempPoint = (Position of (Picked unit))
Unit - Create 1 . Archer for (Owner of (Picked unit)) at TempPoint facing (Facing of (Picked unit)) degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Unit - Create 1 . Archer for (Owner of (Picked unit)) at TempPoint facing (Facing of (Picked unit)) degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Unit - Create 1 . Archer for (Owner of (Picked unit)) at TempPoint facing (Facing of (Picked unit)) degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Unit - Create 1 . Archer for (Owner of (Picked unit)) at TempPoint facing (Facing of (Picked unit)) degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
Unit - Create 1 . Archer for (Owner of (Picked unit)) at TempPoint facing (Facing of (Picked unit)) degrees
Unit - Set the custom value of (Last created unit) to UnitNumber
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.