Tabris Daxter
Snake oil Salesman
Join date: 22 Feb 2009
Posts: 61
|
10-28-2009 16:35
hey all,
is it possible to get prim params for all prims in a linkset at once.
i'm trying to make a "combination lock" Stargate SG-1/Atlantis/Mastermind style with crystals the crystals have to be a certain color for the lock to work.
Eg. 5 crystals can either be Red, Blue or Green (touch change). press button to check to combination/unlock the door.
Clarification: i need to get the color of prims in a linkset and compare them to a list(notecard or hard code).
_____________________
DANCE WITH KIRBY (^'-')^ (^'-')> (>'-')> <  '-'^) ^('-'^) (^'-')^ (^'-')> (>'-')> <  '-'^) ^('-'^)
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
10-28-2009 17:07
There's no llGetLinkPrimitiveParams, which would be the easy way, but you could always put a script in each prim in the linkset that responds to a llMessageLinked trigger from the root prim by sending its own message that is just llGetColor(ALL_SIDES). Collect all the messages from each prim and you'd have your answer.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
|
10-28-2009 22:07
You can do this with a single script. When the script resets, it uses llSetLinkColor() to set the color of each crystal prim to defaults (loop through the link numbers). Store those colors in a list. The script now "knows" the color of each crystal, because it set those colors.
Then, use llDetectedLinkNumber() to detect which crystal was touched. Again, use llSetLinkColor() to change the color of that crystal. Update the list of colors and the script still "knows" the color of all crystals in the set.
When the "test" button is touched, compare the list of current colors to the list of correct colors. If there's a match, then "open sesame"!
|