Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Looking for a camp chair script with full rights

Corbin May
Heart's Desire Owner
Join date: 25 Oct 2006
Posts: 20
11-11-2006 00:54
I need a Camp chair script that calls an animation, I need it to be commented on since i am just starting to learn scripting. If anyone can help, I thank you in advance.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
11-11-2006 02:31
From: Corbin May
I need a Camp chair script that calls an animation, I need it to be commented on since i am just starting to learn scripting. If anyone can help, I thank you in advance.



Not sure if it is exatly what you want but look here
Corbin May
Heart's Desire Owner
Join date: 25 Oct 2006
Posts: 20
11-11-2006 09:10
That is almost what I need, but I don't see where it is calling for a custom sit animation. It could just be my lack of sleep, but for the life of me I cant find it. If someone can add that to that script I would be greatfull.
Jodina Patton
Registered User
Join date: 19 Nov 2005
Posts: 170
11-11-2006 12:00
I don't think it requires a custom sit animation. Put your custom animation in your chair and also put this in the chair and I think it would work. At least the script I use to use worked that way.

Maybe you are talking about something different...
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
11-11-2006 12:37
Adding a custom sit script wouldnt be that difficult, at least in theory.
Try adding this script to the chair as well, if it works them merge the two together.

CODE

key avatar = NULL_KEY; // ID of person sitting on us
vector pos = <-0.25,0,0.2>; //adjust the position to fit object -must be
//nonzero in at least one direction or script will not work!
rotation rot = <0,0,0,1>; //adjust rotation (1 in any vector gives 90 deg)

string animation;

default
{
on_rez(integer num) { llResetScript(); }

state_entry()
{
animation = llGetInventoryName(INVENTORY_ANIMATION,0);
llSitTarget(pos, rot);
}
changed(integer change)
{
avatar = llAvatarOnSitTarget();
if(change & CHANGED_LINK)
{
if(avatar == NULL_KEY)
{
// You have gotten off

llStopAnimation(animation);
llReleaseControls();

}
else if(avatar == llAvatarOnSitTarget())
{
// You have gotten on
llRequestPermissions(avatar,PERMISSION_TRIGGER_ANIMATION );
}
}
}

run_time_permissions(integer perms)
{
if(perms)
{
llStopAnimation("sit");
llStartAnimation(animation);
}
else
{
llUnSit(avatar);
llResetScript();
}
}
}