Difference between revisions of "Osiris/Shared/DB SceneManager"

From Divinity Engine Wiki
Jump to: navigation, search
m
m
 
(2 intermediate revisions by the same user not shown)
Line 12: Line 12:
 
'''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:  
 
'''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'''
 
* '''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 (if a summon attacks the character, it will be reported as the '''_Player''' that interrupted the scene)
+
* '''Attacked''': an '''_Npc''' listed via '''DB_SceneManager''' was attacked by another character (if a summon attacks the character, it will be reported as the '''_Player''' that interrupted the scene), or it was teleported
 
* '''StartedDialog''': a player or companion started a dialog with an '''_Npc''' listed via '''DB_SceneManager'''
 
* '''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
 
* '''DestroyedItem''': a player or companion destroyed an item in a trigger listed in '''DB_SceneTriggerManager''' with '''_IgnoreItems''' == 0
 
* (new in Definitive Edition) '''PlayerTeleportInDialog''': a player was teleported more than 5 metres away from their original position while in dialog with one of the scene members
 
* (new in Definitive Edition) '''PlayerTeleportInDialog''': a player was teleported more than 5 metres away from their original position while in dialog with one of the scene members
 +
* (new in Definitive Edition) '''EnteredCombat''': one of the scene participants entered combat
 +
* (new in Definitive Edition) '''Died''': one of the scene participants died
  
 
'''Proc_SceneOver''' must be called by you when the scene has finished (either normally, or because of an interruption that you deem fatal). This will clean up everything related to the scene with name '''_SceneName''':
 
'''Proc_SceneOver''' must be called by you when the scene has finished (either normally, or because of an interruption that you deem fatal). This will clean up everything related to the scene with name '''_SceneName''':

Latest revision as of 10:12, 16 October 2019

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 (if a summon attacks the character, it will be reported as the _Player that interrupted the scene), or it was teleported
  • 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
  • (new in Definitive Edition) PlayerTeleportInDialog: a player was teleported more than 5 metres away from their original position while in dialog with one of the scene members
  • (new in Definitive Edition) EnteredCombat: one of the scene participants entered combat
  • (new in Definitive Edition) Died: one of the scene participants died

Proc_SceneOver must be called by you when the scene has finished (either normally, or 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
  • Adding characters to a scene does not by itself make these characters do something. Their actions in the scene still need to be scripted using either Osiris or behaviour script. This functionality only offers a generic interface to detecting interruptions affecting one or more characters/items that you defined as belonging to a partciular scene.
See Also
  • /