Jump to content

[LE] How do you check an Animation Variable whilst in game?


BarnsleyLad

Recommended Posts

Hey everyone! As the title suggests, I am looking to check the value of an animation variable while I am in game... is there a console command for this?? Speaking specifically, I am looking to check the value of bIsRiding... It seems that if the player fast travels to another world space (Tamriel to Whiterun World for example) while they are mounted, the value of bIsRiding stays true, even though they are no longer on horseback... I would just like to check if this is the case, wondered if you guys had a solution! As always, many thanks :D

Link to comment
Share on other sites

Hey, it doesn't look like there's a console command for this, but there is a papyrus script function. To check, you can make a new mod, make a new quest in it that's start game enabled and put this script on it.

 

Scriptname TM_QuestScript extends Quest 

Event OnInit() 
    RegisterForKey(42) ;left shift 
EndEvent 

Event OnKeyDown(Int keyCode) 
    Debug.MessageBox(Game.GetPlayer().GetAnimationVariableBool("bIsRiding")) 
EndEvent

It will show true or false when you press the left shift key. To change keys change 42 to another scan code: https://www.creationkit.com/index.php?title=Input_Script#DXScanCodes

 

Note this does require skse. To not use SKSE you can do this:

 

Scriptname TM_QuestScript extends Quest 

Event OnInit() 
    Utility.Wait(1)
    Debug.MessageBox(Game.GetPlayer().GetAnimationVariableBool("bIsRiding")) 
EndEvent 

But that will only run once when the mod is first loaded. To have it run again you can use the console command StopQuest <QuestID> followed by StartQuest <QuestId>, the QuestID being the quest id that you put the script on.

Link to comment
Share on other sites

Hey, it doesn't look like there's a console command for this, but there is a papyrus script function. To check, you can make a new mod, make a new quest in it that's start game enabled and put this script on it.

 

Scriptname TM_QuestScript extends Quest 

Event OnInit() 
    RegisterForKey(42) ;left shift 
EndEvent 

Event OnKeyDown(Int keyCode) 
    Debug.MessageBox(Game.GetPlayer().GetAnimationVariableBool("bIsRiding")) 
EndEvent

It will show true or false when you press the left shift key. To change keys change 42 to another scan code: https://www.creationkit.com/index.php?title=Input_Script#DXScanCodes

 

Note this does require skse. To not use SKSE you can do this:

 

Scriptname TM_QuestScript extends Quest 

Event OnInit() 
    Utility.Wait(1)
    Debug.MessageBox(Game.GetPlayer().GetAnimationVariableBool("bIsRiding")) 
EndEvent 

But that will only run once when the mod is first loaded. To have it run again you can use the console command StopQuest <QuestID> followed by StartQuest <QuestId>, the QuestID being the quest id that you put the script on.

That is a pretty good idea, thanks! I never thought to make another mod to make the check, I appreciate the help!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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