Script:setplayercontrols: Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 3: | Line 3: | ||
|parameters= | |parameters= | ||
enable bool Enable or disable player input | enable bool Enable or disable player input | ||
|intro=Disabling the player controls prevents any player input including moving, casting spells, using items or interacting with the [[Gameplay#HUD|HUD]] in any way. It does however '''not''' hide the HUD, which must be done separately via the {{Command|playerinterface}} command. | |intro=Disabling the player controls prevents any player input including moving, casting spells, using items or interacting with the [[Gameplay#HUD|HUD]] in any way. It does however '''not''' hide the HUD, which must be done separately via the {{Command|playerinterface}} or {{Command|cinemascope}} command. | ||
When the player controls is disabled, all spells cast by the player are cancelled as well as any {{Spell|night vision}}, {{Spell|levitate}}, {{Spell|speed}} and {{Spell|flying eye}} spells cast on the player. All [[:Category:NPCs|NPCs]] are notified [[Script:Events#Execution|asynchronously]] via the {{Event|controls_off}} or {{Event|controls_on}} event when disabling or enabling the controls respectively. {{Command|setplayercontrols|off/on}} does not send any events and does not cancel any spells if the controls are already disabled. | When the player controls is disabled, all spells cast by the player are cancelled as well as any {{Spell|night vision}}, {{Spell|levitate}}, {{Spell|speed}} and {{Spell|flying eye}} spells cast on the player. All [[:Category:NPCs|NPCs]] are notified [[Script:Events#Execution|asynchronously]] via the {{Event|controls_off}} or {{Event|controls_on}} event when disabling or enabling the controls respectively. {{Command|setplayercontrols|off/on}} does not send any events and does not cancel any spells if the controls are already disabled. |
Revision as of 17:01, 18 June 2022
The setplayercontrols
script command is used to enable or disable player input. Disabling the player controls prevents any player input including moving, casting spells, using items or interacting with the HUD in any way. It does however not hide the HUD, which must be done separately via the playerinterface
or cinemascope
command.
When the player controls is disabled, all spells cast by the player are cancelled as well as any Night vision (), Levitate (), Speed () and Flying eye () spells cast on the player. All NPCs are notified asynchronously via the controls_off
or controls_on
event when disabling or enabling the controls respectively. setplayercontrols off/on
does not send any events and does not cancel any spells if the controls are already disabled.
Turning of player input also pauses the players natural regeneration as well as damage from poison and starvation. Additionally, the specialfx heal
command has no effect while the player input is disabled.
Usage
setplayercontrols <enable>
Context: Ignored
Parameters:
Parameter | Type | Description |
---|---|---|
enable |
bool |
Enable or disable player input |