Category:Data Types
From NWN Lexicon
Jump to navigationJump to searchData 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 |
---|---|
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. | |
A solver data type. Use with the cassowary functions. | |
A void-returning function, whether it is user defined or engine-defined. This is used by the DelayCommand() and AssignCommand() functions. | |
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. | |
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(). | |
All of the "events" that run scripts within the scripting language have thier own "event" creation functions, which you can give to any object. | |
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. | |
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. | |
Contains information which defines the various property which an item has. | |
JSON is used to manipulate complex objects such as GUI elements or reading/editing GFF templates and objects converted to JSON. | |
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. | |
An integer that represents a particular object in the world (essentially a pointer to a real object). | |
A prepared sqlquery. See SQLite. | |
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"). | |
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. | |
A talent represents a feat, skill, or spell. | |
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). | |
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. |