Ownership.....
|
|
Owner Maltese
Registered User
Join date: 13 Sep 2005
Posts: 65
|
03-10-2006 07:57
I have an object rezzing another object in world. From there, I'm looking to have either one of two things happen if anyone touches the rezzed object: either it attaches to their HUD or allow them to own it without it going into their inventory... or both....
It rezzes fine, of course, asks permission to attach to the HUD but then the error, "not owner of object, cannot attach" comes up.
Basically, I want anyone who touches the rezzed object to let it attach to their HUD after permission is given.
any ideas?
Thanks
|
|
Yumi Murakami
DoIt!AttachTheEarOfACat!
Join date: 27 Sep 2005
Posts: 6,860
|
03-10-2006 08:19
From: Owner Maltese I have an object rezzing another object in world. From there, I'm looking to have either one of two things happen if anyone touches the rezzed object: either it attaches to their HUD or allow them to own it without it going into their inventory... or both....
It rezzes fine, of course, asks permission to attach to the HUD but then the error, "not owner of object, cannot attach" comes up.
Basically, I want anyone who touches the rezzed object to let it attach to their HUD after permission is given.
You can't attach an object to an AV other than its owner. Not even to the HUD.  I think you have two choices: 1- Set the object Original For Sale at L$0 and have it request attach permission and attach when it gets a change event. 2- Use TLTP 
|
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
03-10-2006 08:22
You have to llGiveInventory() it to them, and then they can attach it from their inventory.
|
|
Owner Maltese
Registered User
Join date: 13 Sep 2005
Posts: 65
|
03-10-2006 10:15
Uhm.... TLTP?????
|
|
Drizzt Naumova
Teh Foxeh DJ
Join date: 9 Oct 2005
Posts: 116
|
03-10-2006 10:26
hmm..couldn't somone use that as a way to grief? i'm not saying your creation of course, i'm saying for like those would be griefers out there. I'm sure they would get a good laugh at unwary passersby who like to click things. From: someone You can't attach an object to an AV other than its owner. Not even to the HUD sort of good that that safe guard is in place. even with a dialog asking permission..sometimes the unknowing can let their curiosity get the best of them. might could have even been a way for a greifer to attach a "bug" to the hud and have it listen to im's or chat. Again, i am not saying anything bad about "your" creation. But am i right about any of the above?
|
|
Owner Maltese
Registered User
Join date: 13 Sep 2005
Posts: 65
|
03-10-2006 22:55
believe me, this isn't for griefing. Although the program is giving me grief...
Now when I set the object to $L0, it doesn't stick at that price. It shoots it up to $L10.
What's up with that?
Also, if I just give them the object through llGiveInventory, how do I activate a script when they wear it?
Thanks for the help. This is driving me batty.
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
03-10-2006 23:35
I don't know about the selling problem - that should be possible - but you use the attach() event to activate something when an object is attached. e.g. default { attach(key id) { if (id == NULL_KEY) llOwnerSay("Detached"); else llOwnerSay("Attached"); } }
Don't rely too much on the detached thing, it doesn't get a lot of time to process things before the object disappears.
|
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
03-10-2006 23:49
The price resetting seems to be something I've seen reported before - and it seems like a bug to me, so report it...
The attach() event will trigger things when they wear the item, as will on_rez() under the current rules. I believe that's the case for 1.9 too.
|
|
Yumi Murakami
DoIt!AttachTheEarOfACat!
Join date: 27 Sep 2005
Posts: 6,860
|
03-11-2006 05:48
From: Owner Maltese Uhm.... TLTP????? TLTP is Tight List Transfer Protocol.. the basic idea is, people wear "generic" HUD items, and then your in-world objects contact that HUD attachment and tell it to reconfigure itself into whatever you want. That way, you can create a HUD straight away with needing to worry about giving the person things they have to attach, etc. It's in the Protocol Exchange on the Wiki.
|
|
Owner Maltese
Registered User
Join date: 13 Sep 2005
Posts: 65
|
03-11-2006 06:27
Geez... talk about the possiblity of griefing, that sounds like a heap of it. Anyway thanks for all your help. It works if I give it to the inventory. However, I'd still like the "buy for free and attach" thing. There's another problem with that other than the price changing from $L0 to $L10 on rez. If it's touched by someone other than the owner, it's supposed to tell them to buy it for free first but instead, it just asks for permission to attach whether the toucher is the owner or not. Here's the code of the object. Why won't it tell the non-owner to buy it? I know I've bothered you guys a lot with this, but this is the last question. vector eul; //rotation rotation quat; //quaternion float x; integer ending; key toucher; key thingowner;
draincolor() { if (x > 0.02) { llSetAlpha(x,ALL_SIDES); } else { llSetAlpha(0,ALL_SIDES); ending = 1; } }
default { state_entry() { x = 1; ending = 0; llSetTextureAnim(ANIM_ON | SMOOTH | LOOP | ROTATE,ALL_SIDES,0,0,0.0, TWO_PI, llFrand(5 - 1)+ 1); } touch_start(integer num_detected) { toucher = llDetectedKey(0); thingowner = llDetectedOwner(0); if (toucher == thingowner); { llRequestPermissions(toucher, PERMISSION_ATTACH); } else { llWhisper(0,"Buy me for $L0 to start"); } } run_time_permissions(integer perm) { if (perm & PERMISSION_ATTACH) { llSetScale(<0.5,0.5,0.01>); llSetTexture("texture2",ALL_SIDES); llScaleTexture(0.8,1,ALL_SIDES); llAttachToAvatar(35); eul = <0,270,0>; eul *= DEG_TO_RAD; //convert to radians rotation quat = llEuler2Rot( eul ); //convert to quaternion llSetRot(quat); llSetTimerEvent(1800); } } timer() { if (ending == 0) { llSetTimerEvent(1.429); x = x - 0.010; draincolor(); } else { llSetTexture("5748decc-f629-461c-9a36-a35a221fe21f",ALL_SIDES); //blank texture llSetAlpha(1,ALL_SIDES); llDetachFromAvatar(); llObjectName("Delete me"); llDie(); } } }
|
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
03-11-2006 06:37
From: Owner Maltese Geez... talk about the possiblity of griefing, that sounds like a heap of it. Anyway thanks for all your help. It works if I give it to the inventory. However, I'd still like the "buy for free and attach" thing. There's another problem with that other than the price changing from $L0 to $L10 on rez. If it's touched by someone other than the owner, it's supposed to tell them to buy it for free first but instead, it just asks for permission to attach whether the toucher is the owner or not. Here's the code of the object. Why won't it tell the non-owner to buy it? I know I've bothered you guys a lot with this, but this is the last question. touch_start(integer num_detected) { toucher = llDetectedKey(0); thingowner = llDetectedOwner(0); if (toucher == thingowner); { llRequestPermissions(toucher, PERMISSION_ATTACH); } else { llWhisper(0,"Buy me for $L0 to start"); } }
this bit is wrong. you want thingowner=llGetOwner(); instead.
|
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
03-11-2006 10:07
From: Eloise Pasteur The price resetting seems to be something I've seen reported before - and it seems like a bug to me, so report it... It's fixed in 1.9 according to the release notes. You can wait until Wednesday and cehck again.
|