Jump to content

Animation permission not being recognized by script


iamyourneighbour
 Share

You are about to reply to a thread that has been inactive for 1748 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hi all :matte-motes-big-grin-wink:

I made a HUD attacher that throws a temporary script to the person who clicks on the attacher, and inside the HUD there's an animation which will be played.

Upon clicking the object the system requests permission to attach and trigger animation, the HUD will attach without fault on acceptance however the animation permission is not recognized by the script and produces error "
: Script trying to trigger animations but PERMISSION_TRIGGER_ANIMATION permission not set"

The error applies to non owner of the object only, so I am guessing the permission is requested 'before' the transferral of ownership, how do I make a separate permission request for the animation to be played on attaching to the user?

Tried request for animation permission on CHANGED_OWNER didn't seem to work. Any ideas :/?

 

listen(integer channel, string name, key id, string msg)
{

if (channel == -2500)
{
user = msg;
llRequestPermissions(user, PERMISSION_ATTACH | PERMISSION_TRIGGER_ANIMATION);
}
}
run_time_permissions( integer vBitPermissions )
{
if( vBitPermissions & PERMISSION_ATTACH )//| PERMISSION_TRIGGER_ANIMATION
{
llAttachToAvatarTemp( ATTACH_HUD_CENTER_2 );
llSetPrimitiveParams([PRIM_TEMP_ON_REZ,0]);
name = llGetDisplayName(user);
llSay(0,name+" is feeling drowsy and confused...");
remove_listen_handles();

}
else
{
llDie();
}

if (vBitPermissions & PERMISSION_TRIGGER_ANIMATION)
{
llSleep(0.5);
llStartAnimation("sit");
}
}

Link to comment
Share on other sites

I assume you mean you rez a hud. The owner of the hud is the owner of the rezzer. (keep that in mind)

Visitor gives permission and hud attaches.

The visitor is the owner of the hud now. All previous given permissions are reset.

The animation can'r work of course. No permission.

Read the description of llAttachToAvatarTemp - there are examples.

http://wiki.secondlife.com/wiki/LlAttachToAvatarTemp

Link to comment
Share on other sites

As Nova rightly says, all permissions are over-written when the item is attached to someone other than the owner of the rezzer.

