Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Vehicle Help - Multiple Passengers, Positions, Poses

Chris Wilde
Custom User Title
Join date: 21 Jul 2004
Posts: 768
04-18-2005 13:35
What Im making: A vehicle with multiple places to 'sit'. Some of these 'sits' will be sitting, standing or using custom animations.

Multiple Questions:

I want the driver to stand. Do most people simply stop the sit animation and start the stand animation?

I want a specific passenger sit position to use a custom animation. Is this posible? Do I just stop the sit and start the custom one?

How do I control where passengers sit? Do I place a separate script (meaning completely separate from the vehicles main script) in the object where they are going to be right clicking and sitting? Or does everything have to be in the main vehicles script?
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
04-18-2005 14:51
From: Chris Wilde
I want the driver to stand. Do most people simply stop the sit animation and start the stand animation?

Yes.

From: Chris Wilde
I want a specific passenger sit position to use a custom animation. Is this posible? Do I just stop the sit and start the custom one?
Yes/Yes.

From: Chris Wilde
How do I control where passengers sit? Do I place a separate script (meaning completely separate from the vehicles main script) in the object where they are going to be right clicking and sitting? Or does everything have to be in the main vehicles script?

Either will get the job done, depending on how you want to go about doing it. If you want sit targets to be accessible from sitting the entire vehicle itself, you might need option number two. Sitting individual areas will work fine with single scripts.

Oh, and make sure to use this and this.
_____________________
---
Chris Wilde
Custom User Title
Join date: 21 Jul 2004
Posts: 768
04-18-2005 19:22
Thanks! Got custom animation/poses working.

Now Im working on sitting positions.
Chris Wilde
Custom User Title
Join date: 21 Jul 2004
Posts: 768
04-18-2005 22:40
Ok I have made alternate sitting positions. Most everything I wanted to do I can do now. But Im curious how do you define the sit positions of passengers if you wanted them to sit on the same object for example using the same script.
Alan Kiesler
Retired Resident
Join date: 29 Jun 2004
Posts: 354
04-19-2005 00:29
IIRC, only one sit position per prim.

You can have multiple prims with multiple sit scripts, dealing with the appropriate positioning so thay they sit in the correct spots.

Head over to Tavarua, NE quad. There is a moddable Crown vic for sale by Racer Plisskin that can seat four. He even gives complete instructions regarding what items are which and the linking order (the card is free).

Should give you a good starting point for what you need to do.
_____________________
Timothy S. Kimball (RL) -- aka 'Alan Kiesler'
The Kind Healer -- http://sungak.net

No ending is EVER written; Communities will continue on their own.
Chris Wilde
Custom User Title
Join date: 21 Jul 2004
Posts: 768
04-19-2005 07:49
Ahh cool, I'll check it out tonight. So linking order or child # (Forgot the SL term) plays a role in where the next person sits? (Assuming they dont click on a prim with a sit script already in it)
Racer Plisskin
Rezerator
Join date: 2 Jan 2005
Posts: 147
04-19-2005 18:26
It's prety simple, really but sounds complicated.

The sit scritps operate in link order.

I normaly put the drivers sit script in the root prim wich guarantees the first AV that tries to sit gets the driver spot.

In the case of the crown victoria, the front/rear bench seats are built from 2 cut/hollowed cubes. I put one sit script in each prim (front & rear passenger side). The rear driver side sit script is in the driver side police light on the rear dash.

By making sure to select the three seat script prims in the correct order (police light, seat prim with rear script, seat prim with front script, then the 4 tires, then the root prim), the passengers fill the car in the order they enter (driver, front right, rear right, rear left)...

The exception to the rule is if you click directly on a prim with a sit script in it. you will sit there instead and override the next available slot in the link order.

This wasn't a concern with the crown vic as the passenger compartment containing the sit prims is completely sealed so unless you use camera tricks to get inside the car, only the default sit order is normaly available.

