DanielWolfsong Posted December 31, 2013 Share Posted December 31, 2013 Hi - this is a compound script issue - hope you can help. I have a chair with a standard "sit" script. Once the avatar is seated they click on a stack of books to be given a book. When they wear the book it plays a seated book reading animation. The script that triggers this is called "Play Animation on Equip" but it has no way to STOP the animation when the av chooses to "stand" - I know enough about scritpting to get myself in trouble but have not been able to add the correct code to do this - STOP THE ANIMATION ON STAND COMMAND.Sure would appreciate some help. Here is the script: //Play Animation on Equip Script// drop the script and an animation into the object you want to play the animation. Wear the object and the animation plays. Add the animations name to the script default { state_entry() { llRequestPermissions(llGetOwner(),PERMISSION_TRIGGER_ANIMATION); } run_time_permissions(integer parm) { if(parm == PERMISSION_TRIGGER_ANIMATION) { llStartAnimation("LP_Reading-v1.2"); // put animation name here } } on_rez(integer st) { llResetScript(); } attach(key id) { llStopAnimation("LP_Reading-v1.2"); // put animation name here } } Thanks for any help you can offer!Daniel Link to comment Share on other sites More sharing options...
Ela Talaj Posted December 31, 2013 Share Posted December 31, 2013 Firstly, on_rez event always runs before attach event, as you reset the script on rez, your attach event code never executes. Secondly, stopping animation on detaching an object should check if the id is NULL_KEY, that's what signifies detaching. Link to comment Share on other sites More sharing options...
Ron Khondji Posted December 31, 2013 Share Posted December 31, 2013 You could maybe add a timer and use llGetAgentInfo() to check if the avatar is still sitting. Link to comment Share on other sites More sharing options...
DanielWolfsong Posted December 31, 2013 Author Share Posted December 31, 2013 Thanks all for your responses. I think I'm on my way to fixing this - we shall see. -Daniel Link to comment Share on other sites More sharing options...
Sassy Romano Posted January 1, 2014 Share Posted January 1, 2014 If both chair and book are your product, rather than constantly polling for animation state, why not just have the chair sit script check for CHANGED_LINK in the change event? It will trigger a change when the avatar stands and then you can stop the animation from there. You can stop an animation regardless of whether it's actually running without an error. Alternatively, you could send a message to the script in the book and have it take appropriate action, if there's other stuff to be done there. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now