|
Merle Widget
Registered User
Join date: 9 Feb 2006
Posts: 4
|
02-24-2006 19:02
I've searched the forums and can't find any info on this, so if I'm asking a FAQ, sorry..
Anyway, I'm new here and I'm working on my first vehicle. I made a HUD to control throttle and cruise control and all that good stuff. Then I made the HUD autoattach when the user sits on the vehicle and autodetach when he stands up. So far, so good.
The problem is that in order to autoattach the HUD object I had to make the vehicle rez a copy of it and then send it a message telling it to attach itself to the owner. This leaves a new HUD attachment stuck in the owner's inventory each time he sits on the vehicle. It's pretty annoying.
I've tried using llDie(), but of course that doesn't work on attachments. Fine. I tried detaching the thing and THEN calling llDie(), no luck. I tried detaching it and calling llDie() in the attach event handler when the attachee is NULL_KEY. Nope. I'm pretty much out of ideas at this point and could really use some tips.
The wiki entry for llDetachFromAvatar() touches on this briefly, but its suggestion is to rename the object to "DELETE ME" or something similar. This is unacceptable, I'm trying to make the vehicle as simple for the user as possible and forcing them to chase down stray bits of leftover crap is counter to that goal. =)
So here are my questions: 1) Is there a way to remove an unwanted attachment from your inventory? 2) If not, is there a way to handle autoattachment without rezzing a new HUD object every time? 3) If both of the above are a "NO!", is there any chance of getting a spam-free child autoattachment feature added to LSL? 4) How irritating is it to have your Objects folder filled with 4500023 useless HUDs anyway?
EDIT: Two questions numbered 3, I rule!
|
|
Cid Jacobs
Theoretical Meteorologist
Join date: 18 Jul 2004
Posts: 4,304
|
02-24-2006 19:24
From: Merle Widget 1) Is there a way to remove an unwanted attachment from your inventory?
No From: Merle Widget 2) If not, is there a way to handle autoattachment without rezzing a new HUD object every time?
No From: Merle Widget 3) If both of the above are a "NO!", is there any chance of getting a spam-free child autoattachment feature added to LSL?
Talk to Kelly, but more than likely, No From: Merle Widget 3) How irritating is it to have your Objects folder filled with 4500023 useless HUDs anyway?
Not really, since we can multiselect objects.
|
|
Merle Widget
Registered User
Join date: 9 Feb 2006
Posts: 4
|
02-25-2006 14:33
Oh well, I'll guess they'll just have to delete the things manually then. Thanks for the quick response.
Where would I find this Kelly person?
|
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
02-25-2006 17:30
You might be better off letting the user choose to take a HUD or wear the one they already have from the last time.
|
|
Ben Bacon
Registered User
Join date: 14 Jul 2005
Posts: 809
|
02-26-2006 00:05
Merle, could you not leave the HUD attached permanently, but make it hide and reveal itself when neccessary?
|
|
Fenrir Reitveld
Crazy? Don't mind if I do
Join date: 20 Apr 2005
Posts: 459
|
02-26-2006 00:35
Generally how I handled with this with my own vehicle is to have the vehicle ask the HUD if it's present. If so, the the vehicle does nothing. If not, the vehicle gives the HUD to the user. (They can just press Decline if they don't want to use it, or if they already have one but didn't feel like putting it on.) This occurs after a delay, much like on the Dominus. Yeah, it's a little distracting, but I couldn't think of a better way to handle it. Would be nice if we could re/write properties on objects and avatars, like you can do on MU*s. 
|
|
Merle Widget
Registered User
Join date: 9 Feb 2006
Posts: 4
|
02-27-2006 10:08
I'd like to avoid making the user attach the HUD manually if at all possible. Checking for an already attached HUD would help eliminate some cases of HUD duplication, I'll look into that.
Actually, while pondering your responses just now I had an idea about making the HUD the only persistent object and making it spawn the vehicle when attached, but intelligently finding a safe rez spot for the vehicle seems like a problem. I don't want it appearing inside of other people or bumping them around or anything. Then you could delete the vehicle when you're done with it instead of taking it back into your inventory, no leftover objects at all. I wouldn't mind making them attach the HUD in that situation since it's the only inventory object they'll have to deal with.
I guess I could make it spawn inside the user at their feet.. hmm. Maybe make it phantom to avoid pushing and save sim processing time. I think that'll do the trick.
Thanks for the suggestions guys! =)
|
|
Merle Widget
Registered User
Join date: 9 Feb 2006
Posts: 4
|
02-27-2006 12:56
Haha, excellent! I got it working and man, is it ever a thing of beauty. (Ok, well, it is to me since I've spent so long banging my head against the wall over this.)
The HUD spawns the vehicle at the user's midsection, the user sits on it, does his thing, then detaches the HUD and the vehicle poofs. No muss, no fuss, newb friendly, no hassles, exactly what I was looking for although in a different form. Thanks again for the suggestions everyone.
|