Osiris/API/CharacterSawCharacter

From Divinity Engine Wiki
Revision as of 22:20, 22 January 2019 by Tinkerer (talk | contribs) (Document in detail when exactly CharacterSawCharacter events get thrown)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Full Definition(s)
  • event CharacterSawCharacter((CHARACTERGUID)_Character, (CHARACTERGUID)_OtherCharacter)
Description

Thrown when one _Character sees _OtherCharacter. Note that this event is only thrown if _Character is an event generator, or if the sight relation between _Character and _OtherCharacter has been previously created and is still active.

Parameters
  • _Character: the character that does the seeing.
  • _OtherCharacter: the character that is seen
Notes
  • Only player-controlled characters that are not summons, are event generators.
  • Once you call CharacterCanSee with an NPC as first parameter and a character as second parameter, a sight relation gets created for this NPC and the specified target. This sight relation will last between 0.5 and 1.0 seconds (random, to avoid having to re-evaluate the vision checks for all sight relations in the same frame).
    • If you call CharacterCanSee again for this NPC and the same target during that period, the sight relation will be extended for another random period of similar duration.
    • If a game is saved while a sight relation for two characters is active, it will only be stored into the savegame (and hence restored while loading) if the NPC can currently see the registered target.
  • This call takes sneaking into account
See Also