FANDOM


Dm limbo This article is a stub. You can help NWNWiki by expanding it.

Tag-based scripting is a paradigm for supporting custom items that does not require editing module event scripts for each item. When this system is enabled, the relevant module events execute a script whose name is the item's tag, allowing an item and its script to be cleanly added to or removed from a module with almost no more risk of interference with other items than is normal for adding or removing an item alone. (The risk is reduced to a name conflict, as would occur if adding an item with a ResRef that is already in use.)

The flexibility of tag-based scripting is subject to abuse, particularly when local vault characters are used. To counter this, BioWare's system allows a module to define a prefix for all tag-based script names by storing the prefix in the local string "MODULE_VAR_TAGBASED_SCRIPT_PREFIX". When this local variable is set on the module, then the name of the script invoked by tag-based scripting is not just the item's tag, but the prefix followed by the item's tag. As a side-effect, using this prefix groups all tag-based scripts together in the alphabetical listing of a module's scripts.