backIndex

Xelagot action script

Motion: Join, Follow, Goto (Person)

The Join motion consists of following someone, staying at certain distance, level and angle.

The Follow motion consists of following someone, staying at certain distance and level, facing the target.

The Goto motion consists of going to someone and stopping at certain distance and level. If the target moves while the bot is going towards it, the bot will adjust its path. Once the bot has reached its destination, it will not carry on following.

Care must be taken at present with these statements: if the target person gets out of reach of the bot, the bot will attempt to follow the position of the browser if it is active on the same computer.

Set JoinStep and the other values before calling IfJoinPerson, IFollowPerson or IfGotoPerson. You may modify these values at any time, whether the bot is following or not.

Issue the Stop statement to cancel any of these motions (this includes other forms as Random and Blimp).

How do you get the person target of the motion? In various ways.

JoinStep %a
sets the step in m/sec when the bot joins, follows or goes to a person slowly (see JoinSlow). Normal for humanoids is 0.70 (slow) to 1.5 (fast), for birds 1.5 or more.
JoinDistance %a
sets the distance in metres the bot has to remain when joining, following or going to a person. A normal distance when accompanying someone is 1.5 to 2.0 metres.
JoinLevel %a
sets the level in metres (positive or negative) the bot has to remain relative to a person when joining, following or going to. Normally set to 0, usefull in case of bird-bots to raise the bot above the feet level of the person targeted. I usualyy use 2.0 m or more in this case. This level also affects random motion if the bot is joining or following.
JoinAngle %a
sets the angle in degrees the bot has to keep relative to the target person (only used by IfJoinPerson and IfJoinFacePerson). A value of 0 puts the bot in front of the person, 180 behind, 90 to the left, -90 to the right.
JoinFacing %a
sets the relative angle between the yaw of the bot and the yaw of the target person. Peculiarities: if the JoinAngle is 0 or 180, the relative angle is 0 (that is, the bot faces the same way as the target person) if JoinFacing is less than 90 degrees, otherwise it is 180 degrees (the bot faces the oppsite way as the target person); in all other cases, the angle is added to the target yaw if JoinAngle is between 0 and 180 degrees (to the left of the target person), and subtracted from the target yaw if JoinAngle is between 180 and 360 (to the righ of the target person). (only used by IfJoinPerson)
JoinHurry
makes the bot ignore the JoinStep value and move instantly when joining, following or going to a person.
JoinSlow
makes the bot move according to the JoinStep value when joining, following or going to a person.
xelagot 3.430
JoinTerSensing ON
JoinTerSensing OFF
Enables or disables terrain sensing when executing join or follow motion. Default: OFF
xelagot 3.430
JoinTerMinAlt %a
Sets the minimum altitude the bot must follow above the terrain (in metres), i.e. it may not go lower than this value relative to the terrain. The default is 0 (metres).
xelagot 3.430
JoinTerMaxAlt %a
Sets the maximum altitude the bot must follow above the terrain (in metres). The default is 0. If the maximum altitude is lower than the minimum altitude, it is disregarded and the bot is not limited by a maximum altitude above the terrain (no maximum limit).
IfJoinPerson &p statement1
Else statement2
attempts to join person &p. Succeeds if this person is present and executes statement1, othewise executes statement2 if the else clause is present. Triggers JoinComplete event
IfJoinFacePerson &p statement1
Else statement2
attempts to join person &p, does not use the JoinFacing parameter but always looks at the target person. Succeeds if this person is present and executes statement1, othewise executes statement2 if the else clause is present. Triggers JoinComplete event
IfFollowPerson &p statement1
Else statement2
attempts to follow person &p. Succeeds if this person is present and executes statement1, othewise executes statement2 if the else clause is present. Triggers JoinComplete event
IfFollowFacePerson &p statement1
Else statement2
attempts to follow person &p, always looks at the target person. Succeeds if this person is present and executes statement1, othewise executes statement2 if the else clause is present. Triggers JoinComplete event
IfGotoPerson &p statement1
Else statement2
attempts to go to person &p, always faces &p when arrived at destination. Succeeds if this person is present and executes statement1, othewise executes statement2 if the else clause is present. Triggers JoinComplete event


backIndex