Aw int set

From ActiveWiki
Jump to navigation Jump to search


Minimum requirements
Added in version 2.1
SDKbuild 13


int aw_int_set (AW_ATTRIBUTE a, int value)

Description

Sets the value of an integer attribute.

Callback

None (returns immediately)

Notes

This method functions just like aw_bool_set when a boolean attribute is passed to it (e.g. aw_int_set (AW_UNIVERSE_ALLOW_TOURISTS, 1)).

See SDK Attributes for more information.

Arguments

a
Attribute (defined in Aw.h).
value
Value to set.

Argument attributes

None

Return values

RC_SUCCESS
RC_NOT_INITIALIZED
RC_NO_INSTANCE
RC_READ_ONLY
RC_INVALID_ATTRIBUTE
Outside the range of defined attributes (i.e. 0 to AW_MAX_ATTRIBUTE - 1).
RC_TYPE_MISMATCH
Not an integer or boolean attribute.

Returned attributes

None

Usage

int rc;

aw_int_set (AW_OBJECT_NUMBER, aw_random ());
aw_int_set (AW_OBJECT_X, 0);
aw_int_set (AW_OBJECT_Y, 0);
aw_int_set (AW_OBJECT_Z, 0);
aw_int_set (AW_OBJECT_YAW, 0);
aw_int_set (AW_OBJECT_TILT, 0);
aw_int_set (AW_OBJECT_ROLL, 0);
aw_string_set (AW_OBJECT_MODEL, "street1.rwx");
aw_string_set (AW_OBJECT_DESCRIPTION, "Cornerstone");
aw_string_set (AW_OBJECT_ACTION, "create sound xyz.mid");

rc = aw_object_add ();
if (rc != RC_SUCCESS)
  printf ("Unable to add object (reason %d)\n", rc);
else
  puts ("Object added");

See also