|
JohnHenry Cooperstone
Registered User
Join date: 20 Apr 2009
Posts: 10
|
04-20-2009 18:43
Does anyone know how to pop up llDialog() when an object is attached or worn? I tried it in state_entry/on_rez and is ignored.
Thanks
|
|
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
|
04-20-2009 18:47
Have you tried attach()? When an object is worn from inventory, it does also get an on_rez() event, but not if you wear it from in-world. ~Boss
|
|
JohnHenry Cooperstone
Registered User
Join date: 20 Apr 2009
Posts: 10
|
04-20-2009 20:35
From: Boss Spectre Have you tried attach()? When an object is worn from inventory, it does also get an on_rez() event, but not if you wear it from in-world. ~Boss I tried it but, it seems to not get called when you attach, but only when detach. default { on_rez(integer _x){ llOwnerSay("RezY"  ; llResetScript(); } state_entry() { llOwnerSay("State"  ; } attach(key id) { if(id)//tests if it is a valid key and not NULL_KEY { llSay(PUBLIC_CHANNEL,"I have been attached!"  ; } else { llSay(PUBLIC_CHANNEL,"I have been detached!"  ; } } }
|
|
Lazink Maeterlinck
Registered User
Join date: 8 Nov 2005
Posts: 332
|
04-20-2009 20:42
Try: if(id != NULL_KEY)
it's always evaluating false, why it's only working on detach.
|
|
JohnHenry Cooperstone
Registered User
Join date: 20 Apr 2009
Posts: 10
|
04-20-2009 23:18
From: Lazink Maeterlinck Try: if(id != NULL_KEY)
it's always evaluating false, why it's only working on detach. I removed it the if structure and still never goes there. Justa plain ole llSay(). Does it work for you?
|
|
Lazink Maeterlinck
Registered User
Join date: 8 Nov 2005
Posts: 332
|
04-20-2009 23:50
default { attach(key id) { if(id != NULL_KEY) { llDialog(id, "Test Menu", ["test", "test2"], -100); } else { llOwnerSay("Detached"); } } }
Works just fine for me, every time I attach the item I get a dialog menu.
|
|
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
|
04-21-2009 02:35
on_rez(integer _x){ llOwnerSay("RezY"  ; llResetScript();} You are resetting the script before the attach event gets called, in comes in right after on_rez but you aren't giving it a chance. ~Boss
|
|
JohnHenry Cooperstone
Registered User
Join date: 20 Apr 2009
Posts: 10
|
04-22-2009 08:42
From: Boss Spectre on_rez(integer _x){ llOwnerSay("RezY"  ; llResetScript();} You are resetting the script before the attach event gets called, in comes in right after on_rez but you aren't giving it a chance. ~Boss makes sense. thanks you!
|