Tyrant99 Posted June 19, 2018 Posted June 19, 2018 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: 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.
a6b7c899 Posted June 19, 2018 Posted June 19, 2018 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
Tyrant99 Posted June 19, 2018 Author Posted June 19, 2018 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: 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?
Andy14 Posted June 19, 2018 Posted June 19, 2018 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)
a6b7c899 Posted June 19, 2018 Posted June 19, 2018 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...
Andy14 Posted June 19, 2018 Posted June 19, 2018 Yes, it works for the player too. It would not make sense to control an NPC while controlling the player at the same time.
a6b7c899 Posted June 19, 2018 Posted June 19, 2018 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.
Andy14 Posted June 19, 2018 Posted June 19, 2018 1 minute ago, a6b7c899 said: 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. That's the way it should be. My experience is different. Do not use this method to disable/enable player controls to the main character. Use DisablePlayerControls - Game / EnablePlayerControls - Game.
Tyrant99 Posted June 19, 2018 Author Posted June 19, 2018 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. ?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.