Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Changing params in succession for linked objects

jamieparsons Lemon
undergrad n00b
Join date: 5 Nov 2008
Posts: 36
11-12-2008 10:45
Working through some university exercises and have hit a wall. I think it's quite simple though.

Question: make linked objects change colour in succession.

I know how to change the paramaters on linked prims using llSetPrimitiveParams but will I have to use some sort of loop or if statement to make the main and child prims to change in succession.

Is it something to do with getting the keys of each prim, making a list perhaps.

Pseudocode: Get vector of *key from last prim*

Need to get through this fast... help!

Thanks folks
Anya Ristow
Vengeance Studio
Join date: 21 Sep 2006
Posts: 1,243
11-12-2008 11:00
Look in the wiki for the Link functions.

http://wiki.secondlife.com/wiki/Category:LSL_Link

If you want to apply the same color to each prim, get the number of prims using llGetNumberOfPrims and just loop through them. If you want to apply different colors to different prims, probably the best thing to do is name them, then when you loop through all the prims check their names using llGetLinkName.
_____________________
The Vengeance Studio Gadget Store is closed!

Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
11-12-2008 17:13
depending on the type of succession you are wanting, either link messages to anther script, and/or llSetLinkPrimitiveParams

a useful trick in lsl is having seperate scripts all with the same contents that modify different prims based on the scripts name, to modify a batch of prims at the same time based on a message from a controlling script

example:
name script "new script"
copy into prim howver many times you have scripts to modify
rename first copy "new script 0"
script contains a line reading it's name, and parsing it for the script number
use the parsed number for targeting specific linked prims, delays, data selecting, increments, whatever

one message to control them all...
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -