Official Documentation: Script Naming Conventions

buried in the official Toolset documentation is a section about naming conventions for scripts. I've replicated it here for easy reference.

All scripts in NWN2 are are prefixed with one of the following:

  • “g” for global scripts
  • “i_” for item related scripts (these are also global)

Item Scripts

Use the following for item scripts:

i_<Item Tag>_ac

script to execute when item activated

i_<Item Tag>_aq

script to execute when item acquired

i_<Item Tag>_ua

script to execute when item unacquired

i_<Item Tag>_eq

script to execute when item equipped

i_<Item Tag>_ue

script to execute when item unequipped

The module events will be written to automatically execute the proper script.

Conversation Scripts

Conversations have 2 script types.

a_<Speaker>…

actions taken

c_ <Speaker>…

conditional (Text appears when...)

Event Scripts

Scripts for events on objects should have a prefix to indicate the Object Type. If an object has multiple events, a suffix should be added each script to indicate the Event Type.

 

Object Type

Abbreviation

Area

use area num

Creature (Being)

b

Door

d

Encounter

e

Merchant

m

Placeable

p

Trigger

tr

 

Event

Abbreviation

Area**

Creature

Door

Encounter

Merchant

Placeable

Trigger

blocked

bl

X

click*

ck

X

X

close*

cs

X

X

X

combat round end*

ce

X

conversation

co

X

damaged

da

X

X

X

death

de

X

X

X

disturbed

di

X

X

enter

en

X

X

X

exhausted*

ed

X

exit

ex

X

X

X

fail to open

fa

X

heartbeat*

hb

X

X

X

X

X

X

lock

lo

X

X

open

op

X

X

X

perception

pe

X

physical attacked

at

X

X

X

rested

re

X

spawn

sp

X

spell cast at

ca

X

X

X

unlock*

ul

X