Jump to content

Attach on rez for non owner.


BEGOCER Lehmann
 Share

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

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

Recommended Posts

Oh boy here I go again getting lost/confused/angry at something that is probably simple to do but I have no idea what to do.

So I've got a HUD that will be able to control a turret on a vehicle that has to be worn for it to 'fire' the turret. I'm using a HUD as opposed to having fire controls in the turret itself using key commands as that method just totally messes up my vehicle's driving scripts despite not being in the same prim for some reason... 

I've got everything working up to a certain point- firing controls, the turret will rez the HUD on sit and that HUD will then request to be attached to owner only then detach on stand etc. 

But what I cannot figure out is how to make the turret when sat on rez the control prim and attach to ONLY the user of the turret rather than owner only (which it is currently at the moment as I'm using some open source script). I'm not sure how to make the rezzer spawn the control HUD with the right request attach lines and know to attach to the seated user.

WHAT DO!?

Link to comment
Share on other sites

1 minute ago, Rolig Loon said:

The best you can do is rez the turret and ask permission to attach it.

Not only that, but you have to transfer ownership to the non-owner. llAttachToAvatarTemp() does that automatically; llAttachToAvatar() does not.

Assuming you (the OP) want to use your vehicle in more than one spot (which I'd assume given tat vehicles usually move around) ~not using an experience is actually better, because experience attached attachments automatically detach when you move onto a parcel that does not have the experience enabled.

Link to comment
Share on other sites

8 minutes ago, Quistess Alpha said:

Not only that, but you have to transfer ownership to the non-owner. llAttachToAvatarTemp() does that automatically; llAttachToAvatar() does not.

 

Currently I'm using AttachTAttachToAvatarTemp. For turret positions it's just for a vehicle with one turret. (Driver + gunner). I've seen it been done before where I've sat on other people's combat vehicles and it asks to attach HUD that lets me toggle settings and what not. 

Link to comment
Share on other sites

Ok! I got it working! Oh man you guys saved me so many hours of screaming and swearing! 

Changed the "experience_permissions(key target_id)" to "run_time_permissions(integer target_id)" and changed the RequestExperiencePermissions to llRequestPermissions(llDetectedKey(n), PERMISSION_ATTACH); and that made it work!

I appreciate it!

Edited by BEGOCER Lehmann
I fixed my error of not reading previous posts...
  • Like 2
Link to comment
Share on other sites

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

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
 Share

×
×
  • Create New...