Jump to content

Script Question (Player Controls)


Tyrant99

Recommended Posts

Posted

I wanted to create some kind of a Boolean function that would check to see if the PlayerControls were disabled, or if the Player was currently AIDriven.

 

I found the following condition function:

 

GetPlayerControlsDisabled

 

It's available as a condition:

 

image.thumb.png.06b546778aca5463a924c991b2418d74.png

 

But looking at the documentation I can't seem to find a Papyrus equivalent. Is there anything that would work in Papyrus?

 

As a work around, I thought of maybe setting this condition as a requisite for certain Aliases to fill, and then checking whether the Aliases filled via script to sort of 'pass through' the bool for this condition... A direct approach would be nice though...

 

**************************

Edit -- Seems that the Alias approach won't work either because I can never get an optional 'conditions' alias to fill while using that condition. I'm guessing that it is a leftover from Oblivion that isn't actually viable in Skyrim... Sort of like the VATS stuff (from FO4)...

 

Damn.

Posted

There are individual check functions on the game script https://www.creationkit.com/index.php?title=Game_Script isMovementControlsEnabled for example. 

 

Checking on aidriven is a skse function on the actor script https://www.creationkit.com/index.php?title=Actor_Script see isaienabled towards the bottom

Posted
8 minutes ago, a6b7c899 said:

There are individual check functions on the game script https://www.creationkit.com/index.php?title=Game_Script isMovementControlsEnabled for example. 

 

Checking on aidriven is a skse function on the actor script https://www.creationkit.com/index.php?title=Actor_Script see isaienabled towards the bottom

Ok perfect! That's what I was looking for.

 

Only, the note on the CK page for that function doesn't exactly warm the heart lol:

 

image.png.495bcc207b64949f1755ee5f5803ff1d.png

 

Maybe I'll test a handful of them at once and only return true if they are all true... Could increase likeliness of success maybe?

Posted
4 minutes ago, Andy14 said:

 

https://www.creationkit.com/index.php?title=GetPlayerControls_-_Actor

 

If Landingpage break the Link..

 

 


bool Function GetPlayerControls() native

 

It's Member of ActorScript and Return is boolean (so true or false)

I thought that one is for checking for puppet mode, see https://www.creationkit.com/index.php?title=SetPlayerControls_-_Actor does the get work for the player? The set is a no-no but I've never tried the get...

Posted

Setplayercontrols switches the player to controlling the specified actor instead of the player character. It's one or the other, not both at the same time. 

Posted

Ok here's my Bool:

 

Bool Function PlayerHasControl()
If Game.IsMovementControlsEnabled() && Game.IsFightingControlsEnabled() && Game.IsMenucontrolsEnabled() && Game.IsActivateControlsEnabled() && PlayerRef.GetPlayerControls()
Return True
Else
Return False
EndIf
EndFunction

Tested in-game and it works perfectly for the default 'Disable Player Controls'.

 

And yes, it is mega overkill Bool logic... I did it this way because of the note on CK that one of the functions 'doesn't work reliably'.

 

Extra logic tests should keep it reliable because for them all to misfire simultaneously would be cray cray...

 

Thx for the help guys. ?

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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