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
Key Movement.w3x
Variables
DO NOT COPY THIS
No Kill
Visibility
Angles Info
Win
Movement Triggers
-----Export Readme-----
Unit Setup (SHOULD be Modified)
Moving Unit
Selected Unit
Deselect Unit
Unit Dies
Pressed Buttons
Down On
Left On
Up On
Right On
Realease Buttons
Down Off
Left Off
Up Off
Right Off
Movement
Movement Trigger
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
MovingUnit
unit
Yes
ZZ_DOWN_Active
boolean
Yes
ZZ_LEFT_Active
boolean
Yes
ZZ_RIGHT_Active
boolean
Yes
ZZ_UP_Active
boolean
Yes
No Kill
Events
Map initialization
Conditions
Actions
Player - Make Player 1 (Red) treat Player 2 (Blue) as an Ally with shared vision
Player - Make Player 2 (Blue) treat Player 1 (Red) as an Ally with shared vision
Visibility
Events
Map initialization
Conditions
Actions
Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across (Playable map area)
These are the angles at which unit will move.
Angles Info
Events
Conditions
Actions
-------- Up Right 45 --------
-------- Up Left 135 --------
-------- Down Right 315 --------
-------- Down Left 225 --------
-------- Down 270 --------
-------- Left 180 --------
-------- Up 90 --------
-------- Right 0 --------
Win
Events
Unit - A unit enters Region_000 <gen>
Conditions
(Entering unit) Equal to Peasant 0000 <gen>
Actions
Game - Display to (All players) the text: Congratulations, you are the master of arrow-key movement =P
Trigger - Turn off (This trigger)
Only thing you have to do in order to import this system into your map
is copy the map on the left called "Movement Triggers" and the ONLY
Trigger you have to modify is "Unit Setup".
Ingame it is recomended that the camera is going to be locked to the unit.
If you want the "Moving Unit" to change in game when you select other unit, just enable triggers "Select Unit", "Deselect Unit" and "Unit Dies".
These variable units are the ones that will actually move for each player.
The variable array is the player colour number. (1-12)
These variables can also be modifyed using different triggers with different events and conditions.
Moving Unit
Events
Map initialization
Conditions
Actions
Set Variable Set MovingUnit[1] = No unit
Set Variable Set MovingUnit[2] = No unit
Set Variable Set MovingUnit[3] = No unit
Set Variable Set MovingUnit[4] = No unit
Set Variable Set MovingUnit[5] = No unit
Set Variable Set MovingUnit[6] = No unit
Set Variable Set MovingUnit[7] = No unit
Set Variable Set MovingUnit[8] = No unit
Set Variable Set MovingUnit[9] = No unit
Set Variable Set MovingUnit[10] = No unit
Set Variable Set MovingUnit[11] = No unit
Set Variable Set MovingUnit[12] = No unit
If you want the "Moving Unit" to change in game when you select other unit, just enable triggers "Select Unit", "Deselect Unit" and "Unit Dies".
Selected Unit
Events
Player - Player 1 (Red) Selects a unit
Player - Player 2 (Blue) Selects a unit
Player - Player 3 (Teal) Selects a unit
Player - Player 4 (Purple) Selects a unit
Player - Player 5 (Yellow) Selects a unit
Player - Player 6 (Orange) Selects a unit
Player - Player 7 (Green) Selects a unit
Player - Player 8 (Pink) Selects a unit
Player - Player 9 (Gray) Selects a unit
Player - Player 10 (Light Blue) Selects a unit
Player - Player 11 (Dark Green) Selects a unit
Player - Player 12 (Brown) Selects a unit
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Triggering unit)) Equal to (Triggering player)
Then - Actions
Set Variable Set MovingUnit[(Player number of (Triggering player))] = (Triggering unit)
Camera - Lock camera target for (Triggering player) to (Triggering unit) , offset by ( 0 , 0 ) using Default rotation
Else - Actions
Do nothing
If you want the "Moving Unit" to change in game when you select other unit, just enable triggers "Select Unit", "Deselect Unit" and "Unit Dies".
Deselect Unit
Events
Player - Player 1 (Red) Deselects a unit
Player - Player 2 (Blue) Deselects a unit
Player - Player 3 (Teal) Deselects a unit
Player - Player 4 (Purple) Deselects a unit
Player - Player 5 (Yellow) Deselects a unit
Player - Player 6 (Orange) Deselects a unit
Player - Player 7 (Green) Deselects a unit
Player - Player 8 (Pink) Deselects a unit
Player - Player 9 (Gray) Deselects a unit
Player - Player 10 (Light Blue) Deselects a unit
Player - Player 11 (Dark Green) Deselects a unit
Player - Player 12 (Brown) Deselects a unit
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Triggering unit) Equal to MovingUnit[(Player number of (Triggering player))]
Then - Actions
Unit - Order MovingUnit[(Player number of (Triggering player))] to Stop .
Set Variable Set MovingUnit[(Player number of (Triggering player))] = No unit
Camera - Reset camera for (Triggering player) to standard game-view over 0 seconds
Else - Actions
Do nothing
If you want the "Moving Unit" to change in game when you select other unit, just enable triggers "Select Unit", "Deselect Unit" and "Unit Dies".
Unit Dies
Events
Unit - A unit Dies
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Triggering unit) Equal to MovingUnit[(Player number of (Triggering player))]
Then - Actions
Set Variable Set MovingUnit[(Player number of (Triggering player))] = No unit
Camera - Reset camera for (Triggering player) to standard game-view over 0 seconds
Else - Actions
Do nothing
Down On
Events
Player - Player 1 (Red) Presses the Down Arrow key
Player - Player 2 (Blue) Presses the Down Arrow key
Player - Player 3 (Teal) Presses the Down Arrow key
Player - Player 4 (Purple) Presses the Down Arrow key
Player - Player 5 (Yellow) Presses the Down Arrow key
Player - Player 6 (Orange) Presses the Down Arrow key
Player - Player 7 (Green) Presses the Down Arrow key
Player - Player 8 (Pink) Presses the Down Arrow key
Player - Player 9 (Gray) Presses the Down Arrow key
Player - Player 10 (Light Blue) Presses the Down Arrow key
Player - Player 11 (Dark Green) Presses the Down Arrow key
Player - Player 12 (Brown) Presses the Down Arrow key
Conditions
Actions
Set Variable Set ZZ_DOWN_Active[(Player number of (Triggering player))] = "true"
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(MovingUnit[(Player number of (Triggering player))] is alive) Equal to True
Then - Actions
Trigger - Run Movement_Trigger <gen> (checking conditions)
Else - Actions
Do nothing
Left On
Events
Player - Player 1 (Red) Presses the Left Arrow key
Player - Player 2 (Blue) Presses the Left Arrow key
Player - Player 3 (Teal) Presses the Left Arrow key
Player - Player 4 (Purple) Presses the Left Arrow key
Player - Player 5 (Yellow) Presses the Left Arrow key
Player - Player 6 (Orange) Presses the Left Arrow key
Player - Player 7 (Green) Presses the Left Arrow key
Player - Player 8 (Pink) Presses the Left Arrow key
Player - Player 9 (Gray) Presses the Left Arrow key
Player - Player 10 (Light Blue) Presses the Left Arrow key
Player - Player 11 (Dark Green) Presses the Left Arrow key
Player - Player 12 (Brown) Presses the Left Arrow key
Conditions
Actions
Set Variable Set ZZ_LEFT_Active[(Player number of (Triggering player))] = "true"
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(MovingUnit[(Player number of (Triggering player))] is alive) Equal to True
Then - Actions
Trigger - Run Movement_Trigger <gen> (checking conditions)
Else - Actions
Do nothing
Up On
Events
Player - Player 1 (Red) Presses the Up Arrow key
Player - Player 2 (Blue) Presses the Up Arrow key
Player - Player 3 (Teal) Presses the Up Arrow key
Player - Player 4 (Purple) Presses the Up Arrow key
Player - Player 5 (Yellow) Presses the Up Arrow key
Player - Player 6 (Orange) Presses the Up Arrow key
Player - Player 7 (Green) Presses the Up Arrow key
Player - Player 8 (Pink) Presses the Up Arrow key
Player - Player 9 (Gray) Presses the Up Arrow key
Player - Player 10 (Light Blue) Presses the Up Arrow key
Player - Player 11 (Dark Green) Presses the Up Arrow key
Player - Player 12 (Brown) Presses the Up Arrow key
Conditions
Actions
Set Variable Set ZZ_UP_Active[(Player number of (Triggering player))] = "true"
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(MovingUnit[(Player number of (Triggering player))] is alive) Equal to True
Then - Actions
Trigger - Run Movement_Trigger <gen> (checking conditions)
Else - Actions
Do nothing
Right On
Events
Player - Player 1 (Red) Presses the Right Arrow key
Player - Player 2 (Blue) Presses the Right Arrow key
Player - Player 3 (Teal) Presses the Right Arrow key
Player - Player 4 (Purple) Presses the Right Arrow key
Player - Player 5 (Yellow) Presses the Right Arrow key
Player - Player 6 (Orange) Presses the Right Arrow key
Player - Player 7 (Green) Presses the Right Arrow key
Player - Player 8 (Pink) Presses the Right Arrow key
Player - Player 9 (Gray) Presses the Right Arrow key
Player - Player 10 (Light Blue) Presses the Right Arrow key
Player - Player 11 (Dark Green) Presses the Right Arrow key
Player - Player 12 (Brown) Presses the Right Arrow key
Conditions
Actions
Set Variable Set ZZ_RIGHT_Active[(Player number of (Triggering player))] = "true"
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(MovingUnit[(Player number of (Triggering player))] is alive) Equal to True
Then - Actions
Trigger - Run Movement_Trigger <gen> (checking conditions)
Else - Actions
Do nothing
Down Off
Events
Player - Player 1 (Red) Releases the Down Arrow key
Player - Player 2 (Blue) Releases the Down Arrow key
Player - Player 3 (Teal) Releases the Down Arrow key
Player - Player 4 (Purple) Releases the Down Arrow key
Player - Player 5 (Yellow) Releases the Down Arrow key
Player - Player 6 (Orange) Releases the Down Arrow key
Player - Player 7 (Green) Releases the Down Arrow key
Player - Player 8 (Pink) Releases the Down Arrow key
Player - Player 9 (Gray) Releases the Down Arrow key
Player - Player 10 (Light Blue) Releases the Down Arrow key
Player - Player 11 (Dark Green) Releases the Down Arrow key
Player - Player 12 (Brown) Releases the Down Arrow key
Conditions
Actions
Set Variable Set ZZ_DOWN_Active[(Player number of (Triggering player))] = "false"
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
ZZ_DOWN_Active[(Player number of (Triggering player))] Equal to False
ZZ_LEFT_Active[(Player number of (Triggering player))] Equal to False
ZZ_UP_Active[(Player number of (Triggering player))] Equal to False
ZZ_RIGHT_Active[(Player number of (Triggering player))] Equal to False
Then - Actions
Unit - Order MovingUnit[(Player number of (Triggering player))] to Stop .
Else - Actions
Do nothing
Left Off
Events
Player - Player 1 (Red) Releases the Left Arrow key
Player - Player 2 (Blue) Releases the Left Arrow key
Player - Player 3 (Teal) Releases the Left Arrow key
Player - Player 4 (Purple) Releases the Left Arrow key
Player - Player 5 (Yellow) Releases the Left Arrow key
Player - Player 6 (Orange) Releases the Left Arrow key
Player - Player 7 (Green) Releases the Left Arrow key
Player - Player 8 (Pink) Releases the Left Arrow key
Player - Player 9 (Gray) Releases the Left Arrow key
Player - Player 10 (Light Blue) Releases the Left Arrow key
Player - Player 11 (Dark Green) Releases the Left Arrow key
Player - Player 12 (Brown) Releases the Left Arrow key
Conditions
Actions
Set Variable Set ZZ_LEFT_Active[(Player number of (Triggering player))] = "false"
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
ZZ_DOWN_Active[(Player number of (Triggering player))] Equal to False
ZZ_LEFT_Active[(Player number of (Triggering player))] Equal to False
ZZ_UP_Active[(Player number of (Triggering player))] Equal to False
ZZ_RIGHT_Active[(Player number of (Triggering player))] Equal to False
Then - Actions
Unit - Order MovingUnit[(Player number of (Triggering player))] to Stop .
Else - Actions
Do nothing
Up Off
Events
Player - Player 1 (Red) Releases the Up Arrow key
Player - Player 2 (Blue) Releases the Up Arrow key
Player - Player 3 (Teal) Releases the Up Arrow key
Player - Player 4 (Purple) Releases the Up Arrow key
Player - Player 5 (Yellow) Releases the Up Arrow key
Player - Player 6 (Orange) Releases the Up Arrow key
Player - Player 7 (Green) Releases the Up Arrow key
Player - Player 8 (Pink) Releases the Up Arrow key
Player - Player 9 (Gray) Releases the Up Arrow key
Player - Player 10 (Light Blue) Releases the Up Arrow key
Player - Player 11 (Dark Green) Releases the Up Arrow key
Player - Player 12 (Brown) Releases the Up Arrow key
Conditions
Actions
Set Variable Set ZZ_UP_Active[(Player number of (Triggering player))] = "false"
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
ZZ_DOWN_Active[(Player number of (Triggering player))] Equal to False
ZZ_LEFT_Active[(Player number of (Triggering player))] Equal to False
ZZ_UP_Active[(Player number of (Triggering player))] Equal to False
ZZ_RIGHT_Active[(Player number of (Triggering player))] Equal to False
Then - Actions
Unit - Order MovingUnit[(Player number of (Triggering player))] to Stop .
Else - Actions
Do nothing
Right Off
Events
Player - Player 1 (Red) Releases the Right Arrow key
Player - Player 2 (Blue) Releases the Right Arrow key
Player - Player 3 (Teal) Releases the Right Arrow key
Player - Player 4 (Purple) Releases the Right Arrow key
Player - Player 5 (Yellow) Releases the Right Arrow key
Player - Player 6 (Orange) Releases the Right Arrow key
Player - Player 7 (Green) Releases the Right Arrow key
Player - Player 8 (Pink) Releases the Right Arrow key
Player - Player 9 (Gray) Releases the Right Arrow key
Player - Player 10 (Light Blue) Releases the Right Arrow key
Player - Player 11 (Dark Green) Releases the Right Arrow key
Player - Player 12 (Brown) Releases the Right Arrow key
Conditions
Actions
Set Variable Set ZZ_RIGHT_Active[(Player number of (Triggering player))] = "false"
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
ZZ_DOWN_Active[(Player number of (Triggering player))] Equal to False
ZZ_LEFT_Active[(Player number of (Triggering player))] Equal to False
ZZ_UP_Active[(Player number of (Triggering player))] Equal to False
ZZ_RIGHT_Active[(Player number of (Triggering player))] Equal to False
Then - Actions
Unit - Order MovingUnit[(Player number of (Triggering player))] to Stop .
Else - Actions
Do nothing
Do NOT make Event of this trigger to "Time - Elapsed game time is 0.01 seconds" (Or something near that) because if you do that then the game will crush when map is loaded.
Actually its better not to modify this trigger at all.
Movement Trigger
Events
Conditions
Actions
-------- Up Right 45 --------
For each (Integer A) from 1 to 12 , do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
ZZ_UP_Active[(Integer A)] Equal to True
ZZ_RIGHT_Active[(Integer A)] Equal to True
Then - Actions
Unit - Order MovingUnit[(Integer A)] to Move To . ((Position of MovingUnit[(Integer A)]) offset by ((Current movement speed of MovingUnit[(Integer A)]) + 100.00) towards 45.00 degrees.)
Wait 1.00 seconds
Trigger - Run (This trigger) (checking conditions)
Skip remaining actions
Else - Actions
-------- Up Left 135 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
ZZ_UP_Active[(Integer A)] Equal to True
ZZ_LEFT_Active[(Integer A)] Equal to True
Then - Actions
Unit - Order MovingUnit[(Integer A)] to Move To . ((Position of MovingUnit[(Integer A)]) offset by ((Current movement speed of MovingUnit[(Integer A)]) + 100.00) towards 135.00 degrees.)
Wait 1.00 seconds
Trigger - Run (This trigger) (checking conditions)
Skip remaining actions
Else - Actions
-------- Down Right 315 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
ZZ_DOWN_Active[(Integer A)] Equal to True
ZZ_RIGHT_Active[(Integer A)] Equal to True
Then - Actions
Unit - Order MovingUnit[(Integer A)] to Move To . ((Position of MovingUnit[(Integer A)]) offset by ((Current movement speed of MovingUnit[(Integer A)]) + 100.00) towards 315.00 degrees.)
Wait 1.00 seconds
Trigger - Run (This trigger) (checking conditions)
Skip remaining actions
Else - Actions
-------- Down Left 225 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
ZZ_DOWN_Active[(Integer A)] Equal to True
ZZ_LEFT_Active[(Integer A)] Equal to True
Then - Actions
Unit - Order MovingUnit[(Integer A)] to Move To . ((Position of MovingUnit[(Integer A)]) offset by ((Current movement speed of MovingUnit[(Integer A)]) + 100.00) towards 225.00 degrees.)
Wait 1.00 seconds
Trigger - Run (This trigger) (checking conditions)
Skip remaining actions
Else - Actions
-------- Down 270 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
ZZ_DOWN_Active[(Integer A)] Equal to True
Then - Actions
Unit - Order MovingUnit[(Integer A)] to Move To . ((Position of MovingUnit[(Integer A)]) offset by ((Current movement speed of MovingUnit[(Integer A)]) + 100.00) towards 270.00 degrees.)
Wait 1.00 seconds
Trigger - Run (This trigger) (checking conditions)
Skip remaining actions
Else - Actions
-------- Left 180 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
ZZ_LEFT_Active[(Integer A)] Equal to True
Then - Actions
Unit - Order MovingUnit[(Integer A)] to Move To . ((Position of MovingUnit[(Integer A)]) offset by ((Current movement speed of MovingUnit[(Integer A)]) + 100.00) towards 180.00 degrees.)
Wait 1.00 seconds
Trigger - Run (This trigger) (checking conditions)
Skip remaining actions
Else - Actions
-------- Up 90 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
ZZ_UP_Active[(Integer A)] Equal to True
Then - Actions
Unit - Order MovingUnit[(Integer A)] to Move To . ((Position of MovingUnit[(Integer A)]) offset by ((Current movement speed of MovingUnit[(Integer A)]) + 100.00) towards 90.00 degrees.)
Wait 1.00 seconds
Trigger - Run (This trigger) (checking conditions)
Skip remaining actions
Else - Actions
-------- Right 0 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
ZZ_RIGHT_Active[(Integer A)] Equal to True
Then - Actions
Unit - Order MovingUnit[(Integer A)] to Move To . ((Position of MovingUnit[(Integer A)]) offset by ((Current movement speed of MovingUnit[(Integer A)]) + 100.00) towards 0.00 degrees.)
Wait 1.00 seconds
Trigger - Run (This trigger) (checking conditions)
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.