24 May 2021
|Type||Corrade progressive command|
|Last Changes||C11 - added.|
walkto command makes Corrade walk towards a
position in a given time
duration while getting as close to the
vicinity of the
position as possible with a specified
|Command||Required Parameters||Required Corrade Permissions||Example|
| || || ||
llInstantMessage(CORRADE, wasKeyValueEncode( [ "command", "walkto", "group", wasURLEscape(GROUP), "password", wasURLEscape(PASSWORD), // walk to this object "position", llGetPos(), // accept a precision of 2 meters from the target "vicinity", 2, // give Corrade 10 seconds to arrive at this object "duration", 10000, "callback", wasURLEscape(URL) ] ) );
|Optional Parameter||Possible Value||Description|
| ||Time in milliseconds.|| Allow
| || A range in meters (default || If Corrade arrives in the
| || An integer representing the affinity of the movement (default ||How precise should the movements be?|
Let's assume that Corrade can be seen abstractly as a box and that the destination is a primitive.
+-------+ +-------+ | C | | c | +-------+ +-------+ ^ ^ ^ ^ | | | | +---+ +---+ S s ^ ^ | | | +-------------------+ d ^^ || -- a
Every avatar in SecondLife has a centre and is surrounded by an invisible bounding box, the distance between the centre of the avatar and the side of the bounding box is . A box in SecondLife has a centre and a projection on one of its sides of distance .
The distance between the avatar and the box is given by where the distance includes the projection of the box and the size of the avatar bounding box . The actual distance between an avatar and the box is in fact because the distance is measured mathematically (or programatically using
llVecDist in LSL) as the distance between two points and .
The distance between and , namely can be decomposed in smaller, equally sized segments .
The definitions of
affinity are the following:
vicinityis directly equal to the distance ,
affinityis equal to the size of a smaller equally sized segment ,
durationis the maximal time required for the avatar to make the point equal to point (assuming that the primitive does not move).
With the following observations:
vicinitydoes not account of the avatar bounding box with a projection length of , nor the distance between the centre of the primitive and one of its sides such that we can say that the
vicinitymust always be at least as large as for Corrade to ever be able to reach its destination within the allotted
Vis strictly smaller than plus , in other words , then Corrade will never be able to reach its destination and more than likely will swivel around until the
durationhas elapsed; this happens because positions of objects are measured as point vectors in space that do not account for the "size" of the objects,
affinityparameter controls the amount of segments generated along the path , and is a form of fine grained control of the movement of Corrade along its trajectory; smaller values make Corrade take smaller steps and would appear as a more fluid motion, larger values make Corrade take larger strides making the movement seem more strideful
walktois a blocking command that will return a success status via the callback when and if Corrade has reached the destination within the
vicinity. The distinction is that compared to
autopilotyou should always install a callback and wait for confirmation before sending another
walktocommand. If you do not wait for the callback, then Corrade will still be moving, such that sending a follow-up
walktocommand will queue the command until the antecedent
walktohas completed and may lead to your workers being exceeded.
walktois a reliable command that uses terse movements and bypasses the simulator pathfinding that might be broken on some grids (including SecondLife).