Category:Data Types

From NWN Lexicon
Jump to: navigation, search

Data Types

Data types are the different types of variables that can be used to store values. A string data type only stores text data, whereas an integer can store any number without a decimal point. Different data types have different, varied uses.

Data Types

Data Type Description

action

An action. This not a usable keyword, but BioWare uses it as a parameter type for DelayCommand, AssignCommand, and ActionDoCommand. It is not possible to create a function using the action data type as a parameter's data type.

command

A void-returning function, whether it is user defined or engine-defined. This is used by the DelayCommand() and AssignCommand() functions.

const

An unchanging value, usually an integer. Used in place of "magic numbers" to make code more readible. Only int, string, and float data types may be used as constant.

effect

Each effect that you're allowed to place on an object actually has a constructor within the scripting language that you are then alllowed to use in ApplyEffectToObject().

event

All of the "events" that run scripts within the scripting language have thier own "event" creation functions, which you can give to any object.

float

A 32-bit floating point number. Maximum 3.402823e38, minimum -3.402823e38, default 0.0. Note that when initializing or setting a literal value to a float, you must include a decimal point and at least one number after the decimal. You may add a lower case "f" after the number to note it as a float. However, in NWScript, this is simply a readability convenience and is not required.

int

A signed 32-bit integer. This is whole number without a decimal and can be negative. Maximum 2,147,483,647, minimum -2,147,483,648, default 0.

itemproperty

Contains information which defines the various property which an item has.

location

A location has three components: the object ID of the area, a vector representing the position within the area, and a floating point number representing the facing.

object

An integer that represents a particular object in the world (essentially a pointer to a real object).

string

A string of characters of arbitrary length, terminated by a NULL character. Default value is an empty string (""). Strings can be concatenated (that is, combined) by using the plus ("+") sign. A string can be compared for equality against another string by using the double equals ("==") equality tester, or for inequality by using the "!=" equaliter tester. When testing for string equality, strings are case-sensitive (that is "SoME CHaRaCTeR NaMe" does not equal "some character name").

struct

A structure of different variable types combined into a single variable. Can be used with functions to decrease their complexity by returning many values at once.

talent

A talent represents a feat, skill, or spell.

vector

A structure of three floats, useful for defining positions and orientation vectors. To access the components of the vector, you can use the dot operator to get the x, y, and z components of the vector. The default value of a vector is { 0, 0, 0 } (or x = 0, y = 0, z = 0).

void

A null data type. Functions set to void don't return an assignable value. Only functions of type 'void' can be assigned to the Action Queue.



Pages in category "Data Types"

The following 12 pages are in this category, out of 12 total.

Personal tools
Categories