Description:
// MAP 2/14/2009 // EXPERIMENTAL // Creates a new area based on an existing area. The new area is loaded from // disk (so created/destroyed contetns in the original area will not be duplicated) // however the walkmesh is shared with the existing area to reduce // lag during load time, as well as to keep memory consumption lower.
object CreateInstancedAreaFromSource(object oArea); |
|---|
NWN2 introduced near the end of it's Update Life cycle a very powerful function - allowing people to uniquely instance off areas. For single player modules, th
Overview:
- Each uniquely instanced area is loaded from disk preserving the original state of that area
- Any changes to the area during run time, Created or Destroyed Objects will not follow to the instanced version.
- Walkmesh is shared among each instance to reduce lag and lower memory usage
- Can only instance an area that is created in the toolset and has it's own .TRX / Walkmesh.
- You cannot instance an instance of an area.
- Instances created can never be deleted (NWN2 has no way of deleting Areas or Freeing Memory)
- Everytime you create a unique instance of an area, the memory footprint in RAM will increase to allocate space for this instance, as a side effect - all instances of a single area will be reallocated in RAM and their tags will be reset to the same as the base area (More on this below)