|
Chrischun Fassbinder
k-rad!
Join date: 19 Feb 2005
Posts: 154
|
07-14-2006 13:11
I have a script I've used for months now in various furniture for handling what animation to play on sit. Lately I've noticed this script isn't always overriding the default sit pose when used. Instead the default sit pose is just used. When this happens, not every time but about a third the error message "Object: llStartAnimation: Script trying to trigger animations but agent not found" is returned on sit and "llStopAnimation: Unable to find agent, releasing animation permissions" on standing up. Can anyone please fill me in with what has changed to cause this behavior? Used script follows... string gAnimName = "sleep";
string gName = "config"; integer gLine = 0; key gQueryID;
vector sitparams = <0.0,0.0,0.65>;
default { state_entry() { llSitTarget(<0,0,0.65>, ZERO_ROTATION); gQueryID = llGetNotecardLine(gName, gLine); } on_rez(integer param) { llResetScript(); } dataserver(key query_id, string data) { if (query_id == gQueryID) { sitparams = (vector)data; llSitTarget(sitparams,ZERO_ROTATION); } } changed(integer change) { integer perm = llGetPermissions(); if(change & CHANGED_LINK) { key sittingavatar = llAvatarOnSitTarget(); if(llAvatarOnSitTarget() != NULL_KEY) { if (! (perm & PERMISSION_TRIGGER_ANIMATION)) { llRequestPermissions(sittingavatar, PERMISSION_TRIGGER_ANIMATION); } else { llStartAnimation(gAnimName); } } else { if (perm & PERMISSION_TRIGGER_ANIMATION) { llStopAnimation(gAnimName); } } } else if(change & CHANGED_INVENTORY) { gQueryID = llGetNotecardLine(gName, gLine); llOwnerSay("Updating with current note configuration."); } } }
|
|
Weedy Herbst
Too many parameters
Join date: 5 Aug 2004
Posts: 2,255
|
07-14-2006 14:51
Seems to be caused by lag from the dataserver query. It may not always be collecting the vector data and goes to the "else"
Without having tested the script myself, I suggest a couple workarounds.
Move:
on_rez(integer param) { llResetScript(); }
To the end of the script (as opposed to prior to the query)
Also you could try to add a llSleep() for a second or so to allow the query to run.
Have you tried hardcoding the vector in to the script as a test measure? If you were to // the dataserver and try a vector without the data query and the problem goes away, you will know the cause.
|
|
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
|
07-14-2006 15:30
From: Chrischun Fassbinder if(llAvatarOnSitTarget() != NULL_KEY) { if (! (perm & PERMISSION_TRIGGER_ANIMATION)) { llRequestPermissions(sittingavatar, PERMISSION_TRIGGER_ANIMATION); } else { llStartAnimation(gAnimName); }
When the avatar sits on your item, it's most likely your script won't have permissions to animate them (unless maybe they happen to be last person sitting on that item before) So your script performs llRequestPermissions() call but never actually reacts when this permission is granted... which leaves the avatar on your item with the default sit animation or whatever their AO will play instead. to fix it, add permission event handler to your code: run_time_permissions( integer Permissions ) { if( Permissions & PERMISSION_TRIGGER_ANIMATION ) { llStartAnimation(gAnimName); } else { llUnSit( llAvatarOnSitTarget() ); } }
would be more elegant to first stop whatever animation is being played ... but this may do ^^; edit: also, the error you receive is caused by your script still remembering permission to animate last avatar that was sitting on them, and trying to animate _that_ avatar even though it can be long gone from the sim or even offline. To be safe, just request permission to animate each time someone sits on your item: changed(integer change) {
if(change & CHANGED_LINK) {
key sittingavatar = llAvatarOnSitTarget(); if( sittingavatar != NULL_KEY) { llRequestPermissions(sittingavatar, PERMISSION_TRIGGER_ANIMATION); } else { if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) { llStopAnimation(gAnimName); } } } // etc.
|
|
Draco18s Majestic
Registered User
Join date: 19 Sep 2005
Posts: 2,744
|
07-14-2006 16:55
From: Joannah Cramer So your script performs llRequestPermissions() call but never actually reacts when this permission is granted... I've seen this a lot, various permissions, various objects. One was a communist tip ball that came with instructions (ok, not bad) and the first one was, "Make sure you say "yes" when it asks you permission to debit!" Wait, what? Why? Because the script didn't check run time permissions and cause a fail if the permission wasn't granted.
|
|
Fox Absolute
Registered User
Join date: 30 May 2005
Posts: 75
|
07-14-2006 16:57
I have seen this, and it seems often to be caused by people teleporting or logging off while sitting on a poseball. I would guess that since the user technically never stands before disappearing, the script goes out of whack with the permissions and will continue to give errors like that until you reset the script.
|
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
07-14-2006 19:18
From: Fox Absolute I have seen this, and it seems often to be caused by people teleporting or logging off while sitting on a poseball. I would guess that since the user technically never stands before disappearing, the script goes out of whack with the permissions and will continue to give errors like that until you reset the script. Hmm.. technically this should never happen. When someone teleports it should be reported to the script just as if the av stood up. If you see this again, and are certain that changed event not triggering is the problem, bugreport it. ==Chris
|