LSL feature request. The described event does not exist. This article is a feature request.
An event for avatar transitions from sitting to standing, standing to flying, etc. Such events can be monitored with a timer event; however, that's murder on a server. Must call llTrackAvatarPositionChange with permission PERMISSION_TRACK_POSITION.
position_change()
And this is different then using (not_)at_target how? --Strife Onizuka 18:58, 20 April 2007 (PDT)
"It registers a position with a range that triggers at_target and not_at_target events continuously until unregistered." - we're trying to avoid continuous events as they aren't very nice to the poor sim executing them --Synack Fitzgerald 12:25, 14 May 2007 (EDT)
integer target;
default
{
touch_start(integer a)
{
if(target)
{
llTargetRemove(target);
target = 0;
}
else
target = llTarget( llGetPos(), 0.001 );
}
not_at_target()
{
llTargetRemove(target);
target = llTarget( llGetPos(), 0.001 );
}
}
//This version tells you the change. It will have problems on sim boundaries (tracking that requires extra work).
integer target;
vector pos;
default
{
touch_start(integer a)
{
if(target)
{
llTargetRemove(target);
target = 0;
}
else
target = llTarget( pos = llGetPos(), 0.001 );
}
not_at_target()
{
llTargetRemove(target);
vector new_pos = llGetPos();
target = llTarget( new_pos, 0.001 );
llSay(0,"change = "(string)(new_pos - pos));
pos = new_pos;
}
}