Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Discussion: Anti-Grief Script (updated)

Siro Mfume
XD
Join date: 5 Aug 2004
Posts: 747
12-22-2005 10:41
From: Lone Jacobs
how do you add the llOwnerSay to the script in the right section? Im new with this scripting thing. :confused:


There was a time when people had to use llWhisper instead of llOwnerSay to have a script be as nonspammy to the rest of the world as possible. So basically, if you want to use the original script instead of the movement script (I'd rather you use the movement script, it's more polished), then you need to take sections like this:

CODE
collision_start(integer detected)
{
if (llDetectedType(0) & SCRIPTED) //scripted object collision detection
{
objectowner = llDetectedOwner(0);
presentInSimTestName = llKey2Name(objectowner);
if(presentInSimTestName != llKey2Name(llGetOwner()))
{
llWhisper(0,"you were collided with by " + presentInSimTestName+"'s scripted object.");
//this will return "you were collided with by 's scripted object." (instead of their name)
//fairly often, however it was a decent compromise over choking the dataserver.
}
if(armed) //deflection shielding
{
vector vel = llDetectedVel(0);
vel = -vel;
llPushObject(llDetectedKey(0),vel * 5, ZERO_VECTOR, FALSE);
}

}
}


and change them to things like this

CODE


collision_start(integer detected)
{
if (llDetectedType(0) & SCRIPTED) //scripted object collision detection
{
objectowner = llDetectedOwner(0);
presentInSimTestName = llKey2Name(objectowner);
if(presentInSimTestName != llKey2Name(llGetOwner()))
{
llOwnerSay("you were collided with by " + presentInSimTestName+"'s scripted object.");
//this will return "you were collided with by 's scripted object." (instead of their name)
//fairly often, however it was a decent compromise over choking the dataserver.
}
if(armed) //deflection shielding
{
vector vel = llDetectedVel(0);
vel = -vel;
llPushObject(llDetectedKey(0),vel * 5, ZERO_VECTOR, FALSE);
}

}
}


Note, I only change part of one line, but it effectively prevents anyone but you from hearing massive amounts of collision spam output.

Edit: I went back and updated older script to use llOwnerSay instead of llWhisper
Tai Clifford
Registered User
Join date: 26 Jul 2006
Posts: 45
08-10-2006 14:54
I have been playing with your script Siro, and I think its great. I have the script in a belt I wear on my avatar and I am using llDialog choices to set the speeds etc. I find it easier that way. I am pretty new to SL so I don't understand a lot yet. What I am finding is that I may be walking along, then when I stop I will end up with my avatar going into a floating animation (a 45 degree angle looking down). I am guessing this happens because the level of the terrain changed and your script moved me along a level plane and I am now above the ground. Is this right? Is there some way I can stop this? ie if I am not supposed to be flying, that I go to a standing position rather than the freefall/floating one.

Also which is the best script to use, I am using the one with llApplyImpulse and not llSetForce. I got a bit confused on which is your latest. Thanks in advance.
1 2