Mister Webwyre Posted May 13, 2012 Share Posted May 13, 2012 Hi guys and gals,As a scripting newbie, I was working through this example:http://wiki.secondlife.com/wiki/Tic_Tac_ToeI seem to be missing something on how to link the cubes together.(I click the first one, then shift click the next 8, then click the link button ... is there another (corrrect ?) way to do it ?)When I link them, the llGetLinkNumber() function returns the same number, on any cube I touch.I was expecting (for 9 cubes), nine distinct link numbers / id'sMikeHere's a test script I was trying to use : //// ShowLinkNum - use with two or more linked objects//integer lnum = 0;default { state_entry() { lnum = llGetLinkNumber(); llOwnerSay("(ShowLinkNum) state_entry) lnum : " + (string) lnum); llOwnerSay("llGetNumberOfPrims: " + (string) llGetNumberOfPrims()); } touch_start(integer touching_agents) { llOwnerSay("(ShowLinkNum) touch_start) lnum : " + (string) lnum); }} Link to comment Share on other sites More sharing options...
Rolig Loon Posted May 13, 2012 Share Posted May 13, 2012 You need to look for the link number in the touch_start event. If you look for it in state_entry, you get a single, unchanging value. Try llOwnerSay("The link number is " + (string)(llDetectedLinkNumber( 0 ) ) ); Link to comment Share on other sites More sharing options...
Mister Webwyre Posted May 15, 2012 Author Share Posted May 15, 2012 Thanks ! ' llDetectedLinkNumber seems to be the function to use for the touch_start event. Now, I added a llSetColor(..... to the touch_start event, but when I click on any of the cubes only cube "#1" is changing color. I want which ever cube was clicked to change color. Mike Link to comment Share on other sites More sharing options...
PeterCanessa Oh Posted May 15, 2012 Share Posted May 15, 2012 That would be because llSetColor() doesn't have any means for you to specify [the link number of] which prim you want to change. Read http://wiki.secondlife.com/wiki/LlSetColor, see the 'see also' section towards the bottom. There is at least one different function that will do what you want. Link to comment Share on other sites More sharing options...
Mister Webwyre Posted May 17, 2012 Author Share Posted May 17, 2012 Thanks Peter, that did the trick. Mike Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now