WASD Library (8-Directional)
Very easy-to-use WASD Library by rrowland. Currently turns your unit in the direction you are running, may later be expanded to toggle strafing/backpedaling.
Current Version: 1.1 By: rrowland
- Using mostly custom script to save a ton of trigger space. Only 11kb!
- Bitwise operations make memory footprint small, code easy to read and processing fast.
- Very simple to use.
- Supports up to 16 players.
Important: After importing you must change the library ID to ‘WASD’.
Public Functions:
WASD KeyDown Check(int Player, key 'Key Pressed')
Place this in the map's "Key Down - Any Player - Any Key" trigger.
Example:
Events UI - Player Any Player presses None key Down with shift Allow, control Allow, alt Allow Actions WASD KeyDown Check((Triggering player), (Key Pressed))
WASD KeyUp Check(int Player, key 'Key Pressed')
Place this in the map's "Key Up - Any Player - Any Key" trigger.
Example:
Events UI - Player Any Player presses None key Up with shift Allow, control Allow, alt Allow Actions WASD KeyUp Check((Triggering player), (Key Pressed))
WASD Set Controlled Unit(int Player, unit Unit)
Use this to set which unit a player is controlling with WASD.
Example:
Events Game - Map initialization Actions WASD Set Controlled Unit(1, Zealot [46.33, 46.85])
won't let me change the ID to a 4 digit thing the OK button turns grey
@BumpInTheNight: The reason the library ID needs to be WASD is because the custom code calls functions and variables within that library, and the only way to have a library do this with custom code is by specifying a custom ID. To be able to change the library ID, you must go through all the custom code in each of the WASD functions and replace "libWASD" with "lib(your library ID)".
Thank you for this Library, its as advertised very simple to setup and its been working out great for me. I've got a question about that library name, why is that the case where it needs that name as that specifically? The reason I ask is I'm using this library and I want to integrate it directly into a library that lives in a module and the only way to get it to compile is by giving that library the wasd name. Is there any work-around or better explanation of why it has to be that way?
@zeldarules28 & MLGAzrael: If you read about 7 lines in rrowland states that it supports up to 16 players.
Yea, will it work for 9 players?
About to test it out..if this works for up to 9 players I'll be overjoyed. Does it? Or is this single player only?