Object keyword

From Dragon Age Toolset Wiki
Jump to: navigation, search

The object keyword denotes a data type that stores the integer ID of a game object, also referred to as an instance. The default value is OBJECT_INVALID or -1.

The object type is valid as a variable, a parameter and a return type.

Literals

There is no literal representation of the object type.

Conversion

Explicit

The following function can be used to convert an object to another data type:

There is no explicit conversion from the object type.

Implicit

There is no implicit conversion to or from the object type.

Persistence

The following functions allow a object to exist outside of the scope of the current script by storing it on an object, effect or event:

The following functions allow a object which exists outside of the scope of the current script to be used in the current script by retrieving it from an object, effect or event:

Remarks

In scripting, the "object" data type contains instances of game resources that have been created in-game. Most objects are created by the toolset, for example by placing creatures in an area or by inserting items into an inventory. However, they can also be dynamically created using the CreateObject function.

Object Currency

Objects which are not in the current area list are not accessible by tag-based searches.

So, plot flags are generally used to store information about areas and their objects which might be referenced when the player is elsewhere. As long as you don't add a journal entry, no journal is given to the player when the plot flag is set. For situations that require more than binary values, local variables can be set on the player or the module.

If the story calls for a creature to travel between area lists, the general approach is to place different instances of the same creature in all areas that will use it, setting them inactive or active as necessary.

Examples

void main()
{
    // uninitialised
    object oDefault;
 
    // initialised using a function
    object oFunction = GetObjectByTag("example");  
}

See also

OBJECT_INVALID, OBJECT_SELF, Object functions, Object constants