• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Unit movement with keyboard(GUI Trigger)

Level 8
Joined
May 11, 2007
Messages
54
In this tutorial I show how to move around with keyboard with one or more units, but only with one player :)sad:).(This will need several triggers)
First walking forward.
  • Forward On
    • Events
      • Player - Player 1 (Red) Presses the Up Arrow key
    • Conditions
    • Actions
      • Trigger - Turn on Forward <gen>
NOTE: Make sure you uncheck the "Initially on" so the units selected don't start walking without being ordered to.
  • Forward Functions
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units currently selected by Player 1 (Red)) and do (Actions)
        • Loop - Actions
          • Camera - Pan camera for Player 1 (Red) to (Position of (Picked unit)) over 1.00 seconds
          • Unit - Order (Picked unit) to Move To ((Position of (Picked unit)) offset by 110.00 towards (Facing of (Picked unit)) degrees)
  • Forward Off
    • Events
      • Player - Player 1 (Red) Releases the Up Arrow key
    • Conditions
    • Actions
      • Trigger - Turn off Forward <gen>
Now the turning left triggers.
  • Left On
    • Events
      • Player - Player 1 (Red) Presses the Left Arrow key
    • Conditions
    • Actions
      • Trigger - Turn on Left Functions <gen>
And again uncheck "Initially On" of the following trigger.
  • Left Functions
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units currently selected by Player 1 (Red)) and do (Actions)
        • Loop - Actions
          • Unit - Make (Picked unit) face ((Facing of (Triggering unit)) + 5.00) over 0.01 seconds
  • Left Off
    • Events
      • Player - Player 1 (Red) Releases the Left Arrow key
    • Conditions
    • Actions
      • Trigger - Turn off Left Functions <gen>
Now the turning right triggers
  • Right On
    • Events
      • Player - Player 1 (Red) Presses the Right Arrow key
    • Conditions
    • Actions
      • Trigger - Turn on Right Functions <gen>
And again uncheck "Initially on"
  • Right Functions
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units currently selected by Player 1 (Red)) and do (Actions)
        • Loop - Actions
          • Unit - Make (Picked unit) face ((Facing of (Triggering unit)) - 5.00) over 0.01 seconds
  • Right Off
    • Events
      • Player - Player 1 (Red) Releases the Right Arrow key
    • Conditions
    • Actions
      • Trigger - Turn off Right Functions <gen>
 
Last edited:
Level 16
Joined
Oct 30, 2004
Messages
1,277
That's 9 leaky, not effective, and simple triggers for just one player :p. You dont need to worry about the credits as I dont think many people will find this usefull.
If you, or anyone else, wants to see how to do the arrow movement properly, you can check blizzards map Azeroth Grand Prix. Everybody with the newest patch should have it in their maps folder. Its unprotected.
Also tutorials require more than just someone handing out bunch of triggers.
 
Top