Jump to content

Any way to find out whether a player is jumping with papyrus script?


hidconsp

Recommended Posts

You'll need to obtain the DXScanCode of the key that the user has bound to the jump command. Then check for when that key is pressed. All of that requires SKSE

 

Obtain the DXScanCode with GetMappedKey

Register that DXScanCode so that you can use Key listening events with RegisterForKey

Then use the OnKeyDown event

 

Result, whenever the key is pressed an event will run that you can use to do whatever you need to for when the player has jumped.

 

Only issue is that jumps are so short that the script coding might not have enough time to complete what you want it to do while the player is in the air.

Link to comment
Share on other sites

You'll need to obtain the DXScanCode of the key that the user has bound to the jump command. Then check for when that key is pressed. All of that requires SKSE

 

Obtain the DXScanCode with GetMappedKey

Register that DXScanCode so that you can use Key listening events with RegisterForKey

Then use the OnKeyDown event

 

Result, whenever the key is pressed an event will run that you can use to do whatever you need to for when the player has jumped.

 

Only issue is that jumps are so short that the script coding might not have enough time to complete what you want it to do while the player is in the air.

 

 

Well I found the right answer: player.getAnimationVariableBool("bInJumpState")

Link to comment
Share on other sites

That could work too. I don't deal with animations. Thus did not think to delve into the deeper layers of those. However, my answer was not incorrect. It would have informed you of when the player was jumping too. One looks for the animation, the other looks for the user's deliberate key press. Now you need to decide which method will actually work. I have a feeling that the animation one will catch more than just jumping (i.e. falling).

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...