On other cars, I've put the passenger sit script in the center console or some other spot it's unlikely the dirver will normaly click on when getting in (it's most liklely they will click on something big like the hood, roof or trunk).

Hope this helps.

Racer P.
Chris Wilde
Custom User Title
Join date: 21 Jul 2004
Posts: 768
04-21-2005 11:05
Oh sweet... so I select first the passenger seat prims in the order I want to fill them, then all the other prims, and finally the main prim?
Ale Bukowski
Gnomes Landscapers Master
Join date: 2 Apr 2004
Posts: 129
04-21-2005 14:52
Hi Chris. Nope, select first the prims without seats, then the seats in the inverse order you like people sited, then the root prim and link all. To make an example, if I want to seat three persons on a car, and want to give the priority to the driver, then the passenger on the aft seat and then the third passenger on the rear seat, I will select all the prims of the car minus the seats, then the rear seat prim, then the aft passenger seat, then the driver seat. In this way if you right click and do sit on a specific seat you'll sit there, but if you click and do sit on the car, selecting a prim wich isn't a seat, you'll sit on the last prim you've selected in the link process. If that seat is occupied, you'll sit on the last but one, and so on.
Chris Wilde
Custom User Title
Join date: 21 Jul 2004
Posts: 768
04-21-2005 15:09
thanks!
Racer Plisskin
Rezerator
Join date: 2 Jan 2005
Posts: 147
04-21-2005 18:12
Hi Chris,

Here's a few more nifty 'tricks' to getting the vector and rotation for each sit script correct:

1: I build the car and get the prims part done. Then I copy the car and rip off the roof etc and any other prim that will get in the way of testing the sitscripts by clicking directly on them. Then copy the finished sit script into the correct prim on the 'finished' prim version of the vehical (open top roadsters generaly don't need this though).

2: stick an extra prim (small cube) in the location you want the AVs pelvis to end up. link it to the prim that will contain the sitscript (only the 2 prims should be linked with the sitscript prim as root). Drop a small script in the cube that will use llSay (on_touch) to give you the llGetLocalRot and llGetLocalPos numbers. Then just plug in the numbers into the sit script...

That at least gets you close and you can tweek the numbers from there using your avatar and jumping in and out of the seat to test each change till it looks the way you want.

Racer P.
_____________________
"What's important in life is not how many breaths we get to take but those moments that take our breath away." -- Jaques Cousteau

"A thin line separated serious homicidal purpose from buffoonery." -- Dean Koontz

"CanYouFixTheSpaceBarOnMyKeyboard?" -- Email to Helpdesk
Chris Wilde
Custom User Title
Join date: 21 Jul 2004
Posts: 768
04-22-2005 19:54
Hmm everytime I cross a sim boarder all the people on board sit instead of remaining standing. Im using the boat script from the inflatable boat.
Chris Wilde
Custom User Title
Join date: 21 Jul 2004
Posts: 768
04-23-2005 06:13
Here's a sample script Im using for a passenger to stand (sit). Whenever I cross a sim boarder they sit instead of remaining standing.
CODE
string anim = "stand"; 
vector sit_pos = <-0.5,0,.3>;
vector sit_rot = <0,0,90>;
integer perms = PERMISSION_TRIGGER_ANIMATION;

key user;

default
{
state_entry()
{
llSitTarget(sit_pos, llEuler2Rot(sit_rot * DEG_TO_RAD));
}
changed(integer change)
{
if (change & CHANGED_LINK)
{
llSleep(0.01);//i'm not sure if a sleep is actualy needed. but i'll leave it
key sit = llAvatarOnSitTarget();
integer u = ((llGetAgentSize(user) != ZERO_VECTOR) && (llGetPermissions() & perms) == perms);
if(sit == NULL_KEY)
{
user = NULL_KEY;
if(u)
llStopAnimation(anim);
}
else if(!u)
llRequestPermissions(sit, perms);
}
}
run_time_permissions(integer perm)
{
key sit = llAvatarOnSitTarget();
if((perm&perms) != perms || llGetAgentSize(sit) == ZERO_VECTOR || sit!=llGetPermissionsKey())
{
user = NULL_KEY;
return;
}
user = sit;
llStopAnimation("sit");
llStartAnimation(anim);
}
}
Chris Wilde
Custom User Title
Join date: 21 Jul 2004
Posts: 768
04-27-2005 12:55
From: Chris Wilde
Hmm everytime I cross a sim boarder all the people on board sit instead of remaining standing. Im using the boat script from the inflatable boat.

Ok, I found out more on this. I thought it was simply a case of my newbie LSL skills:
/invalid_link.html