I don't get it... I tried to download the battledome thing as something to look off of and model this trig from but I can't download it, the lnk brings me up to this "news" page and there are no download things on it so uh, mind helping me with this thing plz?
MapArrowKeysToUnit
not ratedThis code allows you with one simple function call to give arrow key control to the player of a unit. For example:
call MapArrowKeysToUnit(Player(0), grunt)
Now the 1st player can control the grunt with the arrow keys. Normally you'd have to setup several triggers and variables by hand to do this, but this function takes care of all that for you. If at anytime you want to turn the arrow key control off, you do this:
call KillUnitKeyControl(Player(0), grunt)
Notice that you have to specify the unit too. With this code you can have the player controlling multiple units with arrow keys at the same time! This could be used for cool puzzles, like in Zelda when you move your shadow moves too.
When using this code, make sure you set the camera up so that it either follows the unit or stays in place. By default pressing the arrow keys moves the camera in game, and it's hard to focus on the guy you're moving around if everytime you try to move him the camera veers off to the side ;)
NOTE: You will need the return bug exploits and the Handle Variables code for this code to work.
SHAMELESS PLUG: If you want to see this code in a real working map, download the unprotected version of Battledome ]|[ from http://battledome.wc3campaigns.com -- check the Hameka Wave trigger.
call MapArrowKeysToUnit(Player(0), grunt)
Now the 1st player can control the grunt with the arrow keys. Normally you'd have to setup several triggers and variables by hand to do this, but this function takes care of all that for you. If at anytime you want to turn the arrow key control off, you do this:
call KillUnitKeyControl(Player(0), grunt)
Notice that you have to specify the unit too. With this code you can have the player controlling multiple units with arrow keys at the same time! This could be used for cool puzzles, like in Zelda when you move your shadow moves too.
When using this code, make sure you set the camera up so that it either follows the unit or stays in place. By default pressing the arrow keys moves the camera in game, and it's hard to focus on the guy you're moving around if everytime you try to move him the camera veers off to the side ;)
NOTE: You will need the return bug exploits and the Handle Variables code for this code to work.
SHAMELESS PLUG: If you want to see this code in a real working map, download the unprotected version of Battledome ]|[ from http://battledome.wc3campaigns.com -- check the Hameka Wave trigger.