hidconsp Posted July 8, 2014 Share Posted July 8, 2014 I am really intimidated by this. I want to restrict the player from doing something during a jump, but there seems to be no way to find out whether the player is jumping? Can anyone please help? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted July 8, 2014 Share Posted July 8, 2014 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 GetMappedKeyRegister that DXScanCode so that you can use Key listening events with RegisterForKeyThen 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 More sharing options...
hidconsp Posted July 8, 2014 Author Share Posted July 8, 2014 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 GetMappedKeyRegister that DXScanCode so that you can use Key listening events with RegisterForKeyThen 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 More sharing options...
IsharaMeradin Posted July 8, 2014 Share Posted July 8, 2014 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 More sharing options...
Recommended Posts