Difference between revisions of "Osiris/API/ActivatePersistentLevelTemplate"

From Divinity Engine Wiki
Jump to: navigation, search
(Osiris Core APIs)
 
m
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
* call '''ActivatePersistentLevelTemplate'''(''(LEVELTEMPLATEGUID)'''''_LevelTemplate''')
 
* call '''ActivatePersistentLevelTemplate'''(''(LEVELTEMPLATEGUID)'''''_LevelTemplate''')
 
===== Description =====
 
===== 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.
+
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 (within the LevelTemplateBoundTrigger specified in the ''Level'' -> ''Edit Level Data...'' of the template level) 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 10: Line 11:
 
* 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.
 
* 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'''
 
* 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'''
 +
* After setting a LevelTemplateBoundTrigger, or after changing its dimensions, be sure to go again to ''Level'' -> ''Edit Level Data...'' and click on the '''Regenerate Level Bounds''' button at the bottom of the panel.
 
===== See Also =====
 
===== See Also =====
* /
+
* [[Osiris/API/ActivatePersistentLevelTemplateWithCombat|ActivatePersistentLevelTemplateWithCombat]]
 
+
 
[[Category:Osiris Calls]]
+
[[Category:Osiris Calls|ActivatePersistentLevelTemplate]]

Latest revision as of 14:14, 21 March 2019

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 (within the LevelTemplateBoundTrigger specified in the Level -> Edit Level Data... of the template level) 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
  • After setting a LevelTemplateBoundTrigger, or after changing its dimensions, be sure to go again to Level -> Edit Level Data... and click on the Regenerate Level Bounds button at the bottom of the panel.
See Also