I wouid ask for PERMISSION_TRIGGER_ANIMATIONS in the attach event:

	attach(key id)	{		if(id) // If I have just attached to someone		{			llRequestPermissions(id,PERMISSION_TRIGGER_ANIMATION);		}	}

Be aware that, when you come to detach the item, you will need to ask for PERMISSION_ATTACH again and work out a way for the script to know, in the run_time_permissions event, when it's supposed to attach the HUD and when it's supposed to detach it.

There's no point in turning off TEMP_ON_REZ when you attach the item, by the way.   A temp-rez item won't be deleted while it's attached to you, and since the item is using llAttachToAvatarTemp it's going to die as soon as it's detached anyway.

 It does no harm to turn it off, but it's not necessary.

 

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

Hi everyone, I need some help and first let me say I am sorry, I am a NOOB and have not clue what I am doing or how to make this stop and need some help.  First let me explain,  I purchased a new Bento Head by  Lelutka, so got that all put on no problems at all.  I then purchased this bubble gum . !B! Bubble Gum for LeLutka, I did hit accept when I purchased it and tried to open it. I added the item next thing you kow I keep getting these Scripts Warning Error/Debug and it says !B! Bubble Gum.  ton's of scrips over and over. I have deleted head everything including the product (gum)  The owner of the item refused to help me told me it was my problem etc.  Any ideas how I can get this scrips error to stop or go away.  I don't have the item anymore and I can't get it redelivred because I purchased it  from marketplace.  I have tried everything taken thing off all jewelry everything.  Please help if you can by telling step by step how I may get rid of this.  You guys are my last try/resort, I hate to do this to you. Thanks in advance 

 

Link to comment
Share on other sites

43 minutes ago, ReecePie said:

Hi everyone, I need some help and first let me say I am sorry, I am a NOOB and have not clue what I am doing or how to make this stop and need some help.  First let me explain,  I purchased a new Bento Head by  Lelutka, so got that all put on no problems at all.  I then purchased this bubble gum . !B! Bubble Gum for LeLutka, I did hit accept when I purchased it and tried to open it. I added the item next thing you kow I keep getting these Scripts Warning Error/Debug and it says !B! Bubble Gum.  ton's of scrips over and over. I have deleted head everything including the product (gum)  The owner of the item refused to help me told me it was my problem etc.  Any ideas how I can get this scrips error to stop or go away.  I don't have the item anymore and I can't get it redelivred because I purchased it  from marketplace.  I have tried everything taken thing off all jewelry everything.  Please help if you can by telling step by step how I may get rid of this.  You guys are my last try/resort, I hate to do this to you. Thanks in advance 

 

I can see a review you left on the product on the marketplace.  I can see where the creator has replied trying to sort it out.  Did you do what she asked and send a printout of the messages you are getting?  

Link to comment
Share on other sites

It'a  little late now to point out the obvious, but I'm sure that you understand by now that there was no reason to delete the head.  All you had to do was detach it, so that it goes back to your inventory.  That's an expensive item to replace.

Now ... what's sending you the error messages?  The message window will tell you that.  From what you wrote, it sounds like the bubble gum.  If so, it sounds like you didn't detach it. Open the WORN tab in your inventory to find it (or just look for it by name).  Then right click the name in inventory and detach it.  If you really want to get rid of it, don't just delete it from your outfit.  That's simply a pointer to the actual item.  Delete the item itself. That ought to solve your problem.  If it doesn't, the only remaining possibility is that you are not wearing it at all.  You dropped the thing and it is somewhere nearby, complaining that it can't find you. It's probably small and transparent, so highlight transparent objects (CTRL + Alt + T) and start using your camera to find it.  The script error window will tell you exactly where to look.

For future reference, this is not the right place to ask a question like this.  The LSL Scripting forum is for scripters who are writing their own scripts and want to share ideas (or tears). Your question should have been posted in the Answers forum.

 

Link to comment
Share on other sites

@Rolig Loon  The product seems to be a bubblegum colour lipgloss applier for the head rather than a bubblegum for blowing.  I wonder if  Reecepie has misunderstood and tried to unpack an applier or something and this has caused the issue,  The creator has twice responded to her  MP review on  the 14th 

Link to comment
Share on other sites

I suppose that's possible.  In that case, I suspect that she really did drop the thing on the floor somewhere.  It's whining about Attach perms because it was never attached and can't find anyone to attach to.  It should be a simple matter to locate it and take it back to inventory.

Link to comment
Share on other sites

As a general note, I would recommend that people writing scripts which are supposed to request animation permissions when attached always check that the item is, in fact, attached before it requests any permissions and also checks it has the necessary permissions before actually doing anything that requires them. 

So something like this:

string  strAnim;

default {
	state_entry() {
		//do stuff
		strAnim = llGetInventoryName(INVENTORY_ANIMATION,0);//get the name of the first animation in my inventory
		if(llGetInventoryType(strAnim)== INVENTORY_ANIMATION){//if the name is that of an animation (i.e. there is an animation in my inventory to play)
			if(llGetAttached()){ //if llGetAttached returns a non-zero integer, it means I'm attached to my owner,so
				llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
			}
		}
	}

	changed(integer change){
		if(change & CHANGED_INVENTORY){//reset the script if the inventory changes, to check on what, if anything the animation is
			llResetScript();
		}
	}


	attach(key id) {
		if(id){//if id is a valid key, I'm attached to someone, otherwise I'm not
			llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION);
		}
		else {
			if(llGetPermissions()&PERMISSION_TRIGGER_ANIMATION){//if I have permission to animate someone
				if(strAnim){//and if strAnim isn't an empty string
					llStopAnimation(strAnim);//then stop the animation
				}
			}
		}
	}

	run_time_permissions(integer perm) {
		if(perm & PERMISSION_TRIGGER_ANIMATION){//if I have permission to animate someone
			llStartAnimation(strAnim);
		}
	}
}

 I would also caution against resetting the script unless you've got a good reason for wanting to.   All too often, to my mind, people cause themselves unnecessary problems by resetting scripts when they don't need to, and then forgetting to re-initialise the script properly.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1748 days.

Please take a moment to consider if this thread is worth bumping.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...