Category:Events

From NWN Lexicon
Jump to navigationJump to search

Objects with events are those objects that make up the bulk of NWN. By giving these objects events, the programmers of NWN allow script writers to interact and respond with PCs and other objects by assigning different scripts to each event.

Order of Events Note

There are several events that have a specific order that may be worth noting. For a Player entering a module it will do this:

  1. OnAcquireItem (clothing)
  2. OnPlayerEquipItem (clothing)
    1. [repeat for all inventory items in slot order]
  3. OnClientEnter
  4. Area OnEnter

Note there are some known bugs with some of these events, see their pages for details.

Object Event Categories

Area

Creature

Door

Encounter

Merchant

Module

Placeable Object

Trap

Trigger

OnPlayerGuiEvent

OnNuiEvent


Non-Object Events

There are three main types of scripts which run but may be on a variety of objects and are triggered by their respective actions taking place:

Spell Script - Called when a spell is cast, referenced in spells.2da

State Script - Called for (most) disabling effects, such as Fear.

Trap Script - Called when a trap is triggered.

There are also scripts attached to conversations which can occur in many ways:

Conversation Conditional Script

Conversation Action Script

Conversation End Script

Conversation Abort Script

Finally there is one more script run for Diseases if specified in disease.2da

Disease Payload Script


Crafting Skills Conversation

Finally a possibly regularly ignored potential way the game runs scripts is player-initiated hardcoded dialogue file for "Crafting Skills" in the radial menu. The file x0_skill_ctrap.dlg is called when this is selected. In fact with newer NWN:EE functions you can make that chosen option an even more accessible option to open a conversation. The conversation is done with self, and is private, with no "Hello" greeting.

This dialogue file can be opened in the Toolset and be edited to suit (eg removing the contents).