Inside your project, open the triggers tab (F6). Open the libraries window by hitting CTRL+SHIFT+L. Right click inside the libraries window, move your cursor to "Library" and select "Import Library..." Import my library.
Now you'll need to change the Library ID. Right click on my main library folder, move your cursor to "Library" and select "Change Library ID". Hit the checkbox, and in the text field enter 'WASD'. Hit Okay.
Plug In The Functions
Now all that's left is plugging the functions into your triggers. You will need three triggers total:
A trigger with the event "Any Player presses Down Any Key"
A trigger with the event "Any Player pressed Up Any Key"
A trigger wherein you define which unit each player is controlling
If you don't have one or any of these triggers already, make them. In the KeyDown trigger you will want to add the function WASD KeyDown Check() with the parameters Triggering Player and Key Pressed. You will want to do the same in the KeyUp trigger, except you will call WASD KeyUp Check(). Lastly, wherever you define the units that each player is controlling you will want to call WASD Set Controlled Unit(), passing the player you're setting the unit for as your Player parameter and the unit you want him/her to control as your Unit parameter.
And that's it! Simple right? You can use this for both mouse-look and top-down views. The library uses the unit's speed so no special work is needed to change the movement speed of your unit in the library, simply change your unit's speed the standard way through the data editor.
Thanks. Just, how can i change the A and D keys to rotate my unit and Q and E keys to strafe? I'd like the camera to always be behind my unit (WoW style)
If you're getting errors then you're doing something wrong. This still works exactly the same as it did when it was posted.
The tutorial is very straight forward. I just tested this on a completely new map and set it up according to my own tutorial in under 3 minutes without any problems.
Thanks. Just, how can i change the A and D keys to rotate my unit and Q and E keys to strafe? I'd like the camera to always be behind my unit (WoW style)
Use unit ->Facing Angle of Unit as the rotational value of your camera or some other similiar fashion pending on how you setted your camera. Edit the original functions for A and D to say Q and E instead. Then write your own functions for getting A and D to do unit -> unit face angle or incorperate it into the library.
Hello all, time for another rrowland tutorial. I've made this one much easier for you. :)
Download Library
First, you'll want my WASD Movement Library (Latest version): http://www.sc2mapster.com/assets/wasd-library-8-directional/
Import Library
Inside your project, open the triggers tab (F6). Open the libraries window by hitting CTRL+SHIFT+L. Right click inside the libraries window, move your cursor to "Library" and select "Import Library..." Import my library.
Now you'll need to change the Library ID. Right click on my main library folder, move your cursor to "Library" and select "Change Library ID". Hit the checkbox, and in the text field enter 'WASD'. Hit Okay.
Plug In The Functions
Now all that's left is plugging the functions into your triggers. You will need three triggers total:
If you don't have one or any of these triggers already, make them. In the KeyDown trigger you will want to add the function WASD KeyDown Check() with the parameters Triggering Player and Key Pressed. You will want to do the same in the KeyUp trigger, except you will call WASD KeyUp Check(). Lastly, wherever you define the units that each player is controlling you will want to call WASD Set Controlled Unit(), passing the player you're setting the unit for as your Player parameter and the unit you want him/her to control as your Unit parameter.
And that's it! Simple right? You can use this for both mouse-look and top-down views. The library uses the unit's speed so no special work is needed to change the movement speed of your unit in the library, simply change your unit's speed the standard way through the data editor.
Thanks. Just, how can i change the A and D keys to rotate my unit and Q and E keys to strafe? I'd like the camera to always be behind my unit (WoW style)
It was working great for me until I put in 4 characters.
Now all of the characters will move when I press the W key rather than just mine.
I haven't tested it with another real player.
Please help. Would you like a copy of my map?
Does this work with 9 players? I was doing my movement the long, hard way, but if this really does work, my map will be alot easier to make.
When i import this library and savemy map i get a syntax error on line 82
lv_tempBits = libWASD_gv_wASDState[lp_player]&0x0001;
how do i fix this?
I changed the folder ID now what?
How would i go into implementing this with 2 controllable units? (over multilayer for 2 players)
EDIT: Nvm. hit me in the face like a ton of bricks. Thank you a lot btw. You really saved me. I'll put you in my credits if i ever finish my map!
You need to change the library ID to 'WASD'. The specifics are right there in the tutorial.
I did. Note that i said "i changed the folder id"
does this still work?
followed instructions to the letter, and nothings happening.
If you're getting errors then you're doing something wrong. This still works exactly the same as it did when it was posted.
The tutorial is very straight forward. I just tested this on a completely new map and set it up according to my own tutorial in under 3 minutes without any problems.
Use unit ->Facing Angle of Unit as the rotational value of your camera or some other similiar fashion pending on how you setted your camera. Edit the original functions for A and D to say Q and E instead. Then write your own functions for getting A and D to do unit -> unit face angle or incorperate it into the library.
I didn't get any errors, it just straight didnt work.
Got it working now though, just copied the triggers straight across from the example map.
Still confused though as they were exactly the same as mine
edit: Figured out why, i mistakenly did "Any player presses the down key" rather than "Any player presses down any key"
When I try to change the ID to "WASD" the "OK" box turns grey. infact when I type any 4 character thing in there it turns grey! what am i doing wrong?
@GiveMeCake: Go
Same issue...