Osiris/Shared/DB SceneManager

From Divinity Engine Wiki
Revision as of 23:00, 25 August 2017 by Tinkerer (talk | contribs)
Jump to: navigation, search
Full Definition(s)
  • DB_SceneManager((CHARACTERGUID)_Npc,(STRING)_SceneName)
  • DB_SceneTriggerManager((STRING)_SceneName,(TRIGGERGUID)_Trigger)
  • DB_SceneTriggerManager((STRING)_SceneName,(TRIGGERGUID)_Trigger,(INTEGER)_IgnoreItems)
  • PROC Proc_SceneInterrupted((GUIDSTRING)_NPC,(CHARACTERGUID)_Player,(STRING)_SceneName,(STRING)_InterruptType)
  • PROC Proc_SceneOver((STRING)_SceneName)
Description

The scene manager can be used to group a number of NPCs and areas into a scene that should normally run in an uninterrupted way. If a player nevertheless manages to interrupt it in some way, it offers a generic interface to detect any interruptions so they can be easily handled.

DB_SceneManager lists all _Npcs that take part in the scene with identifier _SceneName. All assault crimes will be disabled for such NPCs while the scene is ongoing. They will be re-enabled after the scene has finished if they were enabled before. DB_SceneTriggerManager lists box _Triggers relevant to _SceneName. If _IgnoreItems is not specified, it is assumed to be 1. These triggers are used to detect actions that interrupt scenes.

Proc_SceneInterrupted is called when scene _SceneName is interrupted by an action. Such an interruption does not automatically end the scene. _Player can be NULL if it the player that caused the interruption is unknown. _NPC can be an item in case _IgnoreItems for a DB_SceneTriggerManager definition was 0 and an item was involved. The possible _InterruptType causes are:

  • LeftTrigger: an _Npc listed via DB_SceneManager has left a trigger listed via SceneTriggerManager
  • Attacked: an _Npc listed via DB_SceneManager was attacked by another character, but not by a summon (summons do not interrupt scenes)
  • StartedDialog: a player or companion started a dialog with an _Npc listed via DB_SceneManager
  • DestroyedItem: a player or companion destroyed an item in a trigger listed in DB_SceneTriggerManager with _IgnoreItems == 0

Proc_SceneOver must be called by you when the scene has finished (either normally, because of an interruption that you deem fatal). This will clean up everything related to the scene with name _SceneName:

  • Restore assault crimes for NPCs for whom this was disabled on initialisation.
  • For every NPC listed for this scene via DB_SceneManager, all crimes will be enabled, except as excluded by the DB_CharacterAllCrimesDisabled or DB_CharacterCrimeDisabled databases (so that you can disable all crimes for such NPCs manually on initialisation if desired, and after the scene has finished they revert to the defaults).
  • No further Proc_SceneInterrupted calls will happen for this scene.
Notes
  • /
See Also
  • /