Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

inherrent vehicle "sit" position.

LeVey Palou
Registered User
Join date: 31 Aug 2006
Posts: 131
10-17-2007 20:32
Hi all

working with cory lindens car script. This is the first real attempt to re write a script and have delved deep into the lsl portal to understand vehicle physics.

This project has gone extremely well for once very lil fustration working with LL scripts and dare say i am understanding what I am doing, so far.

But a matter of posing the driver. in this script the driver inherrently assumes the same pose as when you sit on a cube...as if you were on a chair with legs bent at 90's at the knee. I declare my unsit and sit poses as a custom pose i made in qavimator and imported with high priority overide (#4). the top half of my avatar assumes the new pose but my legs remain in that bent at the knee position.

***this happens on any pose i declare and add to the vehicle.***

My passenger assumes her pose that i declared for her, but the driver wont fully assume his new pose.

I have seen this same basic sit posture in say...basic boat scripts and a few others. So I am assuming this is the default for vehicles.

My question is: How do I override this feature as is done in other persons vehicles that i use and see?

FYI: If this involves some new scripting I will need some one will to explain a bit as I really wish to learn this aspect of vehicle scripting (*coughs* jesse barnett *coughs*)
and need a bit of mentoring...the vehicle script is basic and doesnt ask for any kind of perms for control of av. I am think issue is in this somehow....but i am guessing?

This has been a fun project and very rewarding but my feet are sticking out bottom of car like fred flintstone...lol.

Thanks to everyone!
Taeas Stirling
Registered User
Join date: 4 Sep 2004
Posts: 74
10-17-2007 21:32
llStopAnimation("sit";);
llStartAnimation("motorcycle_sit";);

replace the motorcycle _sit with the exact name of your anim
LeVey Palou
Registered User
Join date: 31 Aug 2006
Posts: 131
10-17-2007 23:20
hi Taeas,

The script has those statements already which is why i am having trouble understanding the problem i am having. Even with those declarations there seems to be an undeclared cause forcing my avatar to sit in a way that is not set by either the script nor the animation the script points to.

I can post the script if anyone feels that helps so you can see what is called and what isnt.

Thanks
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
10-18-2007 03:07
could it be an AO that's not turned off? or maybe a matter of the anim you are playing not having a high enough priority?
LeVey Palou
Registered User
Join date: 31 Aug 2006
Posts: 131
10-18-2007 09:10
hi thanks for the post.

I do not wear an AO system and the priority on my animation is set to 4.

yeh I am baffled as well, smiles.
Etheria Parrott
Registered User
Join date: 13 Sep 2006
Posts: 2
10-19-2007 05:40
Did you check that both hips and knees have some rotation value in Qavimator?
Day Oh
Registered User
Join date: 3 Feb 2007
Posts: 1,257
10-19-2007 05:49
From: LeVey Palou
the vehicle script is basic and doesnt ask for any kind of perms for control of av. I am think issue is in this somehow....but i am guessing?


In that case, the key things to check on:

At some point, the object needs to be given a SitTarget
From: someone
state_entry()
{
llSitTarget(<0.0, 0.0, 0.01>, ZERO_ROTATION>;);
}


Permissions are requested when an avatar sits
From: someone
changed(integer change)
{
if(change & CHANGED_LINK)
{
key avatar = llGetAvatarOnSitTarget();
if(avatar != NULL_KEY)
{
llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION);
}
}
}


and the desired animation is played when permission is granted
From: someone
run_time_permissions(integer perm)
{
if(perm & PERMISSION_TRIGGER_ANIMATION)
{
llStopAnimation("sit";);
llStartAnimation("motorcycle_sit";);
}
}
_____________________
LeVey Palou
Registered User
Join date: 31 Aug 2006
Posts: 131
10-19-2007 07:44
Genius! the second part is what it was lacking where it asks for permmission. My feet are now in the car where they belong!

Hey a big thanks to everyone who posted here you taking the time out to help means a lot!

woo-hoo!
Pazzo Pestana
Registered User
Join date: 17 Sep 2006
Posts: 39
I thought I had the answer ...
01-23-2010 19:39
llGetAvatarOnSitTarget doesn't seem to be valid anymore ... rather, llAvatarOnSitTarget appears to be used. Are there any other changes that will make this work for the Simple Boat Script V1.0?

changed(integer change)
{
if (change & CHANGED_LINK)
{
key agent = llAvatarOnSitTarget();
if (agent)
{
if (agent != llGetOwner())
{
llSay(0, "You aren't the owner";);
llUnSit(agent);
llPushObject(agent, <0,0,100>, ZERO_VECTOR, FALSE);
}
else
{
// You sit and are owner so get controls
llSetStatus(STATUS_PHYSICS, TRUE);
llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z, TRUE);
llRequestPermissions(agent,PERMISSION_TAKE_CONTROLS);
}
}
else
{
// You stand so boat stops
llMessageLinked(LINK_ALL_CHILDREN, 0, "stop", NULL_KEY);
llSetStatus(STATUS_PHYSICS, FALSE);
llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y | STATUS_ROTATE_Z, FALSE);
llReleaseControls();
llStopSound();
llSetTimerEvent(0.0);
}
}

}