Adds an object to the world, overriding default owner and timestamp attributes.
AW_CALLBACK_OBJECT_RESULT
This method requires at least SDK build 14 and world server build 21.
aw_object_load is similar to aw_object_add except that the additional attributes AW_OBJECT_OWNER and AW_OBJECT_BUILD_TIMESTAMP are also set by aw_object_load. Since this allows the creation of an object that appears to have been built at any time by any user, use of aw_object_load is restricted to instances with the eminent domain right.
All other attributes work the same as with aw_object_add.
If aw_object_load completes successfully, AW_OBJECT_NUMBER will contain the object number assigned automatically by the SDK. If you have the callback AW_CALLBACK_OBJECT_RESULT installed, AW_OBJECT_NUMBER will be set during the callback to indicate which object the callback is for. This can be useful in applications that issue multiple asynchronous building requests.
int rc;
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");
/* object to be owned by citizen #1 */
aw_int_set (AW_OBJECT_OWNER, 1);
/* object to appear to have been built one week ago */
aw_int_set (AW_OBJECT_BUILD_TIMESTAMP, time (NULL) - (7 * 24 * 60 * 60));
if (rc = aw_object_load ())
printf ("Unable to load object (reason %d)\n", rc);
else
puts ("Object loaded");
aw_delete_all_objects
aw_object_add
aw_object_change
aw_object_delete