Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Preventing a sit on a prim

Rock Vacirca
riches to rags
Join date: 18 Oct 2006
Posts: 1,093
02-23-2008 17:45
Hi guys,

Is there any way, using LSL, of preventing an avatat from sitting on a standard cube prim, apart from making the prim phantom?

TIA

Rock
Xhawkx Holden
Registered User
Join date: 1 Nov 2006
Posts: 86
02-23-2008 18:45
Not prevent... but you can unsit them if they DO sit on it
Rock Ryder
Registered User
Join date: 6 Oct 2006
Posts: 384
02-25-2008 01:40
From: Xhawkx Holden
Not prevent... but you can unsit them if they DO sit on it


Why, when I choose various objects around my home to sit on, do I get the 'No suitable place to sit' message?

If this is due, as I suspect, to the object being part of a linkset, then I could possible inhibit the sitting on a prim by linking it to transparent phantom prim(s)?

Rock
Haplo Voss
Registered User
Join date: 18 Nov 2006
Posts: 137
02-25-2008 02:32
You can actually just drop a very simple little script into any prim / root prim of a linked set and it will do the job for you... like so...

key gID;
key avID;

default
{
state_entry()
{
llSitTarget(<0,0,.5>,ZERO_ROTATION);
gID = llGetOwner();
}
on_rez(integer rez)
{
gID = llGetOwner();
}
changed(integer change)
{
avID = llAvatarOnSitTarget();
if (change & CHANGED_LINK)
{
if (avID != NULL_KEY)
{
if (avID != gID)
llUnSit(avID);
}
}
}
}

The above will allow the Owner to sit quite nicely on any object and you will no longer get the "no suitable place to sit" message either... however, if the person trying to sit does not own the object, they will be immediately unseated once they try to sit.

Hope that helps...
- Hap

(I just wrote that up off the top of my head... you will want to test it and make sure it works on a box or something before you go slapping it into your prims ;) )
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
02-25-2008 07:27
From: Rock Ryder
Why, when I choose various objects around my home to sit on, do I get the 'No suitable place to sit' message?

If this is due, as I suspect, to the object being part of a linkset, then I could possible inhibit the sitting on a prim by linking it to transparent phantom prim(s)?

Rock

usually it's the result of sl not having a convenient way to get you to a place near where you clicked to sit... usually because it's too close to the bounding box of another av, or because the top of the bounding box is being occluded by another object or prim... sometimes even another prim in the same object (and occassionally you'll end up on top of that other prim)

which is why you seem to get better results clicking on the front edge of a bench that has no sit targets, than on top of the seat (also helps to be standing in front of the side you want to sit facing)

you could probably build something to mimic this behavoir, but the drawbacks would be extra prims, it may not behave consistantly, and they could presumably sit on the blocking objject... oh yeah and those extra prims get in the way of clicking even if they're invisible
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
02-25-2008 07:32
a <0,0,0> sit target will OFTEN make an object "unsittable"... but it's not foolproof and on rare occassions you'll sit on it anyways, ususally in a defaultish place.

if you REALLY don't want someone sitting on something, the unsit trick is the way to go. To be mean, add a sit target like <300,300,300> and you're unlikely to see them for a while after they try.

For a vehicle, this means leaving an extra prim available. so that means ONE LESS prim than your vehicle.. so that the unwanted sitters agent doesn't become the 32nd prim and force your vehicle to become nonphysical.
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Rock Vacirca
riches to rags
Join date: 18 Oct 2006
Posts: 1,093
02-25-2008 11:19
From: Winter Ventura
a <0,0,0> sit target will OFTEN make an object "unsittable"... but it's not foolproof and on rare occassions you'll sit on it anyways, ususally in a defaultish place.

if you REALLY don't want someone sitting on something, the unsit trick is the way to go. To be mean, add a sit target like <300,300,300> and you're unlikely to see them for a while after they try.

For a vehicle, this means leaving an extra prim available. so that means ONE LESS prim than your vehicle.. so that the unwanted sitters agent doesn't become the 32nd prim and force your vehicle to become nonphysical.


Hehehehe, evil ;-)

What I am doing is a small modification of that excellent 'Pirate Ghost protecting the treasure chest' script of ArchTX Edo. When someone approaches the treasure chest the pirate ghost appears and pushes them futher and further away from the treasure shouting abuse at them, flashing swords, and much blood in the water. However, a few savvy people have realised that by sitting on the treasure chest they are immune from the Pirate's attacks, and can try to work out how to get to the treasure, and it is this trick of theirs that I wanted to defeat. I will use llUnsit, as suggested.

Rock
Lee Ponzu
What Would Steve Do?
Join date: 28 Jun 2006
Posts: 1,770
02-25-2008 14:01
I think you could put a Stand animation in the prim, and invoke it upon sit. Taht way, even after "sitting" the user would still see himself "standing".

That ought to make them crazy. 8-)
_____________________
So many monkeys, so little Shakespeare.
Rock Vacirca
riches to rags
Join date: 18 Oct 2006
Posts: 1,093
02-25-2008 15:10
From: Lee Ponzu
I think you could put a Stand animation in the prim, and invoke it upon sit. Taht way, even after "sitting" the user would still see himself "standing".

That ought to make them crazy. 8-)


Love it!! :)))