backIndex

Xelagot action script

Object variables and operations

Object variables are complex specialised location variables. They share all IfLoc statements with location and person variables, see Conditional Statements for Location in Location variables and operations, which all apply to object variables.

Any change applied to an object variable will automatically invalidate its object number (sets it to 0)

A general information page on surveying and building is Surveying, building and the Lists. Refer to that page and its links.

The following operations apply to object variables.

Variables shown in black may be substituted by literal values, variables shown in red are assigned the result of the operation, variables in green may not be substituted by their literal equivalents.

~a = ~b
GetObject ~a ~b
simple assignement of all values of object variable ~b to object variable ~a.
~a = @b
~a = &b
~a = $b
simple assignement of all location values of @b to object variable ~a. Variable @b can also be substituded by a person variable &b or object variable ~b, and by a string variable $b or literal, in the form of "10n 5.3e 0a 45", or including the world, as in "10n 5.3e 0a 45 :mars" (notice the colon before the world name, compulsory until xelagot version 3.0, where "10n 5.3e 0a 45 mars" is also allowed). All missing values will default to zero, a missing world defaults to an empty string. See Variables for a fuller explanation.
If you want to use data belonging to the bot, retrieve all the bot's data in this way:
GetPerson &b
or, to get the data of bot number %n in the application:
GetPerson &b %n
then use &b as you would use any other person variable. There are alternate ways to retrieve the bot's information, but they can be very confusing for beginners and experts alike.
GetModel ~a ~b
GetDescription ~a ~b
GetAction ~a ~b
GetTimestamp ~a ~b
GetObjectNumber ~a ~b
GetCitnum ~a ~b
gets the required data in ~b and assigns it to the corresponding field in ~a.
GetModel ~a $b
GetDescription ~a $b
GetAction ~a $b
GetTimestamp ~a !b
GetObjectNumber ~a %b
GetCitnum ~a &b
GetCitnum ~a %b

GetModel $a ~b
GetDescription $a ~b
GetAction $a ~b
GetTimestamp !a ~b
GetObjectNumber %a ~b
GetCitnum %a ~b
gets the required data in $b, !b or %b and assigns it to the corresponding field in ~a.

The second set shows the reverse operations.
Since practically all operations on location variables apply to object variables too, consult the page on Location variables and operations as well as this one, not all operations are shown here.
GetLocation ~a @b
GetLocation ~a &b
GetLocation ~a ~b
GetLocation ~a $b

GetLocation $a ~b
gets the location and world values in @b, &b, ~b or $b, assigns them to object variable ~a.

The reverse operation is also valid.
GetPosition ~a @b
GetPosition ~a &b
GetPosition ~a ~b
GetPosition ~a $b

GetPosition $a ~b
gets the location values in @b, &b, ~b or $b, assigns them to object variable ~a, without modifying the world value of ~a.

The reverse operation is also valid.
GetNS ~a @b
GetNS ~a &b
GetNS ~a ~b
GetNS ~a %b

GetNS %a ~b
gets the NS position in @b, &b or ~b, or the value in metres in %b or its literal representation, assigns it to object variable ~a. Does not modify other values of ~a.

The reverse operation is also valid.
GetWE ~a @b
GetWE ~a &b
GetWE ~a ~b
GetWE ~a %b

GetWE %a ~b
gets the WE position in @b, &b or ~b, or the value in metres in %b or its literal representation, assigns it to object variable ~a. Does not modify other values of ~a.

The reverse operation is also valid.
GetAltitude ~a @b
GetAltitude ~a &b
GetAltitude ~a ~b
GetAltitude ~a %b

GetAltitude %a ~b
gets the altitude in @b, &b or ~b, or the value in metres in %b or its literal representation, assigns it to object variable ~a. Does not modify other values of ~a.

The reverse operation is also valid.
GetRotation ~a @b
GetRotation ~a &b
GetRotation ~a ~b
GetRotation ~a %b

GetRotation %a ~b
gets the rotation in @b, &b or ~b, or the value in degrees in %b or its literal representation, assigns it to object variable ~a. Does not modify other values of ~a.

