Osiris/Shared/DB OneShotPlayerTrigger: Difference between revisions

From Divinity Engine Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
Line 5: Line 5:
Adding a trigger to the database [[Osiris/Shared/ProcTriggerRegisterForPlayers|registers]] the '''_Trigger''' for all players and ensures the trigger only fires once, calling the [[Osiris/Shared/ProcOneShotTriggerEntered|ProcOneShotTriggerEntered]] procedure when this happens, with the entering '''_Player''' and the '''_Trigger''' as parameters.
Adding a trigger to the database [[Osiris/Shared/ProcTriggerRegisterForPlayers|registers]] the '''_Trigger''' for all players and ensures the trigger only fires once, calling the [[Osiris/Shared/ProcOneShotTriggerEntered|ProcOneShotTriggerEntered]] procedure when this happens, with the entering '''_Player''' and the '''_Trigger''' as parameters.
===== Notes =====
===== Notes =====
* Simply unregistering the trigger when it is first triggered is not safe: if the party teleports somewhere together, multiple events may be thrown simultaneously.
* Simply registering a trigger and then unregistering it when you get the first [[Osiris/API/CharacterEnteredTrigger|CharacterEnteredTrigger]] event is not safe: if the party teleports somewhere together, multiple events may be thrown simultaneously.
===== See Also =====
===== See Also =====
* [[Osiris/Shared/ProcTriggerRegisterForPlayers|ProcTriggerRegisterForPlayers]]
* [[Osiris/Shared/ProcTriggerRegisterForPlayers|ProcTriggerRegisterForPlayers]]

Latest revision as of 11:04, 30 November 2018

Full Definition(s)
  • DB OneShotPlayerTrigger((TRIGGERGUID)_Trigger)
  • ProcOneShotTriggerEntered((CHARACTERGUID)_Player,(TRIGGERGUID)_Trigger)
Description

Adding a trigger to the database registers the _Trigger for all players and ensures the trigger only fires once, calling the ProcOneShotTriggerEntered procedure when this happens, with the entering _Player and the _Trigger as parameters.

Notes
  • Simply registering a trigger and then unregistering it when you get the first CharacterEnteredTrigger event is not safe: if the party teleports somewhere together, multiple events may be thrown simultaneously.
See Also