Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How do you make an object "UN-sittable"?

AnnMarie Otoole
Addicted scripter
Join date: 6 Jan 2007
Posts: 162
03-14-2007 21:25
I need to prevent an avatar sitting on certain objects. There are times when you get a message - no suitable place to sit or no room to sit. What causes these responses and how can I use them - or some other control - to prevent sitting on what would otherwise be a legitimate target?

Thanks,
Ann-Marie
MadamG Zagato
means business
Join date: 17 Sep 2005
Posts: 1,402
03-14-2007 22:13
CODE



default
{
state_entry()
{
llSitTarget(<0.0, 0.0, 0.1>, ZERO_ROTATION); //needed for llAvatarOnSitTarget to work. The vectors components must not all be set to 0.
}
changed(integer change) //event changed
{
if (change & CHANGED_LINK) //event changed and it has something to do with linking or avatar sitting
{
key user = llAvatarOnSitTarget();
if (user) //the changed event is an avatar sitting
llUnSit(user); //unsit the avatar on the sit target
}
}
}




_____________________
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
03-15-2007 00:17
http://www.slexchange.com/modules.php?name=Marketplace&file=item&ItemID=55040

It's not a kicker.. (as shown above)... but a way to trigger the "no suitable surface" when trying to sit. I don't know HOW they've acheived this... but I do know.. it works about 85% of the time. a GREAT idea for vehicles.

L$1
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Daisy Rimbaud
Registered User
Join date: 12 Oct 2006
Posts: 764
03-15-2007 08:56
Very interesting - it would indeed be interesting to know how this was done.
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
03-15-2007 09:53
From: AnnMarie Otoole
What causes these responses and how can I use them - or some other control - to prevent sitting on what would otherwise be a legitimate target?

This message if i recall right indicates that all prims of the object are lacking predefined sit target. This is done by running

llSitTarget( ZERO_VECTOR, ZERO_ROTATION );

command in each of the prims (the script which does it can be removed once done)

It won't always work, as in some cases the client can figure out suitable spot for the AV to sit if the object has large enough prim(s), but worth trying i guess. ^^;
MadamG Zagato
means business
Join date: 17 Sep 2005
Posts: 1,402
03-15-2007 11:06
From: Daisy Rimbaud
Very interesting - it would indeed be interesting to know how this was done.


Too bad the code is not viewable. But you can easily modify the code I gave you to suit your needs. Here it is again for your reference:

CODE



default
{
state_entry()
{
llSitTarget(<0.0, 0.0, 0.1>, ZERO_ROTATION); //needed for llAvatarOnSitTarget to work. The vectors components must not all be set to 0.
}
changed(integer change) //event changed
{
if (change & CHANGED_LINK) //event changed and it has something to do with linking or avatar sitting
{
key user = llAvatarOnSitTarget();
if (user) //the changed event is an avatar sitting
llUnSit(user); //unsit the avatar on the sit target
}
}
}




_____________________
Learjeff Innis
musician & coder
Join date: 27 Nov 2006
Posts: 817
03-15-2007 11:25
From: Winter Ventura
http://www.slexchange.com/modules.php?name=Marketplace&file=item&ItemID=55040

It's not a kicker.. (as shown above)... but a way to trigger the "no suitable surface" when trying to sit. I don't know HOW they've acheived this... but I do know.. it works about 85% of the time. a GREAT idea for vehicles.

L$1


Nice, but it doesn't work, not on a new wooden cube. LL must have changed something. It shows "sit here" and allows me to sit.

I want my $1 back! (haha)
Learjeff Innis
musician & coder
Join date: 27 Nov 2006
Posts: 817
03-15-2007 11:26
One case where you get that message ("No suitable place ...";) is when someone is already sitting on the object.

