Jump to content

Detect via script: player actor side movement (strafe) movement for 3rd person view


Dobr0mysl

Recommended Posts

Hi there!

 

I just wondering, is it possible to detect some kind of event when player character is moving aside left and right (strafe) being at the 3rd person view, taking into account a task limitations?

 

Task limitations:

- player using only gamepad's stick for movement.

- gamepad's stick is not remapped to a keyboard hotkeys (A & D) and works as analog joystick, so it can't be detected without the SKSE plugin.

- no SKSE plugin for this task.

 

I know that the game does not sends analog stick events into papyrus runtime environment, so I trying to overcome this limitation "from other side" by detecting the player character's state instead, if it's possible. I tried to catch different animation events but no luck. For example, each foot movement animation always starts from a left foot. Maybe there is some undocumented animation? Or maybe you can give me a cue how I can find proper animations names? Well, maybe there is some way to detect strafe not only by using anims.

 

I need to catch an event or something that can be read by a papyrus script, exactly when player starts moving to a left side and to the right. No other things needed: only start strafing and a specific side of strafing.

Edited by NeOniq
Link to comment
Share on other sites

Without SKSE to catch the gamepad inputs, this will definitely be tricky if it is even possible. I am guessing that you want to make the mod console friendly.

 

Have you tried the TurnLeftSlow, TurnLeftFast, TurnRightSlow and TurnRightFast animation events? I am not sure that they will work but they make the most sense seeing how there is no actual "strafe" in Skyrim.

Link to comment
Share on other sites

Yeah, I tried those animations you mentioned too. For some reason they are triggered on weapon draw once and no more (I had catch them though debug notification). An I'm afraid that if I start digging inside behavior hkx-files I will find so many animations to each specific type of equipment and attacks... So that I need to register too many animations for only two states (strafe left and right).

 

So I came to a conclusion that the animations is not a solution for this task.

It's hard to find anything useful about character movement events or tricks...

 

Anyway, thanks for answer

Edited by NeOniq
Link to comment
Share on other sites

Huh, I managed hot to catch player character strafe movement. Quite simple and working good.

 

It may be useful for everyone who want to handle character movement, no matter what hotkeys is used by the player to control.

 

Here is an example of code:

 

scriptName YourScriptNameWithPlayerAlias extends ReferenceAlias
 
Function OnPlayerLoadGame()
 
;Performing unregister/register to prevent glitches when some other mod can override hooks of your script:
     UnregisterMovementKeys()
     RegisterMovementKeys()
EndFunction
 
 
Function RegisterMovementKeys()
 
     RegisterForControl("Forward")
     RegisterForControl("Back")
     RegisterForControl("Strafe Right")
     RegisterForControl("Strafe Left")
EndFunction
 
 
Function UnregisterMovementKeys()
 
     UnregisterForControl("Forward")
     UnregisterForControl("Back")
     UnregisterForControl("Strafe Right")
     UnregisterForControl("Strafe Left")
endfunction
 
 
Function OnControlDown(String control)
 
     If game.IsMovementControlsEnabled() == true
        if control == "Forward"
           ;your actions when character is moving forward
        ElseIf control == "Back"
           ;your actions when character is moving forward
        ;ElseIf other controls which you registered and want to handle
           ;your other actions when character has stopped after other movement directions
        EndIf
     EndIF
EndFunction
 
 
Function OnControlUp(string control, float HoldTime)
 
     If game.IsMovementControlsEnabled() == true
        if control == "Forward"
           ;your actions when character has stopped after moving forward
        ElseIf control == "Back"
           ;your actions when character has stopped after moving backward
        ;ElseIf other controls which you registered and want to handle
           ;your other actions when character has stopped after other movement directions
        EndIf
     EndIF
EndFunction

 

 

 

Edit:

Task not fully solved (only for controls hook part), but the gamepad needs to be hooked by a SKSE plugin for sure.

Edited by NeOniq
Link to comment
Share on other sites

  • Recently Browsing   0 members

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