GetGamePauseState()

From NWN Lexicon
Jump to navigationJump to search
Note: This article documents Neverwinter Nights: Enhanced Edition new content or changes/updates/fixes to 1.69 functions. These are all listed under the category and patches pages.

Returns >0 if the game is currently paused.

int GetGamePauseState(
);

Description

Returns >0 if the game is currently paused:

  • 0: Game is not paused.
  • 1: Timestop
  • 2: Active Player Pause (optionally on top of timestop)


Remarks

The pause functions were added primarily to allow turn based stuff using OnPlayerTarget.

Note the game nominally won't usually run scripts when the game is paused, however there are major exceptions, in particular:

  • OnPlayerTarget can fire, so you can pause the game just after enabling this mode to have it be a turn based mode of sorts
  • Spell Scripts fire (Timestop, DM cast spells in pause) which may also trigger OnDamaged (note SignalEvent essentially delays a firing of an event meaning OnSpellCastAt won't fire)
  • NUI scripts could fire since the UI can still be interacted with
  • GUI events still occur - this may cause some scripts (NWNX or otherwise) to fire (such as the On Disabled GUI events)
  • The game console, via. DM or Debug Mode, has a way to execute scripts anytime
  • ExecuteScript can run immediately off any of the other events here
  • Probably others not thought about! Please update.


Version

This function was added in 1.87.8193.35 of NWN:EE.


Example

This article is in need of examples. You can help the NWN Lexicon by showing how to use this code effectively.


See Also

functions:

SetGameActivePause()


 author: Shadguy