Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Reliable Way to Deny "Sit Here"

Loki Pico
Registered User
Join date: 20 Jun 2003
Posts: 1,938
01-03-2006 13:09
I am working on a project and I am wondering if there is a reliable way to deny the "sit here" option. I know often times there is no suitable place to sit, is there a way to intentionally create this condition? I dont necessarily need to remove the option to sit, I just want to make it fail if chosen. I am primarily working with default cubes formed into walls. Thanks for the insight.
Ushuaia Tokugawa
Nobody of Consequence
Join date: 22 Mar 2005
Posts: 268
01-03-2006 13:17
CODE

default {
state_entry() {
llSitTarget(<0.0, 0.0, 0.1>, ZERO_ROTATION);

llSetSitText("Don't Sit");
}

changed(integer change) {
if (change & CHANGED_LINK) {
key avatar = llAvatarOnSitTarget();

if (avatar) llUnSit(avatar);
}
}
}
_____________________
Loki Pico
Registered User
Join date: 20 Jun 2003
Posts: 1,938
01-03-2006 13:28
Thanks Ushuaia, that almost works. The problem is that it tosses the avatar off after they have attempted to sit and could potentially land them in an undesired position.

I am looking for a way to hollow, cut, or link in a manner that denies the option to sit at all. I get it sometimes on things when I want to sit, but I am unsure of the conditions that create that situation. If there is a way to reproduce that, that would be my best option.
Rickard Roentgen
Renaissance Punk
Join date: 4 Apr 2004
Posts: 1,869
01-03-2006 13:49
There is no reliable way, though you maybe should try posting a question specifically for a linden coder to ask how it's determined if a sit is allowed.
_____________________
Ushuaia Tokugawa
Nobody of Consequence
Join date: 22 Mar 2005
Posts: 268
01-03-2006 15:30
From: Loki Pico

Thanks Ushuaia, that almost works. The problem is that it tosses the avatar off after they have attempted to sit and could potentially land them in an undesired position.


I understand it's not quite what you're looking for, but you could adjust the sit target to a more desirable position as a work around.
_____________________
Dianne Mechanique
Back from the Dead
Join date: 28 Mar 2005
Posts: 2,648
01-03-2006 15:35
From: Loki Pico
Thanks Ushuaia, that almost works. The problem is that it tosses the avatar off after they have attempted to sit and could potentially land them in an undesired position.

I am looking for a way to hollow, cut, or link in a manner that denies the option to sit at all. I get it sometimes on things when I want to sit, but I am unsure of the conditions that create that situation. If there is a way to reproduce that, that would be my best option.
I notice I get the most sit refusals on a torus. What if there were invisible phantom tori linked all over stuff?
Just a thought, dont know if it would work.
_____________________
.
black
art furniture & classic clothing
===================
Black in Neufreistadt
Black @ ONE
Black @ www.SLBoutique.com


.
Loki Pico
Registered User
Join date: 20 Jun 2003
Posts: 1,938
01-03-2006 18:24
Thanks for the help guys. Its not "mission critical", I was just wondering if it was possible to do on demand. I decided to just include thie following warning with the instructions :D

"Sit here" will often force exit of the maze. This is a simple escape, but a completion failure. Click carefully to avoid premature ejection.
Art Laxness
Registered User
Join date: 24 Sep 2005
Posts: 34
01-04-2006 00:53
From: Loki Pico
Click carefully to avoid premature ejection.


...might wanna be careful on the wording, theres some people who will make innuendo from anything :)
Ben Bacon
Registered User
Join date: 14 Jul 2005
Posts: 809
01-04-2006 03:32
From: Ushuaia Tokugawa
I understand it's not quite what you're looking for, but you could adjust the sit target to a more desirable position as a work around.
From: Loki Pico
"Sit here" will often force exit of the maze. This is a simple escape...
Use this to your advantage - Set the sit target for each wall to the start location of the maze (it'll be a bit of work, but after the first 10 you'll be a pro :)) and set the sit text to "Restart"

Nice feature for ppl that get all tied up and disorientated.
Rickard Roentgen
Renaissance Punk
Join date: 4 Apr 2004
Posts: 1,869
01-04-2006 10:17
CODE

vector start_of_maze = <place the coordinates of the entrance here>;
string sit_text = "Restart Maze";

vector last_known_position = ZERO_VECTOR;
rotation last_known_rotation = ZERO_ROTATION;

calculate_sit_target()
{
if (last_known_position != llGetPos() || last_known_rotation != llGetRot()) {
last_known_position = llGetPos();
last_known_rotation = llGetRot();
llSetSitTarget((start_of_maze - last_known_position) / last_known_rotation, ZERO_ROTATION);
llSetSitText(sit_text);
llOwnerSay("Sit Target Reset");
}
}

default
{
state_entry()
{
calculate_sit_target();
}

on_rez(integer sparam)
{
calculate_sit_target();
}

touch_start(integer n)
{
if (llDetectedKey(0) == llGetOwner()) {
calculate_sit_target();
}
}

moving_end()
{
calculate_sit_target();
}

changed(integer change)
{
if ((changed & CHANGED_LINK) != 0) {
if (llAvatarOnSitTarget() != NULL_KEY) {
llSleep(0.25); // Seems to help keep people from bouncing strangely over long sit distances.
llUnSit(llAvatarOnSitTarget());
} else {
calculate_sit_target();
}
}
}
}


Was bored so I figured I'd post code that would work in any prim without modification. It doesn't update if you rotate a prim and might not do so reliably when you move a prim so to make sure it's sit target is updated when the prim is in it's final position, touch it.

This script is not active and as such should not have any measurable effect on region performance even if it's in a large number of prims.
_____________________