Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Vehicle orbited in the sandbox? Here's some code to help track down the pusher.

Huns Valen
Don't PM me here.
Join date: 3 May 2003
Posts: 2,749
10-29-2005 03:39
When your avatar is pushed, you (usually) get a PvP message and the push script's owner shows up in the PvP list. Not so when your VEHICLE is being pushed! Hopefully someday we'll have some way to be immune from this nonsense.

In the meantime, I am releasing scripts that I have used twice to successfully pinpoint the location of a push object in the sandbox, including just now. I found the offending device, a Hand of God linked to a giant sphere, just minutes before the sandbox was cleared.

OK, so here's the code... Put this in a plywood cube or something. I recommend making the cube phantom, so it won't get hung up, or bump anyone. (The object of this exercise is to file an AR on someone for pushing your vehicle, and it'll be pretty ironic if you get an AR from one of these things.) You can shout commands on channel 1 such as 'start', 'stop', and 'die'. Please clean them up after you are done gathering evidence, as each has a listener, and that has some impact on sim performance.

Scroll down for code that will distribute these bumper detectors in a line, so you don't have to.

CODE
// Designed to pinpoint a script in the sandbox 1/22/04 that kept launching physics objects.
// Put this in a bunch of cubes lined up at the north border of a sim and click them.
// They will travel across the sim slowly. As soon as they get pushed, they will go non-
// physical.
// Then they will go back to where they were pushed and use llSetText() to say where they were
// when pushed.

integer running = FALSE;
vector lastGoodPos;
vector baselinePos;

Goto(vector Dengo) {
while(llVecDist(llGetPos(), Dengo) > 1) {
llSetPos(Dengo);
}
}

startSweep() {
llWhisper(0, "Starting sweep");
llSetBuoyancy(1);
running = TRUE;
llSetStatus(STATUS_PHYSICS, TRUE);
llSleep(1);
baselinePos = llGetPos();
llMoveToTarget(llGetPos(), 0.1);

llSetTimerEvent(.5);
}

stopSweep() {
running = FALSE;
llSetStatus(STATUS_PHYSICS, FALSE);
llSetTimerEvent(0);
}

sweepComplete() {
stopSweep();
llSetText("Sweep complete, no push occurred.", <1,1,1>, 1);
}

default {
state_entry() {
llSetBuoyancy(0);
llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z|STATUS_PHYSICS, FALSE);
lastGoodPos = llGetPos();
llListen(1, "", "", "");
llSetText("", <1,1,1>, 1);
}

listen(integer chan, string name, key id, string msg) {
if(id!=llGetOwner())
return;
if(msg=="ping")
llOwnerSay("pong "+(string)running+" "+(string)llGetPos());
if(msg=="start")
startSweep();
if(msg=="stop")
stopSweep();
if(msg=="die")
llDie();
if(msg=="reset")
llResetScript();
}

touch_start(integer n) {
if(llDetectedKey(0)!=llGetOwner())
return;
if(!running)
startSweep();
else
stopSweep();

}

timer() {
vector pos = llGetPos();
if(llFabs(pos.x - baselinePos.x) > 1 || llFabs(pos.z - baselinePos.z) > 50) {
llSetTimerEvent(0);
llSetStatus(STATUS_PHYSICS, FALSE);
Goto(lastGoodPos);
llSetText("Pushed at "+(string)lastGoodPos + "\n ", <1,1,1>, 1);
} else
lastGoodPos = pos;
if(pos.y < 10) {
sweepComplete();
}
llMoveToTarget(<pos.x, pos.y - 10, pos.z>, 1);
}
}
Now, perhaps you don't want to spend a lot of time rezzing a ton of these little things, so here's some code to drop a line of them at 10M intervals:

CODE
// Go to a location (nonphysical motion)
// Has some built-in safety checks
Goto(vector Dengo) {

if(Dengo.x == 0 && Dengo.y == 0) {
llSay(0, "ERROR: <0, 0, z> coordinates. Aborting move.");
return;
}
if(Dengo.x < 0 || Dengo.y < 0 || Dengo.x > 255 || Dengo.y > 255) {
llSay(0, "ERROR: Those coordinates are not in this sim. Aborting move.");
return;
}
integer maxSteps = 100;
while(llVecDist(llGetPos(), Dengo) > 1) {
maxSteps--;
if(maxSteps < 0)
return;
llSetPos(Dengo);
}
}

default {
touch_start(integer n) {
if(llDetectedKey(0) != llGetOwner())
return;

vector pos = llGetPos();
integer x;
for(x=10; x<25; x+=5) {
Goto(<x, pos.y, pos.z>);
llRezObject("Bumper Detector 7", llGetPos(), ZERO_VECTOR, ZERO_ROTATION, 0);
}
llOwnerSay("*** Done, returning");
Goto(pos);
}
}
Obviously you will need to change the bumper detector object's name from "Bumper Detector 7" to whatever you decide to call it.

To use this, assuming you're using the above script to lay down a line of bumper detectors, I recommend setting them up in a grid starting at ground level. Set up your lines perhaps 10 meters above one another, going up to 90 meters above ground level.

Once you set them in motion (shout "start" on channel 1 or just touch them individually), the ones that get pushed will go to the last location they were at before they were pushed. As a result, you'll get a bunch of them sitting in a spherical pattern at the border of the pusher's sensor range! You can use this to guess at the center of the push object's range, which would be the object itself.

The object may be invisible, so edit something and hold down ALT. That will highlight any hidden stuff. That should help you find it, assuming it is hidden. It may also be under the ground or hidden inside another object. You can make the ground invisible with ctrl+alt+shift+5 (if that does nothing, press ctrl+alt+shift+d to turn on the debug menu.)

Once I had my grid of bumper detectors set up, it took about 5-10 minutes to home in on the pusher.

An interesting mod for these scripts might to be to have the distribution script rez the objects with a parameter, and have that parameter cause them to start moving immediately, so you don't have to touch or shout at them.

By default, the objects move in 10M steps. You can set this lower to get more accuracy. The scan will take longer, but it might be worth it.

Once you find the push object, I recommend filing an abuse report and calling in a liaison. They can read scripts in objects they don't own, which can be an important step in proving that the object you found is, indeed, the pusher.
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Discussion Thread
11-01-2005 06:12
/54/59/69233/1.html
_____________________
i've got nothing. ;)