...
NWScript allows structs, but not objects. It also allows constants with the "const" keyword. The following common data types are available in NWScript:-
- integer (int) (32bit)
...
- float (32bit)
...
- string
...
- struct
- vector
NWScript has also introduced some data types for purposes of the Neverwinter Nights game. - These are in reality special structs or ID references but you can't manually alter them without script commands (eg; you can't change an effects properties without Effect* prefixed functions).
- object (refers to game obgects, such as
...
- PC, NPC, placeable and item objects).
...
- location (refers to the in-game location of an object, consisting of an area object reference, a vector and a float describing the position and facing within the area).
...
- talent (refers to spells and abilities).
...
- vector (refers to coordinates of an object, and is a construct of three floats).
...
- itemproperty (refers to abilities on items such as weapons for use in the game).
...
- effect (refers to game-mechanics-altering effects on objects; for example effects created by spells, diseases, and displayed visual effects).
- event (refers to calling in-game events using SignalEvent)
- sqlquery (refers to sqlite queries)
File format
When saving a script, the Aurora Toolset saves the plain text of the script as a file with a .nss filename extension. When compiling the script, a .ncs containing Byecode to be run on the NWScript Virtual Machine file is created. If turned on, a debug information file an .ndb extension is also created. The game uses only the .ncs file (and the .ndb file if called)
When saving the created module, the files are packed into a single module file whith a .mod extension, along with other information about the layout of the module.
Some documentation on the NCS format is available here: http://www.nynaeve.net/Skywing/nwn2/Documentation/ncs.html