Jump to content

Odd behavior with llAttachToAvatarTemp


Helium Loon
 Share

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

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

Recommended Posts

I've been playing around with llAttachToAvatarTemp(), and ran into some odd behavior, which isn't in the wiki.....

 

I created an object with a ZHAO-II AO in it.  I'm having this object rezzed by another object, and it attaches to the person who touched the object that rezzed it.  That all works fine.  I'm testing it with an alt, while I am online as well.

 

But when the person who it is attached to TPs to a different sim, the AO stops.  I've checked and the scripts still appear to be running.  What's stranger.....TP back to where I am, and the AO starts up again.  But even stranger.  TP away, then I (the creator) TP to them, and it starts up again when I enter the sim they are on!

 

Any ideas on WHY this would be happening?

 

Link to comment
Share on other sites

That sounds as if some of the scripts are retaining their old permissions -- that is, permission to animate you -- after they've been temporarily attached.   I don't think they're supposed to, and certainly in some cases they don't -- I've been caught by that and PERMISSION_ATTACH, which has to be granted again to detach the item if the person to whom it attaches doesn't own the rezzer -- but that's certainly what it sounds like.  

I think I'd check to make sure it always requests PERMISSION_ANIMATE and PERMISSION_TAKE_CONTROLS when it's attached.    I don't know if that will fix it, but that's the first thing I'd try.

Link to comment
Share on other sites

Glancing at the code, there's a global variable Owner that get set in state_entry() and on_rez(), but not on attach() nor on CHANGED_OWNER. That Owner variable is used in a call to llGetAnimation() to decide what if any animation needs to be overridden.  If it's still trying to get your animation, as the owner before attachment, and you're not in the sim, it's not going to know there's an animation to override.

On the other hand, if that's the problem, I don't know how it managed to push the right animation at the right time on the alt while your main was in the sim, instead of pushing animations to that alt that were appropriate to whatever you were doing with your main.

Anyway, if you want to test this hypothesis, throw in a call to intialize() in the attach() handler and see if it works.

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3388 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...