Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Object listen problem

Nack Voom
Registered User
Join date: 6 Jan 2009
Posts: 5
01-07-2010 15:29
Hello, I am trying to make a very simple script that listens to an object to decide what color it needs to be changed to. The reason I put in a listen event is so that i can put it in multiple prims and they will all change to the same color everytime I click one of the prims. I must be missing something very simple or something because when i click it doesnt change color at all. Any help would be great:)
***************************************
integer check = 0;
default
{
state_entry()
{
llListen(456,llGetObjectName(),NULL_KEY,"";);
}

touch_start(integer total_number)
{
if (check == 0)
{
llSay(456,"1";);
check = 1;
return;
}
if (check == 1)
{
llSay(456,"0";);
check = 0;
return;
}
}
listen(integer channel, string name, key id, string message)
{
if (message == "1";)
{
llSetColor(<1.0, 0.2, 0.8>,ALL_SIDES);
}
if (message == "0";)
{
llSetColor(<0.2, 0.4, 1.0>,ALL_SIDES);
}
}
}
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
01-07-2010 15:42
My guess is that you have some kind of misunderstanding in how the filter works:
llListen(456,llGetObjectName(),NULL_KEY,"";);
With this filter all prims involved must have the same name, do they have the same name?

And, if I remember right, a prim can not hear what it is saying, so the prim you touch will not change color with this script:)
_____________________
From Studio Dora
Nack Voom
Registered User
Join date: 6 Jan 2009
Posts: 5
01-07-2010 15:52
ahhh ok, youre right i dont know what I was thinking. I will go about it differently thank you for your help.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-07-2010 18:28
and if all the prims involved are in the same object you don't need to use listens, or even more than one script.... llSetLinkColor. there's a version or two on in the Portal library.
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -