• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Hello, I need help with keyboard controls PLEASE

Status
Not open for further replies.
Level 4
Joined
Jun 22, 2009
Messages
36
Hi. I have been experiencing some difficulties while trying to get keyboard controls to run smoothly. For one thing, when I say Event: (Keyboard Event) Player 1 presses up arrow, the movement that I get is kind of jerky, as I can't just hold down the key and have the movement be continuous. This is due to the program ordering the unit to stop after completing the quota of movement for one press of a button. How could I counteract this?
My next problem may be more difficult. I want it to be so that when I press a key, say, D, the unit will attack any units attacking it, and play a correct animation. Any Ideas? Any help would be... well...helpful.:thumbs_up:
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Trigger A turns trigger B on when a key is pressed.

Trigger B updates every 0.03 seconds or something.

Temp_Loc_1 = position of unit
Temp_Loc_2 = Temp_Loc_1 offset by something like 32 towards facing of unit
Order unit move to Temp_Loc_2

Trigger C turns trigger B off when a key is released.

You could use a variable to use as the facing, and holding left/right modify the facing variable.
 
Level 4
Joined
Jun 22, 2009
Messages
36
COol; this could help me a lot. But, I still don't really have my answer as to how to get the unit to attack when D is pressed....
Edit; OOPS. I guess I mispoke. I'm actually still confused about stopping the movement from halting all the time. Also, when I associate an attack with an ability, the ability's animation seems to always override the animation that I want the unit to play. Please HElP...
 
Level 6
Joined
May 7, 2009
Messages
228
For the Attack=D thing, I think you'd either have to use a dummy ability, or change the default hotkeys (if you're doing a singleplayer map)
 
Status
Not open for further replies.
Top