Osiris/API/ActivatePersistentLevelTemplate

From Divinity Engine Wiki
Revision as of 15:52, 8 August 2017 by Tinkerer (talk | contribs) (Osiris Core APIs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Full Definition(s)
  • call ActivatePersistentLevelTemplate((LEVELTEMPLATEGUID)_LevelTemplate)
Description

Makes the persistent level template instance _LevelTemplate in the current level/region active. If previously another persistent instance of that level template was active (in this level/region or in another one), by default all interactive objects present in that previous instance will be teleported to the newly activated one. This not only holds for objects defined inside the level template, but also for characters that entered the level template instance or items that were dropped there.

Notes
  • To turn part of a level into a level template, select the objects, right-click and select Export to a level template...
  • Level templates are grouped under the root templates and can be inserted like any other object into a level.
  • In order to make a level template instance persistent, select it after inserting it, and mark its Persistent property.
  • If a level/region contains one or more persistent instances of a level template, you can define which one should be activated when the level first gets loaded by marking its IsStartingActive property. If no instance is marked like this, a random one will be activated upon level load.
  • Objects (characters, items, triggers) from a persistent level template can be directly referred (using their GUID inside the template level) both from Osisiris and behaviour scripts running in the level that contains the persistent level template instance. This is possible even if these objects are local, and these references will always refer to those object in whichever persistent level template instance is currently active.
  • If you want certain objects not to be transferred to the next activated instance of a persistent level template, you can tag them with NO_LEVELTEMPLATE_TRANSFER
See Also
  • /