Help with arrow key movement?

Status
Not open for further replies.
Level 2
Joined
Feb 12, 2005
Messages
19
As you may have guessed from the title, I need help creating arrow key movement for a character.
Can anyone here help me out?
 
Level 6
Joined
Mar 29, 2004
Messages
222
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
 
Level 2
Joined
Feb 12, 2005
Messages
19
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?..
 
Level 3
Joined
Sep 18, 2004
Messages
45
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
 
Level 2
Joined
Feb 12, 2005
Messages
19
I ment the part where you said
"Set (Whateverunit) = Triggering unit "
I can't figure out how to do that.
 
Level 2
Joined
Feb 5, 2005
Messages
19
...

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
 
Status
Not open for further replies.
Top