dd Temin Posted November 21, 2014 Share Posted November 21, 2014 HI,Anyone know a good script method to go directly to the desired animation WITHOUT first seeing the normal sit animation.The object that I left click on to "sit" has the obect parameter set to "sit" when touched.I am doing a change event (change & changed_link) as a trigger to request permission trigger AnimationAnd runtime permissions event to start animation("my_animation").This all works BUT I see the avatar momentarily "sitting" before begining "my_animation".How can "sit" on that object........but immediately see ONLY my_animation?i guess another way to ask this is....is there a way to CHANGE the default sit animation? thanks..... dd Link to comment Share on other sites More sharing options...
Innula Zenovka Posted November 21, 2014 Share Posted November 21, 2014 If it's just you, then llSetAnimationOverride should do it. If you mean you want to change it for everyone, I think you're out of luck. However, I also think -- though I'm open to correction -- that what you're seeing is a problem local to you, caused by a slow connection or machine. Animations are played client-side, and the reason you're seeing the delay, I think, is that it's taking too long for details of the new animation to reach your machine. Or it could be simply that your animation has too long a lead-in. It's not a problem I've ever encountered, I think, and I do a lot of scripting for one particular animator. Are you starting the new animation before or after you stop the default one? Try switching the order round, and see if that helps. Link to comment Share on other sites More sharing options...
Profaitchikenz Haiku Posted November 21, 2014 Share Posted November 21, 2014 I declare two globals string lastAnim="sit";string anim = "my_animation"; in the run_time_permissions event, after ensuring permissions have been granted llStopAnimation(lastAnim);lastAnim=anim;llStartAnimation(lastAnim); and in the changed event part, after having determined it was CHANGED_LINK, key avatar = llAvatarOnSitTarget();if( avatar != NULL_KEY){ // get permissions for anim and start it}else{ llStopAnimation(lastAnim); lastAnim = "sit";} In the scripts I try to ensure that these segments get actioned as soon as possible inside the events, shuffling other bits of code around so that todying up or setting up takes place after the animations have been started or stopped. Link to comment Share on other sites More sharing options...
Nova Convair Posted November 21, 2014 Share Posted November 21, 2014 If you sit on a scripted object 2 things happen - the server sends the animation to every avatar in the vicinity - your viewer receives the animation and starts playing it If you have a slow connection and/or a slow computer that may take a while. For me the delay is only a fraction of a second. Way too short to go into the standard sit animation. Link to comment Share on other sites More sharing options...
Qie Niangao Posted November 21, 2014 Share Posted November 21, 2014 Maybe post your script or tell us a little more about what you're seeing. As others have said, under normal circumstances, tiny animation assets download so blindingly fast that something would have to be very wrong for the default sit to really appear before the scripted one. If, however, your scripted animation is really just to offset the avatar, I think you *will* always see that offset being made from the sit target location. That is, AFAIK, you can't quite instantly appear at the animation-offset location when the sit is initiated from some distance, but rather you'll instantly pop to the sit target and then very quickly offset as the animation specifies. (But I have no idea if that's what you're trying.) Link to comment Share on other sites More sharing options...
dd Temin Posted November 21, 2014 Author Share Posted November 21, 2014 Hi everyone Thank for all your good ideas. (My PC and connection are fast) I found the solution after trying some of your great suggestions. I'll show the parts of the script both before and after the "fix". Before: changed(integer change) { if (change & CHANGED_LINK) { av = llAvatarOnSitTarget(); if (av) { llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TRIGGER_ANIMATION); listener=llListen(com_channel,"","",""); llDialog(av,"HyperTransport",buttons, com_channel); } else { llListenRemove(listener); } } run_time_permissions(integer perm) { llStopAnimation("sit"); llStartAnimation ("stand");//("Standing arms crossed breathing"); } After fix: changed(integer change) { if (change & CHANGED_LINK) { av = llAvatarOnSitTarget(); if (av) { llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TRIGGER_ANIMATION); } else { llListenRemove(listener); } } run_time_permissions(integer perm) { llStopAnimation("sit"); llStartAnimation ("stand");//("Standing arms crossed breathing"); listener=llListen(com_channel,"","",""); llDialog(av,"HyperTransport",buttons, com_channel); } apparently...even though these 2 code lines were after the Permissions Request it finished excuting the following 2 lines first before the permissions event. listener=llListen(com_channel,"","",""); llDialog(av,"HyperTransport",buttons, com_channel); Anyway thanks everyone for all your help Link to comment Share on other sites More sharing options...
Fenix Eldritch Posted November 21, 2014 Share Posted November 21, 2014 llAvatarOnSitTarget() returns the key of the detected avatar, and since you have already stored it in the av variable, you can further tighten up your code by using: llRequestPermissions(av, PERMISSION_TRIGGER_ANIMATION); instead of calling llAvatarOnSitTarget() a second time. Link to comment Share on other sites More sharing options...
Innula Zenovka Posted November 21, 2014 Share Posted November 21, 2014 Thanks for explaining the fix you found. I'm open to correction here, but I think that everything inside a { pair of curled brackets } (a "scope," as it is called) executes as a unit, which would be why the listener and the dialog opened before the permission event fired. Certainly I was always told to make sure that anything I wanted to happen after I call llRequestPermissions happens in the run_time_permissions event (which is the logical place for it, if you think about it). Link to comment Share on other sites More sharing options...
dd Temin Posted November 22, 2014 Author Share Posted November 22, 2014 Hi Innula, Yes i am sure you are correct. lesson learned for me. Thanks dd Link to comment Share on other sites More sharing options...
dd Temin Posted November 22, 2014 Author Share Posted November 22, 2014 Thanks Fenix for that observation.....I'll test it soon . dd Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now