Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

multiple sit locations on one prim

Ina Centaur
IC
Join date: 31 Oct 2006
Posts: 202
05-07-2007 02:31
is it possible to have multiple people sit in exact script-specified spots on one prim?
Soen Eber
Registered User
Join date: 3 Aug 2006
Posts: 428
05-07-2007 05:14
I may be gently surprised, but since you need to specify a sit target for each prim in order to use a custom pose and you can only supply one sit target per prim (it becomes a property of the prim) I would doubt that very much.

Conversly, know if you have, say, a 10 x 1 x 1 meter prim lengthwise like a bench, the default sit action will allow multiple avatars to sit on it at different locations. I can't explain that inconsistancy - but I don't see any way to duplicate it with LSL.
Sys Slade
Registered User
Join date: 15 Feb 2007
Posts: 626
05-07-2007 05:26
@Soen: The reason multiple AVs can sit on a long bench is because the client decides if there is enough space to sit when a sit target is not available.

@Ina: Following on from someone else mentioning that it is possible to move avatars using llSetLinkPrimitiveParams, I created a bench that moves avatars to one side as they sit. When someone stands up, everyone shuffles over to fill the gap.

It doesn't allow multiple sit positions, so it still relies on the client finding the spot to sit on, but it does make it easier to sit without getting the "unable to sit here" message as there is more empty space.

It's just a quick workup, and could probably be improved, but feel free to use it and improve it. If someone has any improvements, please post, but this is not an obligation or restriction on use :)
CODE
float seat;
float startseat;
integer startlinks;
integer links;
vector size;
float offset=0.75; //how far to space each seater

default{
state_entry(){
startlinks=llGetNumberOfPrims();
links=startlinks;
size=llGetScale();
seat=(size.y / 2) - 0.5;
startseat=seat;
llSitTarget(<0,size.y / 2,0.5>,ZERO_ROTATION);
}

changed(integer change){
if(change & CHANGED_LINK){
integer linksnow=llGetNumberOfPrims();
if(linksnow > links){
llSetLinkPrimitiveParams( llGetNumberOfPrims(), [ PRIM_POSITION, <0.5,seat,1> ]);
seat -= offset;
links=linksnow;
}else{
links=linksnow;
seat=startseat;
integer seated=links - startlinks;
if(seated){
integer i=1;
do{
llSetLinkPrimitiveParams( startlinks + i, [ PRIM_POSITION, <0.5,seat,1> ]);
seat -= offset;
i++;
} while(i<=seated);
}
}
}
}
}


BTW, this should be dropped into a prim where the y axis is longer than the x axis.
Once the script is in place, you can orient the prim to be longer along x or y axis.
Sterling Whitcroft
Registered User
Join date: 2 Jul 2006
Posts: 678
05-07-2007 21:03
I have a bench that seats 4 in one prim. I used code from the forums...dated about 18 months ago, I think.
Here's the link to Cua Curie's Multiple Location Sit code:
/54/f8/64644/1.html

And some discussion about which Avitars UUID is returned when several sit on one prim. /54/66/147510/1.html

AND, see this recent code:
/54/da/182465/1.html
:D