Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

"Allow anyone to move"

Pedro Pendragon
Registered User
Join date: 15 Jan 2004
Posts: 77
02-09-2004 06:34
I've been working on a project that contains some objects that I'd like to let users manipulate. I'd like to make it as "jerk-proof" as possible, to prevent anyone stealing/hiding/whatever these objects.

I used the checkbox to allow anyone to move the object, and in the script i initialize it with llSetStatus(STATUS_SANDBOX, TRUE); which, according to the documentation, will prevent the object from being moved more than 20m or over sim bounds.

A friend was helping me test it out, and discovered something that can "break" it, and there's nothing I can do to prevent it. Apparently, the "Allow anyone to move" checkbox ALSO allows anyone to Edit the position vector of the object. His first experiment was to edit it to 768m up, where it stuck (the build was at an elevation of about 50m, so 768m is well outside the 20m boundary that STATUS_SANDBOX should limit it to.) I went up myself and retrieved it.
The next experiment we tried was to see if we could drag it over a sim bound (also contrary to STATUS_SANDBOX's limits.) He editted the position vector to put it near the sim bound, then dragged it over. The object promptly disappeared, never to be seen again in either sim, nor in my inventory.

Is allowing other users to directly edit the position vectors when the "Allow others to move" checkbox is on a bug or a feature? It definitely does not work well with STATUS_SANDBOX, which leaves me with no good way to allow interaction but prevent vandalism.
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
02-09-2004 15:11
Ive been noticeing something like this too. However, I think the STATUS_SANDBOX call only prevents an object from moving > 20 meters under its own physics power (llApplyImpulse, llMove2Target, etc).

Here's a solution that I think may provide what you need.

CODE

// Position keeper - Makes sure the object doesn't travel x meters from its start point. The start point is established when this script is dropped on an object, the script is reset, or the object is re-rezzed.

float threashold = 20; // Distance in meters that this object can move.
float checkInterval = 5; // The time between distance checks, set to more to be less intensive on the server, less to monitor and recover from a rogue movement.

vector startPos;

setPos(vector dest)
{
while(llVecDist(dest,llGetPos()) > 0)
{
llSetPos(dest);
}
}

default
{
on_rez(integer foo)
{
startPos = llGetPos();
}
state_entry()
{
startPos = llGetPos();
llSetTimerEvent(checkInterval);
}
timer()
{
if(llVecDist(llGetPos(),startPos) > threashold)
{
setPos(startPos);
}
}
}