DisablePlayerControls - Game

From Creation Kit
Jump to: navigation, search

Member of: Game Script

Selectively disables the player's controls.

Syntax

Function DisablePlayerControls(bool abMovement = true, bool abFighting = true, bool abCamSwitch = false, \
  bool abLooking = false, bool abSneaking = false, bool abMenu = true, bool abActivate = true, bool abJournalTabs = false, \
  int aiDisablePOVType = 0) native global

Parameters

  • abMovement: Disable the player's movement controls.
    • Default: True
  • abFighting: Disable the player's combat controls.
    • Default: True
  • abCamSwitch: Disable the ability to switch point of view.
    • Default: False
  • abLooking: Disable the player's look controls.
    • Default: False
  • abSneaking: 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
  • abMenu: Disables menu controls (Journal, Inventory, Pause, etc.).
    • Default: True
  • abActivate: Disables ability for player to activate objects.
    • Default: True
  • abJournalTabs: Disables all Journal tabs except System.
    • Default: False
  • aiDisablePOVType: What system is disabling POV.
    • 0 = Script
    • 1 = Werewolf
    • Default: 0

Return Value

None.

Examples

; Disable movement and combat
Game.DisablePlayerControls()


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

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 Game.GetPlayer().SetDontMove() or Game.GetPlayer().SetRestrained() instead.
  • If you disable movement while the hud is in "cart mode" (via 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.
  • If this is called immediately on quest start as the result of an OnInit firing, this function will not fire.

See Also