Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Vehicle Unseating Problem

Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
08-08-2006 16:19
I've built a shuttle that has a hatch on the back that opens and closes that I want to make the pilot have to walk out of when they stand up from the vehicle.

The problem is, I can't get them to not launch out of the ship when they stand up.

I've used llPushObject to push them down and back, and this works....only if the ship is facing East.

The exact command I'm using is:

llPushObject(agentKey, <-200,0,-100>, ZERO_VECTOR, TRUE);


Now, from what I understand, the boollean is supposed to make the push relative to the rotation of the key if it is true. However, I get pushed the same direction no matter which way the ship and I are facing...it always pushes me down and due west.

Now if I'm facing East, this lands me exactly where I want to be 80% of the time (the other 20 it rockets me out the back of the ship...yay for unpredictable commands)

Is the local boollean broken in this command?
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
08-08-2006 20:22
I had the same problem for chairs on the edge of a sky platform (without any kind of pushing). I finally had to put invisible walls up to keep the avatar from falling off, even though it was sitting on the very inside edge of the seat.

I think the only advice I can give you is to make sure there is plenty of space around the seat so the engine doesn't think the avatar is intersecting anything when it stands up. I'd say make the seat phantom too, but that doesn't work very well in a vehicle, does it? :mad: (Unless, that is, you want to unlink it, make it phantom and/or delete it, then re-rez a new seat on demand. :rolleyes: )
Areth Gall
Registered User
Join date: 9 Jan 2006
Posts: 40
08-09-2006 15:50
You need to calculate in the object rotation and multiply the vector by it. That should allow you to correspond the push to whatever angle you are at. But considering I don't know what the angle is when you are facing east, I can't tell you the corrective measurements you would have to create.

Put simply, you need to first, figure out the angle offset from the <0,0,0> rotation that the east faces, and then multiply that by the rotation of the object, times your push force vector.
April Heaney
The Evolution of Pants
Join date: 31 Dec 2005
Posts: 22
08-09-2006 16:03
OK, since this works when rotation is zero:
llPushObject(agentKey, <-200,0,-100>, ZERO_VECTOR, TRUE);

To make that vector always relative to the positive X axis:
vector push = llRot2Fwd(llGetRot()) * <-200,0,-100>;
llPushObject(agentKey, push, ZERO_VECTOR, FALSE);

That should do the trick. :)

-AH-
_____________________
Occam's Eraser: The philosophical principle that even the simplest solution is bound to have something wrong with it.
Burke Prefect
Cafe Owner, Superhero
Join date: 29 Oct 2004
Posts: 2,785
08-10-2006 14:15
I had the same issue too. I had the pilot stuck pretty far forward into the cockpit so he could get a good view, and when he stood, he was ejected.
So I use a custom animation w/ the actual sittarget prim a little back from the 'seat' prim. I also have it rigged to move the seat out of the way of the av so he has room to stand.
It's not 100% perfect, but what in SL is?
_____________________
Angela Salome
Registered User
Join date: 6 Oct 2005
Posts: 224
08-10-2006 16:56
Consider turning the vehicle phantom after unsitting for a while.
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
08-10-2006 19:05
From: Angela Salome
Consider turning the vehicle phantom after unsitting for a while.

And have the avatar fall through the bottom of it? That's not much of an option in some cases. Flying and floating vehicles (if we're going to make a distinction between the two ;-) ) especially.