Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llMoveToTarget Not Always Responding?

Ephemeral Rainbow
Registered User
Join date: 28 Sep 2005
Posts: 8
12-18-2005 20:08
This is my first post to these forums, but I have no idea what could cause the odd behaviour I am seeing from the llMoveToTarget function.

I have three scripts in a single object:

> A script that controls the position and animation of the avatar.
> A script that sends messages to the users.
> A script that listens for commands and relays them via link message to the other scripts.

Today I observed that resetting the animation / positioning script sometimes causes llMoveToTarget to stop functioning.

When this happens:

> Code on both sides of the llMoveToTarget executes as normal, just like the line is not there.
> Rezing the object by taking it to inventory and back or logging out causes llMoveToTarget to behave normaly one again, but Teleportation does not.

This may be related to: /54/d4/78075/1.html

I would be very greatful for any ideas how I might solve this or what the cause may be. The code is rather long so I have only included an offending section:

// Globals
integer gFollowLength = 10;
integer gFollowTarget = 0;
integer gDebug = TRUE;
string gAction = "follow";

//Respond to Sensors
sensor(integer lNumber) {
vector tPosition = llDetectedPos(0);

//Continue Following
if (gAction == "follow";) {
vector tZPosition = llGetPos();
if( llVecDist(tPosition, tZPosition) > gFollowLength ) {
llTargetRemove(gFollowTarget);
gFollowTarget = llTarget(tPosition, gFollowLength - 0.5);
llMoveToTarget(tPosition, 3);
}
}
}


//Abandon Action If No Sensor Data
no_sensor() {
gAction = "";
llSensorRemove();
llTargetRemove(gFollowTarget);
llStopMoveToTarget();
if (gDebug) {llOwnerSay("*** Move To Target: Sensor Beyond Range.";);}
}

//Stop At Target
at_target(integer lNumber, vector lPosition, vector lZPosition) {
llTargetRemove(gFollowTarget);
llStopMoveToTarget();
if (gDebug) {llOwnerSay("*** Move To Target: Completed.";);}
}
Jesrad Seraph
Nonsense
Join date: 11 Dec 2004
Posts: 1,463
12-19-2005 02:28
llMoveToTarget is limited to 60m in distance. Beyond that it will use the object's position as target instead.
_____________________
Either Man can enjoy universal freedom, or Man cannot. If it is possible then everyone can act freely if they don't stop anyone else from doing same. If it is not possible, then conflict will arise anyway so punch those that try to stop you. In conclusion the only strategy that wins in all cases is that of doing what you want against all adversity, as long as you respect that right in others.
Ephemeral Rainbow
Registered User
Join date: 28 Sep 2005
Posts: 8
12-19-2005 07:09
From: Jesrad Seraph
llMoveToTarget is limited to 60m in distance. Beyond that it will use the object's position as target instead.


Thankyou for the suggestion. I have been trying distances under 6m though so it shouldn't be that.