llSetColor + llListen need help
|
|
Shaden Sura
Registered User
Join date: 10 Oct 2006
Posts: 68
|
11-13-2008 11:39
Hi, I am have a little problem I am trying to change the color of a prim using a HUD but I cant made that the listen prim work and I dunno why and when I try look using llListen(20,"",NULL_Key,""  ; others w/ the same HUD can change the color of the prim, and when i try using llListen(20,"",llGetOwner(),""  ; dont work I dont know how to make this work I try using default { state_entry() { llListen(20,"",llGetOwner(),""  ; } listen(integer channel, string name, key id, string message) { if ( llGetOwner() == llGetOwnerKey( id )); } } this but same problem other can change the color to, plus I dont know how to do that script get different messange for set different colors can someone help w/ this problem I'll be realy thankfull for any help.
|
|
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
|
11-13-2008 12:04
default { state_entry() { llListen( 10, "", llGetOwner(),""); }
listen(integer channel, string name, key id, string message) { if ( message == "white" ) llSetColor( < 1.0, 1.0, 1.0 >, ALL_SIDES); if ( message == "red" ) llSetColor( < 1.0, 0.0, 0.0 >, ALL_SIDES); if ( message == "green" ) llSetColor( <0.0, 1.0, 0.0 >, ALL_SIDES); if ( message == "red" ) llSetColor( < 0.0, 0.0, 1.0 >, ALL_SIDES); } }
This will work better if what you want is to listen on channel 10 for the owner. I added the option of letting the owner ask for one of four colors 
_____________________
From Studio Dora
|
|
Shaden Sura
Registered User
Join date: 10 Oct 2006
Posts: 68
|
11-13-2008 12:32
that look good but I trying to change the color of the prim using HUD, by touching a prim that send the messange like this default { touch_start(integer total_number) { llSay(10,"red"  ; } } but when I try either of this happen all that use the same HUD can change the color of the prim or gent I try only to listen to the other the target prim listener dont work =\ X3 I did a mistake in this script is no llGetOwner is lie this default { state_entry() { llListen(20,"",NULL_Key,""  ; } listen(integer channel, string name, key id, string message) { if ( llGetOwner() == llGetOwnerKey( id )); } }
|
|
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
|
11-13-2008 13:47
NULL_KEY needs to be in all caps
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
11-13-2008 17:03
You are also speaking on channel 10 and listening on channel 20 default { state_entry() { llListen(10, "", NULL_KEY, ""); }
listen(integer channel, string name, key id, string message) { if (llGetOwnerKey(id) == llGetOwner()) if (message == "red") llSetColor(<1.0, 0.0, 0.0 >, ALL_SIDES); } }
_____________________
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
|
|
Shaden Sura
Registered User
Join date: 10 Oct 2006
Posts: 68
|
11-13-2008 19:39
OK made the corrections and look like this: HUD Prim default { state_entry() { } touch_start(integer total_number) { llSay(20, "red"  ; //or any color messange } } Target Prim default { state_entry() { llListen(20,"",NULL_KEY,""  ; } listen(integer channel, string name, key id, string message) { if ( llGetOwner() == llGetOwnerKey( id )); if (message == "black"  llSetColor(<0,0,0>, ALL_SIDES); if (message == "red"  llSetColor(<1,0,0>, ALL_SIDES); if (message == "yellow"  llSetColor(<1,1,0>, ALL_SIDES); if (message == "green"  llSetColor(<0,1,0>, ALL_SIDES); } } that work but still I have the same problem I test this w/ others persons that are no the owners and still can change the color of the Target Prim, I dont know how to make that listen only listen the owner and filter other owners that have the same HUD Prim.
|
|
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
|
11-13-2008 21:40
you need to use brackets in the if statement, and i'm not sure if it's required, but also else if. test to make sure it compiles, but that should work From: Shaden Sura Target Prim default { state_entry() { llListen(20,"",NULL_KEY,""  ; } listen(integer channel, string name, key id, string message) { if ( llGetOwner() == llGetOwnerKey( id )) { if (message == "black"  llSetColor(<0,0,0>, ALL_SIDES); else if (message == "red"  llSetColor(<1,0,0>, ALL_SIDES); else if (message == "yellow"  llSetColor(<1,1,0>, ALL_SIDES); else if (message == "green"  llSetColor(<0,1,0>, ALL_SIDES); } } }
|
|
Shaden Sura
Registered User
Join date: 10 Oct 2006
Posts: 68
|
11-13-2008 22:13
=D Hey Thx a lot now it works just great, ^^ thx for the help
|