Difference between revisions of "Osiris/API/ActivatePersistentLevelTemplate"

From Divinity Engine Wiki
Jump to: navigation, search
m
m
Line 4: Line 4:
 
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.
 
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 =====
 
===== Notes =====
 +
* Characters that get teleported as a result of this activation and that were in combat, will leave this combat. They may immediately enter it again in case the [[Modding:_Relationships_and_Alignments|alignments]] of nearby characters cause combat to start though. Items will remain in the combats they were involved in, if any. If you wish combats to remain active, use [[Osiris/API/ActivatePersistentLevelTemplateWithCombat|ActivatePersistentLevelTemplateWithCombat]] instead.
 
* To turn part of a level into a level template, select the objects, right-click and select ''Export to a level template...''
 
* 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.
 
* Level templates are grouped under the root templates and can be inserted like any other object into a level.
Line 11: Line 12:
 
* 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'''
 
* 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 =====
 
===== See Also =====
* /
+
* [[Osiris/API/ActivatePersistentLevelTemplateWithCombat|ActivatePersistentLevelTemplateWithCombat]]
 
+
 
 
[[Category:Osiris Calls|ActivatePersistentLevelTemplate]]
 
[[Category:Osiris Calls|ActivatePersistentLevelTemplate]]

Revision as of 16:47, 19 December 2017

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
  • Characters that get teleported as a result of this activation and that were in combat, will leave this combat. They may immediately enter it again in case the alignments of nearby characters cause combat to start though. Items will remain in the combats they were involved in, if any. If you wish combats to remain active, use ActivatePersistentLevelTemplateWithCombat instead.
  • 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