The reverse operation is also valid.
GetWorld ~a @b
GetWorld ~a &b
GetWorld ~a ~b
GetWorld ~a $b

GetWorld $a ~b
gets the world name in @b, &b or ~b, or the value in $b or its literal representation, assigns it to object variable ~a. Does not modify other values of ~a.

The reverse operation is also valid.
LocClear ~a clears the location data of object variable ~a, setting all values to zero and the world name to an empty string
LocTurn ~a %b rotates object variable ~a by %b degrees (positive is anti-clockwise), i.e. adds %b degrees to the present rotation of ~a. Does not alter the other values of ~a.
LocTurn ~a @b
LocTurn ~a &b
LocTurn ~a ~b
rotates object variable ~a towards location @b, person &b or object ~b, so that ~a will face it. Does not alter the other values of ~a.
LocMove3D ~a %d %ha %va moves object variable ~a a distance of %d metres in space, at a horizontal angle of %ha degrees (from the angle indicated by its rotation) and a vertical angle of %va degrees (to the horizontal plane). Does not alter the rotation (yaw) of ~a. For example:
LocMove3d ~pipo 25.3 90.0 0 will move object variable ~pipo 25.3 metres to its left, not altering its altitude. ~pipo will end up facing the way it was before being moved.
LocMove3d ~pipo 10 0 0 will move ~pipo 10 metres forward.
LocMove3d ~pipo 10 0 -90 will move ~pipo 10 metres down.
LocMove3d ~pipo 10 0 30 will move ~pipo 10 metres in space, up at an angle of 30 degrees to the horizontal plane. Horizontally it will move less than 10 metres, of course. metres.

Objects 'live' in a virtual world, and are rendered by the AW browser. For the bot to have a map of a certain area, it must query the world server. It can only query one zone at a time. The bot must be in the world, but need not be in the area. Querying the world server is needed in all cases when objects have to be deleted or modified. This operation requires knowledge about Events and in particular, about QueryBegin, QueryComplete. Read the group of pages called BUILDING before attempting these operations.

Operations involving creation and destruction of objects in a world. A * marks statements that trigger Object Create and Object Result events.

ObjectAdd ~a * Creates an object.
ObjectAddED ~a * Creates an object, preserving original citizen number and creation timestamp. The bot must have Eminent Domain (ED) right, and the citizen number must have Build right. It does not work in very old world servers.

xelagot 3.607
If the bot does not have ED, this statement works as ObjectAdd.
ObjectDelete ~a
ObjectDeleteED ~a
* Deletes an object, if it exists and has exactly the same object-number and is in the same cell. Both statements are identical.
ObjectChange ~a ~b * Changes object ~a into ~b, if ~a exists and could be deleted (see ObjectDelete).
ObjectChangeED ~a ~b * Changes object ~a into ~b, if ~a exists and could be deleted (see ObjectDelete). Preserves the original citizen number and creation timestamp of ~b. The bot must have Eminent Domain (ED) right, and the citizen number in ~b must have Build right. Does not work in very old world servers.

xelagot 3.607
If the bot does not have ED, this statement works as ObjectChange.
ObjectModify ~a ~b * Changes object ~a into ~b, if ~a exists and could be deleted (see ObjectDelete). Keeps the new object at the coordinates and yaw of the old object.
ObjectModifyED ~a ~b * Changes object ~a into ~b, if ~a exists and could be deleted (see ObjectDelete). Keeps the new object at the coordinates and yaw of the old object. Preserves the original citizen number and creation timestamp of ~b. The bot must have Eminent Domain (ED) right, and the citizen number in ~b must have Build right. Does not work in very old world servers.

xelagot 3.607
If the bot does not have ED, this statement works as ObjectModify.
ObjectRetrieve ~a Retrieves the object from the seed buffer and stores it in ~a.
ObjectKeep ~a Keeps the object ~a in a seed buffer, which can be used by the bot for seeding an object. This buffer also works independently of the script, it is a general bot buffer.
ObjectSeed * If there is an object stored in the seed buffer, the script will use this object to seed at the bot's coordinates. Otherwise, this statement has no effect.


backIndex