Simulate/force player arrowkey press

Wratox1

Member
Reaction score
22
Does anyone know a way to force or simulate a player to press an arrowkey?

The reason i'm asking this is because i am using this arrowkeymovement system and when i change the "walk" animation on my unit to its "defend walk" animation, the animation isn't reset and the unit plays his "defend stand" animation while walking, until i release the up-arrowkey and press it down again..

So does anyone know of a way to either force/simulate a arrowkey press/release or a way to fix the system so it resets its animation(so you don't have to release and press the up-arrowkey to reset the animation)?

And by the way, i don't know much jass..

Thanks in advance

Edit: I thought of another way to make this work, by forcing the player to stand still to be able to defend/undefend, but i dont know how i would check if the unit is moving or not with the movement system i am using, any ideas?
 

Solu9

You can change this now in User CP.
Reaction score
216
Have you tried

Trigger:
  • Game - Force Player 1 (Red) to press the key Up Arrow
 

Solu9

You can change this now in User CP.
Reaction score
216
Wait a min...

The reason i'm asking this is because i am using this arrowkeymovement system and when i change the "walk" animation on my unit to its "defend walk" animation, the animation isn't reset and the unit plays his "defend stand" animation while walking, until i release the up-arrowkey and press it down again..

When you change the "walk" animation to "defend walk" the animation is NOT reset. Seems kinda obvious doesn't it? You need to change it back to the "walk" animation in your trigger.

Fx. Player - releases a key = Up Arrow.

Or am I reading it wrong?
 

Wratox1

Member
Reaction score
22
@Solu9 what it means is that when i use defend, the new animation(defend walk) isn't playing properly, the new animation is played like its stand version(defend stand) while i'm still moving forward. I could make a demo map to show you if you need more info about the problem.

Also note that i'm okay with a solution where the player have to stand completely still before activating/deactivating defend.
 

Wratox1

Member
Reaction score
22
Here's the demo, you need Newgen.
 

Attachments

  • animation_demo.w3x
    26.8 KB · Views: 255
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top