Osiris/API/CharacterSetForceSynch: Difference between revisions

From Divinity Engine Wiki
Jump to navigation Jump to search
(Osiris Core APIs)
 
mNo edit summary
Line 13: Line 13:
* If this function is called while the character was inactive, it will '''''not'''''  make it active. It will only keep the character active once it has become active due to a player being nearby, or if it receives an event.
* If this function is called while the character was inactive, it will '''''not'''''  make it active. It will only keep the character active once it has become active due to a player being nearby, or if it receives an event.
* As the name and declaration imply, this cannot be used for items. You can use '''ItemSetForceSynch''' for them instead, with the same caveats.
* As the name and declaration imply, this cannot be used for items. You can use '''ItemSetForceSynch''' for them instead, with the same caveats.
* Off-stage characters cannot be force-synchronised (it may appear to work, but will stop when saving/reloading).
===== See Also =====
===== See Also =====
* [[Osiris/API/ItemSetForceSynch]]<u> </u>
* [[Osiris/API/ItemSetForceSynch|ItemSetForceSynch]]
   
   
[[Category:Osiris Calls]]
[[Category:Osiris Calls]]

Revision as of 16:01, 17 August 2017

Full Definition(s)
  • call CharacterSetForceSynch((CHARACTERGUID)_Character)
Description

Reactions from behaviour scripts are only active if at least one player character is "nearby" (currently: within 30 meters). This routine can be used to force _Character's reactions to remain active even if no player character are nearby, by passing 1 as _Bool. Once the character's behaviours no longer need to remain permanently active, you can make its activity status again depend on the nearness of a player character by calling it with 0 as _Bool.

Notes
  • Use this functionality very sparingly, as it can easily lead to a lot of unnecessary overhead.
  • If this function is called while the character was inactive, it will not make it active. It will only keep the character active once it has become active due to a player being nearby, or if it receives an event.
  • As the name and declaration imply, this cannot be used for items. You can use ItemSetForceSynch for them instead, with the same caveats.
  • Off-stage characters cannot be force-synchronised (it may appear to work, but will stop when saving/reloading).
See Also