Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

help?? setting custom colors by message???

RaptonX Zorger
Registered User
Join date: 26 Jan 2006
Posts: 79
04-21-2006 23:14
Ok, I have a script that uses link message to senda string and have it broken down, and part of it used to set the color of a object....

note that the listen script listens to message that would be something like /33 body <1,1,1>



The script with the listen script in it is




customfilter = llParseString2List(message,[","],[]);



if(llList2String(customfilter, 0) == "body";){
llMessageLinked(-1,0,llList2String(customfilter, 1),"customcolorbody";);return;}






The script that recives it is this







default
{

link_message(integer sender_num, integer num, string str, key id)
{

if(id == "customcolorbody";)
{





vector bodycolor = (vector)llList2String([str], 0);


llSetColor(bodycolor, ALL_SIDES);

}





however llList2String(customfilter, 1) only returns a 0 and thats all, no string or anything.....
Gigs Taggart
The Invisible Hand
Join date: 12 Feb 2006
Posts: 406
04-21-2006 23:30
Looks like you are parsing the initial input on commas and not spaces, that might be part of the problem.
Zalandria Zaius
Registered User
Join date: 17 Jan 2004
Posts: 277
hmm maybe this will work, I'm not on to test it though..
04-22-2006 00:55
CODE





customfilter = llParseString2List(message,[" "],[]);



if(llList2String(customfilter, 0) == "body"){
llMessageLinked(-1,0,llList2String(customfilter, 1),"customcolorbody");return;}






The script that receives it is this







default
{

link_message(integer sender_num, integer num, string str, key id)
{

if(id == "customcolorbody")
{

llSetColor((vector)str, ALL_SIDES);

}




We also have a function llSetLinkColor that may be of more use than a link message in each prim.