Multi-location sit script
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
10-06-2005 14:15
Is it possible?
So that person one sits on a sit target, then sit target 2 is activated so person 2 sits there, and so on?
I'm thinking not, but wanted to check if anyone has come up with a way to do it. I'm making a bench, so I can cheat and apply constant offsets if necessary, so they line up along the bench.
|
JackBurton Faulkland
PorkChop Express
Join date: 3 Sep 2005
Posts: 478
|
10-06-2005 14:20
yes but i would need to test to make sure i am right ;0
|
Zapoteth Zaius
Is back
Join date: 14 Feb 2004
Posts: 5,634
|
10-06-2005 14:53
From: Eloise Pasteur Is it possible?
So that person one sits on a sit target, then sit target 2 is activated so person 2 sits there, and so on?
I'm thinking not, but wanted to check if anyone has come up with a way to do it. I'm making a bench, so I can cheat and apply constant offsets if necessary, so they line up along the bench. I'm not quite sure what you mean.. If you have more than one object, and link them together, with sit targets in the ones you want people to be able to sit on, and link them in reverse order (the last linked prim with sit target in being the first place someone sits), then they'll go in that order, I believe.. But I may WELL be wrong.. and it may WELL have nothing to do with what your asking.. I'm gonna go be useless somewhere else..
_____________________
I have the right to remain silent. Anything I say will be misquoted and used against me.--------------- Zapoteth Designs, Temotu (100,50)--------------- 
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
10-06-2005 15:23
I'm after ONE prim with serial sit targets as people use them. I can do the tricks with multiple prims, it's trying to save prims in what is already a messy enough build that I'm after, hence 1 prim, several sit targets if possible.
|
Logan Bauer
Inept Adept
Join date: 13 Jun 2004
Posts: 2,237
|
10-07-2005 07:13
Hi Eloise, Hmm, I dunno, when you say "I can do the trick with multiple prims" do you mean, put a sit-script in your bench, and then another in the floor, wall, surrounding areas, ect? Or into additional "pose-ball" or seat-cushion prims? Only thing I can think to suggest is.... If this build is a vehicle or even something that's gonna be linked together at least, you should be able to link them in reverse order like Zapoteth suggests, and then I think clicking to sit aaaanywhere on your "bench" or anywhere on the linked set will make AV's file sequentially into each of the sit-spots you've defined... In other words, try putting the sit-scripts not in NEW prims but in existing prims, and then link at LEAST all of your "stow away" sit scripts and the bench. Hopefully, that will make clicking sit repeatedly on the bench make AV's actually sit on the other nearby prims instead of saying "nowhere to sit"- and then if that works just adjust your offsets to make them appear to all be sitting on the bench. Hope I'm understanding you right and this is even partially helpful.  edit - the more I think about this, if it says the seat is already occupied and there's nowhere to sit, then it would probably be overkill/unnecessarily complex... BUT, if someone sits on the seat, and as soon as they sit it triggers use of llSetPrimitiveParams - Change your seat prim into the floor prim, and your floor prim into your seat prim, I am pretty sure the first AV that sat will stay at the exact same position and camera offset, but now be sitting on a new prim (what used to be the floor prim) so the next person who clicks can sit in the next place and the cycle can continue... 
|
cua Curie
secondlifes.com/*****
Join date: 14 Nov 2003
Posts: 196
|
10-07-2005 07:49
This is basic coding for it, there is alot more you could do to improve it. Use it as ya like. //Single prim multiple sit target script by cua Curie //use as you like //single prim multi sit target script //this configuration is for prims that are longer than 2 meters on the y axis //change offset variable to adjust spacing
vector size;//prim size float offset=0.5;//spacing variable float current;//tracks current target default { state_entry() { llSetScale(<.5,4,.5>);//sets the prim size automaticly for this demo size=llGetScale();//gets the prim size so we don't sit the person off the edge of the prim llSitTarget(<0,(size.y /2) - (current + offset),.5>,ZERO_ROTATION);//sets original sit target based on prim size and offset }
changed(integer change)//and avatar sitting on a prim triggers CHANGED_LINK so we can use this to change the sit target { if(change==CHANGED_LINK) { llSitTarget(<0,(size.y /2) - (current + offset),0>,ZERO_ROTATION);//changes the postion current+=offset; if(current>size.y)//if the next target is off the edge of the prim reset the postion { current=0; llSitTarget(<0,(size.y /2) - (current + offset),0>,ZERO_ROTATION); } } } }
_____________________
"It is better to keep your mouth shut and appear stupid than to open it and remove all doubt." - Mark Twain
"We are what we pretend to be, so we must be careful what we pretend to be." - Kurt Vonnegut
|
Logan Bauer
Inept Adept
Join date: 13 Jun 2004
Posts: 2,237
|
10-08-2005 09:46
From: cua Curie This is basic coding for it, there is alot more you could do to improve it. Use it as ya like.
!!!?!? Wow, you can do that? Niiiiiiceeee! <bows before cua>
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
10-08-2005 10:05
Yes, it appears you can. Thanks for restoring my belief I could write a clear request Cua, this does what I was asking about, and will be hacked into the final version I want to use.
|
Zante Zapedzki
We need html on a prim!
Join date: 15 Feb 2007
Posts: 123
|
04-06-2007 11:45
Excellent : )
How would I change this to make sure that everyone who sits on the prim is facing a certain object/direction?
|
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
|
04-06-2007 11:59
Wonder what llAvatarOnSitTarget will return after all this  And you'd probably have a hard time filling in gaps if someone stood up, right. I don't know if there'd be any way to track which sit target is now free.
|