NWScript

NWScript
NWscript
Appeared in June 18, 2002
Designed by BioWare
Developer BioWare
Stable release 1.69.8109 (Neverwinter Nights) (July 9, 2008)
Influenced by C, Java
OS Microsoft Windows,
3rd party tools for Mac OS X and Linux
License BioWare EULA
Website BioWare Developers Portal

NWScript is the scripting language developed by BioWare for the computer role-playing game Neverwinter Nights. It is based on the C programming language and is implemented in the Aurora toolset. Neverscript, an open source 3rd party editor, has been created for the Mac OS X and Linux versions of NWN because the Aurora toolset has not been ported to those platforms.

NWScript is also used in the video games The Witcher, Star Wars: Knights of the Old Republic and Star Wars: Knights of the Old Republic II The Sith Lords, which use the Odyssey Engine. Neverwinter Nights 2, the sequel to the original NWN, features a modified version of this scripting language.

Contents

Syntax

While based on C, NWScript does not have many functions from the C family, excluding logical and binary / ternary operators and some mathematical functions. Function source code is not accessible to the end-user, but the correct syntax is defined in a script file called nwscript.nss. The users can create their own functions, and these can be included in other scripts through the #include directive, which works slightly differently than in C++.

Hello world

NWScript has no way to directly target the screen for output. Instead, for instance, in-game characters such as the player character can be made to speak the typical "Hello world" example message. This script puts a "Hello world" message in the player's message log. For it to work, it should be placed in the OnClientEnter event of the module's properties.

void main()
{
    SendMessageToPC(GetEnteringObject(), "Hello world");
}

The first line is the void main function which is the function that a NWScript will start at. In the third line, the text Hello world is sent to the player's in-game message log.

Data types

NWScript allows structs, but not objects. The following common data types are available in NWScript:

NWScript has also introduced some data types for purposes of the Neverwinter Nights game:

  • object (refers to game objects, such as NPCs and placeable 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).

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 Bytecode to be run on the NWScript Virtual Machine file is created. If turned on, a debug information file with 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 with a .mod extension, along with other information about the layout of the module.

External links


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • NWScript — Información general Paradigma Procesamiento por lotes Apareció en 18 de junio de 2002 Diseñado por BioWare Inc …   Wikipedia Español

  • Neverwinter Nights — NWN redirects here. For other uses, see NWN (disambiguation). This article is about the 2002 BioWare game. For the 1991 AOL MMORPG, see Neverwinter Nights (AOL game). For the Neverwinter Nights series as a whole, see Neverwinter Nights (series).… …   Wikipedia

  • Aurora toolset — The Aurora toolset (sometimes called the Aurora toolkit) is included in the Windows version of computer role playing game Neverwinter Nights , allowing players to create their own adventures and share them with others by using a module (a game… …   Wikipedia

  • Neverwinter Nights: Hordes of the Underdark — Developer(s) BioWare Publisher(s) …   Wikipedia

  • Neverwinter Nights: Shadows of Undrentide — Developer(s) Floodgate Entertainment BioWare Publisher(s) …   Wikipedia

  • Forgotten Realms — The Forgotten Realms second edition logo Des …   Wikipedia

  • BioWare — Type Division of Electronic Arts …   Wikipedia

  • Jade Empire — Developer(s) BioWare (Xbox) LTI Gray Matter (PC) Publisher(s) …   Wikipedia

  • Neverwinter Nights 2 — Windows boxart …   Wikipedia

  • MDK2 — redirects here. For the video game Mario vs. Donkey Kong 2, see Mario vs. Donkey Kong 2: March of the Minis. MDK2 Boxart Developer(s) BioWare …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”