Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How-to on a "seat" script

robertltux McCallen
Registered User
Join date: 17 Nov 2007
Posts: 50
10-19-2008 11:09
I have (i think its a library item) a red airplane chair that uses a rather nifty script to do 2 things

1 make the prim its in a seat
2 convert the prim its in into a red airplane chair

if you rez a standard plywood cube and then drop the script in "poof" you have a chair

Now the real question how does this work (ive figured out some of the texture stuff)?
or how would i go from a by hand rezed prim to a script built one??
full text of the script follows next line-----------
default
{
state_entry()
{
llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_SPHERE, PRIM_HOLE_CIRCLE, <0.65, 0.85, 0.0>, 0.90, <0.0, 0.0, 0.0>, <0.35, 0.90, 0.0>,
PRIM_TEXTURE, 0, "9ee69ec2-5466-41a1-f7ae-e46f2570de54", <-1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, 0.0439,
PRIM_TEXTURE, 1, "97e08b78-1065-ee18-1fa5-0cce17da2c66", <2.0, 2.0, 0.0>, <0.50, 0.70, 0>, -1.570840,
PRIM_TEXTURE, 2, "bac319a6-33ea-4ebe-e529-8da8dfd7f1a9", <2.0, 4.0, 0.0>, <0.0, 0.0, 0.0>, -3.1415972,
PRIM_TEXTURE, 3, "9ee69ec2-5466-41a1-f7ae-e46f2570de54", <1.0, 1.0, 0.0>, <0,0,0>, -0.0439,
PRIM_TEXTURE, 4, "fdc9f370-b1c5-4739-bfe4-e51a87baddc5", <1.0, 42.0, 0.0>, <0,0,0>, 0.0,
PRIM_TEXTURE, 5, "fdc9f370-b1c5-4739-bfe4-e51a87baddc5", <1.0, 18.0, 0.0>, <0,0,0>, 0.0] );
llSetScale(< 1.400, 1.310, 2.250>;);
llSetColor(<.34510, .34510, .34510>, ALL_SIDES);
llSetColor(<1,1,1>,0);
llSetColor(<1,1,1>,2);
llSetColor(<1,1,1>,3);
llSetColor(<1,1,1>,4);
llSetColor(<1,1,1>,5);
llSetSitText("Pilot";);
llSitTarget(<0.0,0.0,-0.6>, <0,-0.2,0,1>;);
llSetCameraEyeOffset(<-5.0, 0.0, 1.0>;);
llSetCameraAtOffset(<0.0, 0.0, 1.0>;);
//llSetObjectName("Airplane Seat";);
//llSetObjectDesc("By; Mark Coffee";);
}
changed(integer change)
{
if (CHANGED_LINK)
{
key agent = llAvatarOnSitTarget();
if (agent)
{
}
else
{
llUnSit(agent);
}
}

}
}
-------end script
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
10-19-2008 12:25
it's basically doing all the cutting, texturing and coloring all at once rather than having to do each step manually. the script doesn't do anything you can't do without it. not sure what it's doing in the changed event about unsitting the avatar since that would only be triggered if they stood up themselves
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
robertltux McCallen
Registered User
Join date: 17 Nov 2007
Posts: 50
10-19-2008 21:55
yes i know thats what its doing (and the whole point of the script)

but
how does a hand rezzed object map over to a script built one (which number goes where??)
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
10-19-2008 22:22
ah ok, i think i see what you mean. well i could explain it for this particular script, but it won't be the same for all scripts using this function as llSetPrimitiveParams has alot of different functions

_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
robertltux McCallen
Registered User
Join date: 17 Nov 2007
Posts: 50
10-19-2008 22:40
could you im me sometime in world (or pop by south heron)?

i think i have a decent grasp of whats going on but i may need some further script advise.
(note the prims with the script are scattered about the fishing pond)