Aaron Levy
Medicated Lately?
Join date: 3 Jun 2004
Posts: 2,147
|
07-10-2004 00:51
How do I change the texture of a single face of an object that is linked with a bunch of other objects, using scripting?
Main example: 5 objects whos texture is a different playing card, depending on the deal... how do i differentiate the 5 objects and then only apply a new texture to the face of certain ones?
Along the same lines... how do I link an object to anohther object without the linked's object's scripts being applied to the main object?
|
Aaron Levy
Medicated Lately?
Join date: 3 Jun 2004
Posts: 2,147
|
07-10-2004 01:09
hmm... could i have the main object whisper commands to the card objects, telling each object what texture to put up?
|
Ezhar Fairlight
professional slacker
Join date: 30 Jun 2003
Posts: 310
|
07-10-2004 02:28
You'll have to put a script into each prim that changes the textures using llSetTexture (where you can specify the face of the prim as parameter).
Use linkmessages to tell the prims what to do.
When you link prims, scripts stay in the prims they were in. When selecting the linked object in edit mode, you only see the contents of the parent prim. To see the others, use "select individual".
|
Aaron Levy
Medicated Lately?
Join date: 3 Jun 2004
Posts: 2,147
|
07-10-2004 08:39
Ahh linkmessages, I'll consult the wiki on that.
As yor the linked scripts affecting other prims, I have and animation script for water in a fountain I'm building... when I link the water to the fountain, the whole thing starts rotating.
|
Aaron Levy
Medicated Lately?
Join date: 3 Jun 2004
Posts: 2,147
|
You wanted Newbie questions... here's one on llLinkMessage
07-10-2004 12:53
I can't get linkmessages to work. the wiki needs sample code... please! I have all my prims able to say their linknumber on command, for debugging, so I can get linknumbers. When I try to send a text string to linknumber 3, though, I get function call mismatches type or number of arguments. The Wiki says this is the format for llMessageLinked... llMessageLinked(integer linknum, integer num, string str, key id); I declared linknum, num as integers, and str as a string. I'm just trying to get this prim to send a message to linknumber 3... here's the code I have... I'm very confused cause the wiki page for llLinkmessage doesn't even mention what to use for "num" or "id", so I have NO CLUE what goes in them, or if they are even needed. It would seem that the only thing the script needs is the linknumber it's talking to and the message... Here's my crappy code, please help me get a grasp on this: integer linknumber; integer linknum; string str; key id;
default { touch_start(integer total_number) {
linknumber = llGetLinkNumber(); linknum = 3; str = "test"; llSay(0, "My Link number is:"+(string)linknumber); llMessageLinked(linknum, 1, str, 0);
//llMessageLinked(integer linknum, integer num, string str, key id); } }
|
Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
|
07-10-2004 15:38
You're right, that was awful. I updated the wiki entry for llMessageLinked and added an example page. llMessageLinkedExampleLinkMessage
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
Re: You wanted Newbie questions... here's one on llLinkMessage
07-10-2004 15:57
From: someone Originally posted by Aaron Levy I can't get linkmessages to work. the wiki needs sample code... please!
I have all my prims able to say their linknumber on command, for debugging, so I can get linknumbers.
When I try to send a text string to linknumber 3, though, I get function call mismatches type or number of arguments.
The Wiki says this is the format for llMessageLinked...
llMessageLinked(integer linknum, integer num, string str, key id);
I declared linknum, num as integers, and str as a string.
I'm just trying to get this prim to send a message to linknumber 3... here's the code I have... I'm very confused cause the wiki page for llLinkmessage doesn't even mention what to use for "num" or "id", so I have NO CLUE what goes in them, or if they are even needed. It would seem that the only thing the script needs is the linknumber it's talking to and the message...
Here's my crappy code, please help me get a grasp on this:
integer linknumber; integer linknum; string str; key id;
default { touch_start(integer total_number) {
linknumber = llGetLinkNumber(); linknum = 3; str = "test"; llSay(0, "My Link number is:"+(string)linknumber); llMessageLinked(linknum, 1, str, 0);
//llMessageLinked(integer linknum, integer num, string str, key id); } } Here is your problem: llMessageLinked(linknum, 1, str, 0); The usage of llMessageLinked is: llMessageLinked(integer linkNum, integer num, string str, key id); 0 is an integer, not a key, so it gives you a type mismatch error. Pass "" or NULL_KEY if you dont use the key field in the recieving prim.
|
Aaron Levy
Medicated Lately?
Join date: 3 Jun 2004
Posts: 2,147
|
07-10-2004 16:05
Yay!! Worked the very first try using the sample stuff from the Wiki!! Thanks!!!
I'm going to start wearing a "READ THE WIKI" shirt around SL.
|