|
Glanecia Varriale
Registered User
Join date: 4 Feb 2008
Posts: 12
|
06-22-2008 20:42
I've made some furniture, and I've got some sitting animations -- but how can I get them to work with my furniture? (I'm a total newbie to LSL, but I'm fairly sure I could learn.) There must be a script out there that loads of people use. I've tried taking the scripts from posables, but of course, all that makes the furniture disappear when you sit on it. Any help would be appreciated. Thanks!
|
|
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
|
06-22-2008 21:12
check on wiki.secondlife.com the searches changed and llSitTarget is the best start here is a simple (my kind of simple) script for sit possition on objects //Offset Position //ex: < 0.0 , 0.0 , 1.0 > = 1 meter above the object (z axis)
vector offset = < 0.0, -0.3 , 0.4>;
//Degrees Rotation //ex: < 0 , 0 , 45 > = +45 degrees on the z axis
vector deg = < 0 , 0 , 270 >;
//Pie Option Text string text = "Sit";
default { state_entry() { llSetSitText(text); deg *= DEG_TO_RAD; //convert to radians rotation quat = llEuler2Rot( deg ); //convert to quaternion llSitTarget(offset, quat); } }
|
|
Glanecia Varriale
Registered User
Join date: 4 Feb 2008
Posts: 12
|
06-22-2008 21:15
Thanks, I'll start working with that.... 
|
|
Glanecia Varriale
Registered User
Join date: 4 Feb 2008
Posts: 12
|
06-22-2008 21:23
Another newbie question, how would I take an animation, and make it work with a script?
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
06-22-2008 23:09
This script should about do it for animating. You have to change the sit position, sit rotation, and animation name at the top of the script (make sure the animation is in the prim's inventory if it isn't one of the standard built-in ones; leave it empty if you want the default "sit" animation to play automatically). NOTE: This version of the script has not yet been compiled; some minor syntax fixes might be necessary. If you run into any problems and aren't able to figure out how to fix them yourself (it'd probably be a good exercise anyway), post them here. vector SIT_POS = <0.0, 0.0, 0.4>; rotation SIT_ROT = ZERO_ROTATION; string ANIMATION = "";
key sitter = NULL_KEY;
unanimate(key avatar) { if (ANIMATION == "" || !(llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) || llGetPermissionsKey() != avatar) { return; }
llStopAnimation(ANIMATION); llStartAnimation("stand"); }
animate(key avatar) { if (ANIMATION == "") { return; } if ((llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) && llGetPermissionsKey() == avatar) { llStopAnimation("sit"); llStartAnimation(ANIMATION); } else { llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION); } }
default { state_entry() { llSitTarget(SIT_POS, SIT_ROT);
sitter = llAvatarOnSitTarget(); if (sitter != NULL_KEY) { animate(sitter); } }
changed(integer changes) { if (changes & CHANGED_LINK) { key newSitter = llAvatarOnSitTarget(); if (newSitter == sitter) { return; }
unanimate(sitter); sitter = newSitter; animate(sitter); } }
run_time_permissions(integer perms) { if (perms & PERMISSION_TRIGGER_ANIMATION) { animate(sitter); } } }
|