Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

object-object Listen problem!!

Shaden Sura
Registered User
Join date: 10 Oct 2006
Posts: 68
12-10-2008 13:47
Heya ~_~ I have a problem I been trying to made HUD that use a menu *the blue Menu( for change de colors of a attach prim but I cant get this to work the problem is I cant make to just listen de Owner HUD, when someone with the same HUD and use the menu or I use the menu and he have the attach item I can change the color even I am not the owner I try almost all I cant figure out how to do that here are the script I'll thank any help you can gime:

HUD Menu Script:



integer CHANNEL = 42;
list MENU_MAIN = ["Armor Color", "Fx Color"];
list MENU_FXCOLOR1 = ["fx black","fx white","fx red","fx yellow","fx green","fx cyan","<<< Back","Next >>> "];
list MENU_FXCOLOR2 = ["fx blue","fx purple","fx orange","fx brown","fx pink","fx grey"," <<< Back"];
list MENU_ARMORCOLOR1 = ["armor black","armor white","armor red","armor yellow","armor green","armor cyan","<<< Back","Next >>> "];
list MENU_ARMORCOLOR2 = ["armor blue","armor purple","armor orange","armor brown","armor pink","armor grey"," <<< Back"];

default {
state_entry() {
llListen(CHANNEL, "", NULL_KEY, "";);
}

touch_start(integer total_number)
{
if(llDetectedKey(0) == llGetOwner())
{
llDialog(llDetectedKey(0), "Pick a Option", MENU_MAIN, CHANNEL);
}
}

listen(integer channel, string name, key id, string message)
{
if (llListFindList(MENU_MAIN + MENU_FXCOLOR1 + MENU_ARMORCOLOR1 + MENU_FXCOLOR2 + MENU_ARMORCOLOR2, [message]) != -1)
{
llSay(-20000, message );
if (message == "Fx Color";)
llDialog(id, "FX Color Menu 1", MENU_FXCOLOR1, CHANNEL);
else if (message == "Armor Color";)
llDialog(id, "Armor Color Menu 1", MENU_ARMORCOLOR1, CHANNEL);
else if (message == "Next >>> ";)
llDialog(id, "FX Color Menu 2", MENU_FXCOLOR2, CHANNEL);
else if (message == "<<< Back";)
llDialog(id, "Pick a Option", MENU_MAIN, CHANNEL);
else if (message == "Next >>> ";)
llDialog(id, "Armor Color Menu 2", MENU_ARMORCOLOR2, CHANNEL);
else if (message == " <<< Back";)
llDialog(id, "FX Color Menu 1", MENU_FXCOLOR1, CHANNEL);
else if (message == " <<< Back";)
llDialog(id, "Armor Color Menu 1", MENU_ARMORCOLOR1, CHANNEL);
}
}
}




Attach Listen Script:

default
{
state_entry()
{
llListen(-20000,"",NULL_KEY,"";);
}

listen(integer channel, string name, key id, string message)
{
if ( llGetOwner() == llGetOwnerKey( id ))
{
if (message == "armor black";) llSetColor(<0,0,0>, ALL_SIDES);
else if (message == "armor white";) llSetColor(<1,1,1>, ALL_SIDES);
else if (message == "armor grey";) llSetColor(<0.5,0.5,0.5>, ALL_SIDES);
else if (message == "armor red";) llSetColor(<1,0,0>, ALL_SIDES);
else if (message == "armor yellow";) llSetColor(<1,1,0>, ALL_SIDES);
else if (message == "armor green";) llSetColor(<0,1,0>, ALL_SIDES);
else if (message == "armor cyan";) llSetColor(<0,1,1>, ALL_SIDES);
else if (message == "armor blue";) llSetColor(<0,0,1>, ALL_SIDES);
else if (message == "armor purple";) llSetColor(<1,0,1>, ALL_SIDES);
else if (message == "armor orange";) llSetColor(<1,0.5,0>, ALL_SIDES);
else if (message == "armor brown";) llSetColor(<0.5,0.25,0>, ALL_SIDES);
else if (message == "armor pink";) llSetColor(<1,0,0.5>, ALL_SIDES);
}
}
}
Jeredin Denimore
Romani Ite Domum
Join date: 5 Jul 2008
Posts: 95
12-10-2008 13:55
From: Shaden Sura
Heya ~_~ I have a problem I been trying to made HUD that use a menu *the blue Menu( for change de colors of a attach prim but I cant get this to work the problem is I cant make to just listen de Owner HUD, when someone with the same HUD and use the menu or I use the menu and he have the attach item I can change the color even I am not the owner I try almost all I cant figure out how to do that here are the script I'll thank any help you can gime:
...


Hehe, breathe...
Can you explain this part more clearly?
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
12-10-2008 14:00
In your "llListen" command, change NULL_KEY to "llGetOwner()". That will cause the script only to listen to the owner of the device, and not other avatars.
Jeredin Denimore
Romani Ite Domum
Join date: 5 Jul 2008
Posts: 95
12-10-2008 14:01
From: Pedro McMillan
In your "llListen" command, change NULL_KEY to "llGetOwner()". That will cause the script only to listen to the owner of the device, and not other avatars.


You're a better man than I, Gunga Din ;)
Shaden Sura
Registered User
Join date: 10 Oct 2006
Posts: 68
12-10-2008 14:03
jejeje the main problem is that when 2 person have the same item and the same hud and use the Menu they can both change the color of the attach objet no matter who is the owner, I cant make that listener just filter the others owner that have the same HUD and just listen the same owner of the HUD, got the same problem with the menu to when you make a selection and near you is the same HUD you got multi pop up of the option you pick.
Cappy Frantisek
Open Source is the Devil!
Join date: 27 Oct 2006
Posts: 400
12-10-2008 14:11
Plus in the hud script, you don't really need to check if the toucher is the owner as the only person that can touch a hud is the owner.
Shaden Sura
Registered User
Join date: 10 Oct 2006
Posts: 68
12-10-2008 14:24
From: Pedro McMillan
In your "llListen" command, change NULL_KEY to "llGetOwner()". That will cause the script only to listen to the owner of the device, and not other avatars.


I >.< I try that if you change that the listhen script wont listen the Menu HUD, plus llGetOwner() only work for any say by the object owner
Klug Kuhn
Registered User
Join date: 7 Sep 2007
Posts: 126
12-10-2008 18:06
Try this :) :

In the sender:
llSay(chan,"do stuff";);


In the receiver:
integer num = llListen(chan,"",NULL_KEY,"";);

listen( integer channel, string name, key id, string message )
{
if( llGetOwnerKey(id) == llGetOwner() )
{
}
}
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-10-2008 18:32
From: Shaden Sura
I >.< I try that if you change that the listhen script wont listen the Menu HUD, plus llGetOwner() only work for any say by the object owner

EDIT: Try this and you will see where the problem is. In the second script you keep trying to listen to the owner, but you are not listening for the owner, you actually need to listen to a hud:

CODE

default {
state_entry() {
llListen(-987, "", NULL_KEY, "");
}
touch_start(integer total_number) {
llDialog(llDetectedKey(0), "test", ["Testing"], -987);
}
listen(integer channel, string name, key id, string message) {
llSay(-6543, message);
}
}


CODE

default {
state_entry() {
llListen(-6543,"","","");
}
listen(integer channel, string name, key id, string message) {
llOwnerSay(message + "\nOwner key = " + (string)llGetOwner() + " \nlisten key = " + (string)id);
}
}

returns:
"Testing
Owner key = 0bf93171-e0d3-4b8c-b6eb-55d2cc30cf26
listen key = f88d7c69-bfe5-997f-30f4-8821ee5810a7"
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-10-2008 19:18
Try this. Just tested and it is working fine with no crosstalk between 2 different avatars:

CODE
default {
state_entry() {
llListen(-9, "", NULL_KEY, "");
}

touch_start(integer total_number)
{
if(llDetectedKey(0) == llGetOwner())
{
llDialog(llDetectedKey(0), "Pick a Option", ["Testing"], -9);
}
}

listen(integer channel, string name, key id, string message)
{
llSay(-11, message);
}
on_rez(integer start_param)
{
llResetScript();
}
}

CODE

default
{
state_entry()
{
llListen(-11,"","","");
}
listen(integer channel, string name, key id, string message)
{
if(llGetOwner() == llGetOwnerKey(id)){
llOwnerSay(message);
llOwnerSay("owner = " + (string)llGetOwner() + "\nOwner key = "
+ (string)llGetOwnerKey(id));
}
}
on_rez(integer start_param)
{
llResetScript();
}
}
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
12-11-2008 01:13
According to the wiki (and personal experience) dialog chat originates with the user's key, not the object's key, so filtering the initial listen should work fine... shouldn't it?

Checking against "llGetOwnerKey(id)" in the listen event will obviously still work though, since an avatar is basically its own owner.
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-11-2008 03:42
From: Pedro McMillan
According to the wiki (and personal experience) dialog chat originates with the user's key, not the object's key, so filtering the initial listen should work fine... shouldn't it?

Checking against "llGetOwnerKey(id)" in the listen event will obviously still work though, since an avatar is basically its own owner.

The problem lay in the receiving scripts. I played with it before posting the example scripts for much longer then I planned last night. In both Aditi and Agni. I was seeing the same bleed over phenomenon as the OP mentioned. One AV was creating the objects, taking a copy and giving it to the other AV. The receiver was activating in BOTH sets even thou the if test should have been getting the current owner until I threw the llResetScript in there. What is strange is that before using the llResetScript, chatting the owner keys was returning the correct values even thou there was still bleed over.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
12-11-2008 08:42
Debug llOwnerSay() statements to return the results of llGetOwner() and llGetOwnerKey() for the speaker would have been helpful. I can't see a problem with the logic, so one of those functions MUST have been returning a bad value. It'd be good to get that into JIRA.
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-11-2008 09:41
From: Hewee Zetkin
Debug llOwnerSay() statements to return the results of llGetOwner() and llGetOwnerKey() for the speaker would have been helpful. I can't see a problem with the logic, so one of those functions MUST have been returning a bad value. It'd be good to get that into JIRA.

Yep I was going to play with it some more tonight to get a more complete picture.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum