Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Vehicle seat scripts

ArchTx Edo
Mystic/Artist/Architect
Join date: 13 Feb 2005
Posts: 1,993
11-06-2005 09:45
I'm using the "Simple Car Script V1.0" to script a 1953 Chevy Pickup Truck that I built, photo below. The truck works sell in most regards, the only significant problem I had is controling how the passanger sits in the vehicle. If the passanger clicks on the bucket seat it self to sit, it works fine (see script below). But if the passanger clicks someplace else on the truck to sit, after the driver is seated, they end up in the middle of the vehicle facing the driver with thier legs in the drivers lap.

I know I have been in some vehicles where the passanger is seated properly no matter where they click to sit on the vehicle. Can anyone tell me how this is controlled?


From: someone

//clip from Simple Vehicle Script sit text.
default
{
state_entry()
{
llMessageLinked(LINK_ALL_CHILDREN, 0, "stop", NULL_KEY);
llCollisionSound("", 0.0);
llSetSitText("Get in";);
llStopSound();
llSetTimerEvent(0.0);
speed=0;
llSitTarget(<0.1, 0.35, 0.6>, <0,-0.2,0,1>;);
llSetCameraEyeOffset(<-5.0, 0.0, 2.5>;);
llSetCameraAtOffset(<0.0, 0.0, 1.0>;);




From: someone

//bucket seat script
default
{
state_entry()
{
llSetSitText("";);
llSitTarget(<0.1,0.0,-0.6>, <0,-0.2,0,1>;);
llSetCameraEyeOffset(ZERO_VECTOR);
llSetCameraAtOffset(ZERO_VECTOR);
}
changed(integer change)
{
if (CHANGED_LINK)
{
key agent = llAvatarOnSitTarget();
if (agent)
{
}
else
{
llUnSit(agent);
}
}

}
}

_____________________

VRchitecture Model Homes at http://slurl.com/secondlife/Shona/60/220/30
http://www.slexchange.com/modules.php?name=Marketplace&MerchantID=2240
http://shop.onrez.com/Archtx_Edo
Zapoteth Zaius
Is back
Join date: 14 Feb 2004
Posts: 5,634
11-06-2005 09:52
I think it has something to do with which order the objects are linked in.. So link all the ones that don't matter first, then the passenger seat(s) and then the drivers seat.. I should think you can use a sit target script in the passengers chairs to make them sit where you want..
_____________________
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
11-06-2005 10:48
Zap's more or less right. Link numbers run in reverse order to selection number (at least I think that's right, it's been a while since I checked and I didn't do so exhaustively), and if there are multiple prims with sit targets in them they get used in link number order.

So basically if you make your driver's seat the root prim or similar for a two seater ANY other prim should then work as the next sit target.

I suspect, for the sake of neatness, it's worth doing them at the end in reverse order, but it's up to you.