Background for Skyrim SE
Member of the Game script
voidfunctionDisablePlayerControls(boolabMovement=true, boolabFighting=true, boolabCamSwitch=false, boolabLooking=false, boolabSneaking=false, boolabMenu=true, boolabActivate=true, boolabJournalTabs=false, intaiDisablePOVType=0)NativeGlobal

Description

Wiki Description

Selectively disables the player's controls.

Documentation Comment

Disables the user's controls


Caveats

CK Wiki - Notes

  • Disabling movement also disables the UI (at least partially), and other actors can't attack a player with a disabled movement. You may want to consider using Actor.SetDontMove(...) or Actor.SetRestrained(...) instead.
  • Disabling player movement also disables the ability for the player to activate objects.
  • If you disable movement while the hud is in "cart mode" (via Game.SetHudCartMode(...)) then the "cart mode" will be lost until you re-enable movement again.
  • This can be used if you want to close in game menus and other screens opened by player. Simply call this then enable back the controls. Tested with player inventory and opened books. Doesn't seem to work on containers.
  • If this is called immediately on quest start as the result of an OnInit firing, this function will not fire.

Parameters

boolabMovement=true

CK Wiki Description

Disable the player's movement controls.

  • Default:True

boolabFighting=true

CK Wiki Description

Disable the player's combat controls.

  • Default:True

boolabCamSwitch=false

CK Wiki Description

Disable the ability to switch point of view.

  • Default:False

boolabLooking=false

CK Wiki Description

Disable the player's look controls.

  • Default:False

boolabSneaking=false

CK Wiki Description

Disable the player's sneak controls. This will make the player stand up if they are currently sneaking. Disabling movement controls also disables sneaking.

  • Default:False

boolabMenu=true

CK Wiki Description

Disables menu controls (Journal, Inventory, Pause, etc.).

  • Default:True

boolabActivate=true

CK Wiki Description

Disables ability for player to activate objects.

  • Default:True

boolabJournalTabs=false

CK Wiki Description

Disables all Journal tabs except System.

  • Default:False

intaiDisablePOVType=0

CK Wiki Description

What system is disabling POV.

  • 0 = Script
  • 1 = Werewolf
  • Default:0

Examples

; Disable movement and combat
Game.DisablePlayerControls()
; Disable just camera switching
Game.DisablePlayerControls(false, false, true, false, false, false, false)

Auto-Generated Example

bool myBool__abMovement
bool myBool__abFighting
bool myBool__abCamSwitch
bool myBool__abLooking
bool myBool__abSneaking
bool myBool__abMenu
bool myBool__abActivate
bool myBool__abJournalTabs
int myInt__aiDisablePOVType

Game.DisablePlayerControls(myBool__abMovement, myBool__abFighting, myBool__abCamSwitch, myBool__abLooking, myBool__abSneaking, myBool__abMenu, myBool__abActivate, myBool__abJournalTabs, myInt__aiDisablePOVType)

Related Pages


Additional References

View this function’s page on the Skyrim Creation Kit Wiki

Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.