|
Pooptart Skall
Registered User
Join date: 29 Dec 2006
Posts: 18
|
10-25-2007 17:07
Rather than the traditional: llSetColor(<x,y,z>,ALL_SIDES);
I am trying to do: llSetColor(msg,ALL_SIDES);
Where msg is an incoming string that looks something like: <1.0,1.0,1.0>
But I get the error: Function call mismatches type or number of arguments.
Surprisingly, the error lies on ALL_SIDES
.. Help?
|
|
Masakazu Kojima
ケロ
Join date: 23 Apr 2004
Posts: 232
|
10-25-2007 17:29
http://lslwiki.net/lslwiki/wakka.php?wakka=Typecast
|
|
Pooptart Skall
Registered User
Join date: 29 Dec 2006
Posts: 18
|
10-25-2007 17:53
I don't understand how that helps with my problem.
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
10-25-2007 18:08
From: Pooptart Skall I don't understand how that helps with my problem. A string is not a vector, so she pointed you to the right spot. You have to typecast it as a vector ala: llSetColor((vector)msg,ALL_SIDES); Do that and it should compile just fine. If you are trying to just write and compile your scripts in the inworld script window it is not very verbose. Try running your script through Masakazu's unbelievably handy webtool; lslint: http://w-hat.com/lslintHer's is the state of the art, nothing surpasses tool that we all use. It would have said this instead: Passing string as argument 1 of `llSetColor' which is declared as `vector color'. If you like it then I would suggest downloading LSLEditor which has a handy but not as powerful or accurate compile checker in it. You can then download lsllint and install it as a plugin there.
_____________________
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
|
10-25-2007 18:11
Ooooops and I forgot to welcome you to the scripting forum earlier!!!!!! Don't be shy, and please flood us with questions. We love questions!!! You learn, I learn, we all learn (OMG, sounds like a Barney song  )
_____________________
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
|
|
Pooptart Skall
Registered User
Join date: 29 Dec 2006
Posts: 18
|
10-25-2007 19:06
Okay thanks, that worked. Thanks again. And Again.
Now only if I knew why it isn't listening for the messages..
|
|
Trevor Langdon
Second Life Resident
Join date: 20 Oct 2004
Posts: 149
|
10-25-2007 21:39
Pooptart-- Did you add a listen to your code, so it expects the command? Here's a simple example that should work, if you add it to the object content: default { state_entry() { llListen(1,"",llGetOwner(),""); }
listen(integer channel, string name, key id, string msg) { llSetColor((vector)msg,ALL_SIDES); } }
The above code is set to listen on Channel 1, so to change the object color to blue, you would type the following in chat: /1 <0,0,1>
|
|
Pooptart Skall
Registered User
Join date: 29 Dec 2006
Posts: 18
|
10-25-2007 22:42
Yeah I had everything. Came to find out that the reason why I was having problems is because I was making it listen to itself. I fixed it though.
Thanks all of you for your help.
|