You can set the sit text to " ", so it doesn't LOOK like you can sit on it. But you can still select the blank pie piece and sit.
Darien Caldwell
Registered User
Join date: 12 Oct 2006
Posts: 3,127
03-15-2007 12:31
i have a no sit target script. I"ll have to dig it up when I get home from work.
Gearsawe Stonecutter
Over there
Join date: 14 Sep 2005
Posts: 614
03-15-2007 12:47
There is sort of an old bug related to this. Make an object phantom then have it hover off the ground making sure it is not intersecting any other non-phantom objects. Then try and sit on it. You should not be able to. If the object is intersecting any non-phantom object or the ground as where the point in which you right clicked passes thru solid space of the prim and hits the ground or another object you will sit on the ground or the object it intersected with. But you will be attached to the phantom object. It is very weird behavior. I have not tested this in the past 5 or 6 months so not sure if this is still true.

Also I think changing the properties of a prim such as to phantom or a cut value will unsit a person aswell. But try makeing the object phatom then unsitting them then turn the object back to non-phantom. They should not get ejected this way.
MadamG Zagato
means business
Join date: 17 Sep 2005
Posts: 1,402
03-15-2007 13:38
From: Learjeff Innis
Nice, but it doesn't work, not on a new wooden cube. LL must have changed something. It shows "sit here" and allows me to sit.

I want my $1 back! (haha)
Did you try the code I posted above? Create a new script and copy and paste it. It works fine for me.

:)
Hope that helps!
Over Sleeper
I Dream in LSL
Join date: 12 Jan 2006
Posts: 141
03-15-2007 13:40
From: MadamG Zagato
Too bad the code is not viewable. But you can easily modify the code I gave you to suit your needs. Here it is again for your reference:

CODE



default
{
state_entry()
{
llSitTarget(<0.0, 0.0, 0.1>, ZERO_ROTATION); //needed for llAvatarOnSitTarget to work. The vectors components must not all be set to 0.
}
changed(integer change) //event changed
{
if (change & CHANGED_LINK) //event changed and it has something to do with linking or avatar sitting
{
key user = llAvatarOnSitTarget();
if (user) //the changed event is an avatar sitting
llUnSit(user); //unsit the avatar on the sit target
}
}
}






Yep, that is the same thing I was gonna post. That works for me.
Learjeff Innis
musician & coder
Join date: 27 Nov 2006
Posts: 817
03-15-2007 13:40
Yes, the code you posted works fine at unseating people if they do sit.

The code on SLX doesn't work any more, which is unfortunate. Too bad, beacause it's bettter to make 'unsittable' a property of the object, allowing the script to delete itself, freeing resources on the server, keeping people from taking an action that won't end up working for them anyway.
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
03-15-2007 13:47
From: Winter Ventura
http://www.slexchange.com/modules.php?name=Marketplace&file=item&ItemID=55040

It's not a kicker.. (as shown above)... but a way to trigger the "no suitable surface" when trying to sit. I don't know HOW they've acheived this... but I do know.. it works about 85% of the time. a GREAT idea for vehicles.

L$1



Well I'm willing the guarantee that since the other scripts in that package are very basic, that this script is no more complicated than
CODE
default
{
state_entry()
{
llSitText(" ");
llSitTarget(ZERO_VECTOR,ZERO_ROTATION);
}
}


In most vehicles the prims are fairly complex...at least any good vehicle, and they will almost always return a no suitable surface message if there's no sit target specified.

Those nice little bucket seats made out of spheres? Nope - no suitable surface.

I have my sit target/camera info in an on_rez event in my scripts so if I don't take it to inventory after I build it, it will return that message almost everytime...I've forgotten to take it a few times before :)
Learjeff Innis
musician & coder
Join date: 27 Nov 2006
Posts: 817
03-15-2007 14:13
It may be no more complicated than that, but that's not what it does, because that script would cause the sit wedge to appear blank, whereas the SLX script does not do this any more.

Setting the sit target to the default doesn't disable sits on simple objects like cubes. It may do so on objects that don't have a default sit target.
Adriana Caligari
Registered User
Join date: 21 Apr 2005
Posts: 458
03-15-2007 14:28
I did wonder why both Zaggy and her alt were posting right after each other on this thread - then I realized it was my script that was being referred to - explains it all now.

