HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Arrow Key Moving

10-28-2003, 03:32 AM#1
Chryosmere
Hey i need to know how i can make a unit move left,right(actually turn left and right and stop when u let go of the key) and move forward(actually moveing forward) using arrow keys. I know it can be done but i need some explanation or guide. I tried looking off this other map but when i tried doing wat it did errors came up and blah! Need some help!! :bgrun:
10-28-2003, 03:33 AM#2
SpectreReturns
Just make events for it, where if you press the Left Key it moves you 150 pixels to 0 degress. 90 is up, 180 is right, 270 is down.
10-28-2003, 03:41 AM#3
Chryosmere
Umm......And how do i do that...o and does that make the unit actually turn as in turn its body in the same spot?
10-28-2003, 04:25 AM#4
Biflspud
They will if you *order* them to move; don't just move the unit.

Event: Player 1 pushes Left Arrow
Action: Order Player1Hero to Move to Location of Player1Hero offset by x, y

Voila.
10-28-2003, 04:47 AM#5
Draco
http://www.wc3campaigns.com/forums/s...threadid=27801

That has a few good examples if you need it.
10-28-2003, 05:03 AM#6
Toxicseaweed
Why not make a tutorial?
Sense its late i'll give you a brief overview of what you have to do.
Theres 2 kinds of movement
1. every time you click it gets a movement order

OR

2. While the key is pressed the unit continues to go in this action

The first one is easy. The second one on the other hand requires 8 triggers in what i've found.

you need 4 triggers to detect when the keys are being pressed and i think the first 4 can double as released *gotta play with these*
Then while the key is pressed you gotta make another trigger run that is essentially a loop that continuely tells the unit to do that movement. Of course in order to stop the loop a boolean must be made. When the player pressed the key put the boolean to true. As long as that boolean is equal to true the loop will run. Otherwise have it stop the unit. *i'm wondering if turning off the trigger will in anyway affect the lag?*

Sry for such a short tut, i hope that gives you an idea. You gotta figure some things out for yourself otherwise you won't get better in triggers *trust me i was that way in SC* goodluck :ggani: .....If you need more help just PM me............................................................... or go take the map from the thread draco posted.............
10-28-2003, 10:56 AM#7
CajunGoddess
Key arrows give me head-egg ,like the one in UT2003 and smash tv
10-28-2003, 11:20 AM#8
Datajax
yeah i agree totally^^

anyway the smash tv used different items with the arrow keys as the hotkeys (if im not mistaken) and so when u pressed it the item would activate.

cant help u anymore sry
10-28-2003, 11:34 AM#9
Ant
For one, there already IS a tutorial... I made it quite some time ago. I'll put the link here.
http://www.wc3campaigns.com/forums/s...threadid=29961

Also, it seems that the arrow key thing is probably THE MOST common question I've seen. Maybe Draco should Sticky it in the Map Development section instead.