Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llSetLinkPrimitiveParams()

Mau Fratica
Registered User
Join date: 5 Mar 2007
Posts: 7
01-05-2008 12:32
I found very little discussion about this disappointing function here and in the jira.

Most people obviously complained about the fact that you can't address multiple prims at once with llSetLinkPrimitiveParams(). You can't do something like

llSetLinkPrimitiveParams(1, [PRIM_COLOR, etc.], 2, [PRIM_POSITION, etc.]);

(Not to mention the missing llGetLinkPrimitiveParams() counterpart).

Why is it so?

Is there any technical problem? Any security or performance problem?

Should not this be an improvement for anyone: human writing the scripts, servers, viewers and bandwidth?

Bye!
Seifert Surface
Mathematician
Join date: 14 Jun 2005
Posts: 912
01-05-2008 12:52
Nested lists aren't possible in LSL, but there are other potential schemes for a more general version that I've seen discussed. One issue with llGetLinkPrimitiveParams would be the amount of data potentially returned if called on LINK_SET.

But in any case, I hear that the real issue is that this is reasonably low priority in comparison with stability issues etc, and in particular, not much more work on scripting is going to get done before Mono is out.
_____________________
-Seifert Surface
2G!tGLf 2nLt9cG
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
01-05-2008 13:43
From: Mau Fratica
You can't do something like

llSetLinkPrimitiveParams(1, [PRIM_COLOR, etc.], 2, [PRIM_POSITION, etc.]);

Why is it so?

Is there any technical problem?
Well, with the syntax I think you're suggesting, yes. Your example above takes an integer (prim link number), a list (parameters to apply to the first link number), an integer (another prim link number), and another list (parameters to apply to the second link number). So with this syntax, you must apply parameters to exactly 2 prims (not counting special values for specified subsets, LINK_ALL_CHILDREN, etc). What if you want to modify only one prim? What if you want to modify 3 or more?

Therein lies the issue: LSL doesn't support optional function parameters, nor function overloading. You can't have a function which has parameters which are ignored or dealt with in a default manner if not specified in code, nor two or more different functions with the same name that take different parameters. This is why lists are used, as they take the place of optional parameters.

So, what sort of list-only syntax would you suggest to apply an arbitrary number of parameters to an arbitrary number of linked prims?
Mau Fratica
Registered User
Join date: 5 Mar 2007
Posts: 7
01-05-2008 14:17
I was not suggesting any specific synthax, it was just a (naif) example. You are right, you can't use that one because LSL can't do that. But that's not the problem: just add a

PRIM_DONE_WITH_THIS_ONE

rule and you don't have problems.

Anyway Mono being a higher priority looks like a good reason (for Lindens) to forget this issue.

Thanks to both!
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-05-2008 16:20
the could have at least abstracted out to be able to make multiple identical calls to linked prims by having the link number parameter as a list... come to that they could even use the same reading scheme to allow multiple lists that they use within the list (ie each new list is a new set of parameters)... ::shrug::
_____________________
|
| . "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...
| -