Warcraft III resources & community, 2003–2006 · archived

Help with arrow key movement?

9 posts
#1

Help with arrow key movement?

As you may have guessed from the title, I need help creating arrow key movement for a character.
Can anyone here help me out?
#2
depends if its for a multiplayer map or a singleplayer map.
#3
for arrow key movement, first, you need to set a variable for the unit you are trying to move, like so


Events
Player - Player 1 (Red) Selects a unit
Conditions
(Owner of (Triggering unit)) Equal to Player 1 (Red)
Actions
Set (Whateverunit) = Triggering unit
Camera - Lock camera target for Player 1 (Red) to (Whateverunit), offset by (0.00, 0.00) using Default rotation


lock the camera onto the unit to prevent it from moving when you press an arrow key

then, using that variable, create another trigger


Events
Player - Player 1 (Red) Presses the Up Arrow key
Conditions
(None)
Actions
Unit - Order (WhateverUnit) to Move To ((Position of (WhateverUnit)) offset by (0.00, 500.00))



Events
Player - Player 1 (Red) Presses the Down Arrow key
Conditions
(None)
Actions
Unit - Order (WhateverUnit) to Move To ((Position of (WhateverUnit)) offset by (0.00, -500.00))


Events
Player - Player 1 (Red) Presses the Right Arrow key
Conditions
(None)
Actions
Unit - Order (WhateverUnit) to Move To ((Position of (WhateverUnit)) offset by (500.00, 0.00))


Events
Player - Player 1 (Red) Presses the Left Arrow key
Conditions
(None)
Actions
Unit - Order (WhateverUnit) to Move To ((Position of (WhateverUnit)) offset by (-500.00, 0.00))

there you are
#4
Crap!
I spoke too soon.
I can't find the triggers I need to set the units property to (Triggering Unit) in the first trigger!!!!
ARG...
Can anyone help me out some more?..
#5

variables?

do you mean make the unit a variable?-well if u do then jsut go into trigger editor click the yellow X name a variable variable type (unit)
then make a trigger
event-map initalization
condition-nothing
-action set variable (name of variable = the unit
not sure what u meant but hope this helps
#6
the selected unit is the (Triggering Unit)

read under the event in the small gray handwriting, it says:

Use'Event Response - Triggering Unit' to refer to the unit being selected of deselected

no worries =D
#7
generally you'll want to use booleans for constant fluid motion, but uh, i wont post that stuff until you've gotten the previous down and working
#8
I ment the part where you said
"Set (Whateverunit) = Triggering unit "
I can't figure out how to do that.
#9

...

just find Set variable...

then press on variable.
then edit variables
then on the green cross(new variable)
then call the variable Whateverunit
then set the variable type to Unit
Then press ok three times (back to configure action)
then press Value and set it to triggering unit and press ok twice :D

i made it very detailed and i hope you got everything :P