I will look into the script and what has changed in SL and update the box shortly.
_____________________
Maker of quality Gadgets
Caligari Designs Store
Daisy Rimbaud
Registered User
Join date: 12 Oct 2006
Posts: 764
03-15-2007 14:33
From: Learjeff Innis
Yes, the code you posted works fine at unseating people if they do sit.


There's actually a big difference between unseating people after they have attempted to sit, and not allowing them to sit in the first place.

Consider the situation: avatar at point A, prim at point B. Avatar tries to sit on prim. If the prim is unsittable, the avatar stays at A. If the avatar is unseated, they end up at B.
Kephra Nurmi
winged bug
Join date: 12 Jan 2007
Posts: 180
03-15-2007 14:55
Moin,

From: Daisy Rimbaud
There's actually a big difference between unseating people after they have attempted to sit, and not allowing them to sit in the first place.

Consider the situation: avatar at point A, prim at point B. Avatar tries to sit on prim. If the prim is unsittable, the avatar stays at A. If the avatar is unseated, they end up at B.


I think this is the main point: You can still zoom in and sit on a chair, even if a house is locked. The solution would be to set an llSitTarget for every object in the house, to point to something outside the house, if you lock the door.

Make the area no-fly and combat and send them 250meters up ... evil grin ...
or have a guest area near your house and hand them a coffee.

ciao,Michael
Gearsawe Stonecutter
Over there
Join date: 14 Sep 2005
Posts: 614
03-15-2007 16:22
Making a prim or linked set Phantom and making sure it does not intersect the ground or another non-phantom object will make it unsitable. This will give you the message "There is no suitable surface to sit on, try another spot." and best part is.... No script needed
MadamG Zagato
means business
Join date: 17 Sep 2005
Posts: 1,402
03-15-2007 17:23
I wondered the same thing about Addy too. Strange.
:confused:

I didn't realize anyone was referring to a script on SLX. I posted up a code after the initial poster asked about unsitting. It's straight from the WIKI LOL
MadamG Zagato
means business
Join date: 17 Sep 2005
Posts: 1,402
03-15-2007 17:26
Reference:
http://wiki.secondlife.com/wiki/LSL_llUnSit
Gaius Goodliffe
Dreamsmith
Join date: 15 Jan 2006
Posts: 116
03-15-2007 17:40
From: MadamG Zagato
I posted up a code after the initial poster asked about unsitting.

Actually, the original poster never asked anything about unsitting. OP: "There are times when you get a message - no suitable place to sit or no room to sit. What causes these responses and how can I use them..."

The posted code was more or less a complete non-sequitur from what was actually asked about. In any case, from the post, what the OP wants is some way to make it so you can't sit on an object to begin with, not a way to unsit someone once they've already sat on it -- to make the object unsittable to begin with, not to unsit the avatar after the fact.

If there's a way to do that, I'm kinda interested in knowing myself. :)
MadamG Zagato
means business
Join date: 17 Sep 2005
Posts: 1,402
03-15-2007 17:45
Ohhhhh! Doh!
Slaps head :)

How do you make an object "UN-sittable"?

Maybe I should get some sleep. Thanks for clearing that up Gaius. Sometimes I read a little fast. I'll try and slow it down a bit.

Thanks.
_____________________
Gaius Goodliffe
Dreamsmith
Join date: 15 Jan 2006
Posts: 116
03-15-2007 18:12
From: MadamG Zagato
Thanks for clearing that up Gaius. Sometimes I read a little fast. I'll try and slow it down a bit.

No prob. I'm sure we've all, at some point or another, jumped into a thread after only reading the title with an incorrect or incomplete understanding of what was being asked for. If you go in thinking you already know the answer, it's sometimes hard to notice that the question wasn't what you thought it was before you clicked in.
Daisy Rimbaud
Registered User
Join date: 12 Oct 2006
Posts: 764
03-16-2007 03:50
From: Kephra Nurmi
Make the area no-fly and combat and send them 250meters up ... evil grin ...


Ooh that's evil ... I like it ...
1 2