CreateArea(string, string, string)

From NWN Lexicon
Jump to: navigation, search
Warning icon orange.png Caution: This article documents NWN: Enhanced Edition content, not native BioWare scripts. It may not apply unless you're using NWN: Enhanced Edition.
Creates an instanced copy of an existing area, based on the area's resref.
object CreateArea(
    string sResRef, 
    string sNewTag = "", 
    string sNewName = ""


Instances a new area from the given resref, which needs to be a existing module area. Will optionally set a new area tag and displayed name. The new area is accessible immediately, but initialisation scripts for the area and all contained creatures will only run after the current script finishes (so you can clean up objects before returning). Returns the new area, or OBJECT_INVALID on failure. Note: When spawning a second instance of a existing area, you will have to manually adjust all transitions (doors, triggers) with the relevant script commands, or players might end up in the wrong area.


Information icon.png This section of the article is a stub. You can help the NWN Lexicon by expanding it.


1.74.8149 - Note that the description of this function was omitted from the PDF release notes. The function is described in a readme in the lang/<language>/docs directory delivered with Neverwinter Nights Enhanced Edition, and in the toolset script editor.


Information icon.png This article is in need of examples. You can help the NWN Lexicon by showing how to use this code effectively.

See Also

functions: DestroyArea() CopyArea() SetTransitionTarget()

 author: Shadguy