These forums are CLOSED. Please visit the new forums HERE
single-call link # function calls? |
|
|
Eep Quirk
Absolutely Relative
Join date: 15 Dec 2004
Posts: 1,211
|
03-29-2006 21:48
How can llSetLinkColor (and other link functions) apply to multiple prims in a linkset (object) with a single call? I want to do this to the function's prim AND 1 or more other prims--but not ALL child prims (OR necessarily the root prim).
|
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
03-29-2006 22:00
I take it you didn't see "other link constants" in the middle of the sentence describing what LINK_SET did for llSetLinkColor.
If the answer you see is not on that page, then the answer you seek is: "It's impossible". _____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey |
|
Eep Quirk
Absolutely Relative
Join date: 15 Dec 2004
Posts: 1,211
|
03-29-2006 22:50
Um, sure I did (since I added it!)--check the edit history, "Blind Wanderer"... I doubt it's IMPOSSIBLE; it simply needs to be IMPLEMENTED by LL.
|
|
Kelly Linden
Linden Developer
Join date: 29 Mar 2004
Posts: 896
|
03-29-2006 22:56
It is not currently possible to use llSetLink* to modify an arbitrary subset of prims in a link set. Only specific link numbers and the given special cased constants are currently possible.
_____________________
- Kelly Linden
|
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
03-29-2006 22:59
*rolls eyes*
Ok "It's Currently Impossible" LL could implement a hotkey to eject my CD tray but they probably won't. As to making llSetLink* functions work on multiple prims you could request LL add new LINK_* flags. I recommend Kelly's feature suggestion cylinder. Or were you thinking changing the syntax for the llSetLink* functions? Edit: speak of the Linden (was taking my time to write). Kelly, do you still read the feature suggestions dropped on your cylinder? It's been a while since i heard back on any of them ._____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey |
|
Eep Quirk
Absolutely Relative
Join date: 15 Dec 2004
Posts: 1,211
|
03-29-2006 23:04
Well, yes, ideally, any function that uses link numbers should have this functionality. How about it, Kelly?
![]() |
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
03-29-2006 23:06
Eep: How would you go about defining an arbitrary subset? (or did you mean more LINK_* flags).
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey |
|
Eep Quirk
Absolutely Relative
Join date: 15 Dec 2004
Posts: 1,211
|
03-29-2006 23:58
I don't think more LINK_* flags is the way to go. Perhaps:
CODE llSetLinkColor(integer [LINK_NUM1,LINK_NUM2], vector color, integer face) |
|
Jesrad Seraph
Nonsense
Join date: 11 Dec 2004
Posts: 1,463
|
03-30-2006 00:25
Save the one prim color you don't want to change, change them all in one call, then set it back on the one prim. There, three calls.
Other than that it should be simple enough to make a subroutine for changing a given set of prims using a list to store the link numbers, and a for loop ? _____________________
Either Man can enjoy universal freedom, or Man cannot. If it is possible then everyone can act freely if they don't stop anyone else from doing same. If it is not possible, then conflict will arise anyway so punch those that try to stop you. In conclusion the only strategy that wins in all cases is that of doing what you want against all adversity, as long as you respect that right in others.
|
|
Eep Quirk
Absolutely Relative
Join date: 15 Dec 2004
Posts: 1,211
|
03-30-2006 00:29
Um, no, Jesrad. I don't want the other prim(s) colors changed at all. I am trying to do this in a SINGLE call since SL/LSL isn't fast enough to update multiple linked prims (not already defined in the link constants) fast enough. A FOR loop does nothing to fix this (and a list is unnecessary).
|
|
Kelly Linden
Linden Developer
Join date: 29 Mar 2004
Posts: 896
|
03-30-2006 07:45
"integer [LINK_NUM1,LINK_NUM2]" has no meaning in lsl. Implementing this, besides being just weird syntax, would be non trivial.
*IF* something like this were implemented, it would most likely require new lsl functions. edit: Yes Strife still do. Havn't replied to them in a while though. Been very busy with other projects. _____________________
- Kelly Linden
|
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
03-30-2006 08:52
If you want to make it work for a subset of prims as quickly as possible, you may have to have a script in every prim that does something like this:
CODE
|
|
Eep Quirk
Absolutely Relative
Join date: 15 Dec 2004
Posts: 1,211
|
03-30-2006 19:12
"integer [LINK_NUM1,LINK_NUM2]" has no meaning in lsl. Implementing this, besides being just weird syntax, would be non trivial. *IF* something like this were implemented, it would most likely require new lsl functions. No need for new functions; just add an extension for some so they can take multiple parameters in brackets for link #s, sides, etc (but also accept single parameters without brackets). Shouldn't be that hard to do... |
|
Eep Quirk
Absolutely Relative
Join date: 15 Dec 2004
Posts: 1,211
|
03-30-2006 19:15
If you want to make it work for a subset of prims as quickly as possible, you may have to have a script in every prim that does something like this: CODE
|
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
03-30-2006 20:10
Um, why? llParticleSystem and llSetPrimitiveParams use this syntax...what's the big deal about applying it to llSetLink* functions too? I wasn't sure where to put "integer" but was just trying to show that values in brackets weren't necessary but if multiple values WERE there, they WOULD be in brackets, like other functions do... No need for new functions; just add an extension for some so they can take multiple parameters in brackets for link #s, sides, etc (but also accept single parameters without brackets). Shouldn't be that hard to do... llParticleSystem & llSetPrimitiveParams each have a list paramater not an integer. "integer [LINK_NUM1,LINK_NUM2]" is a really scary syntax, because it suggests superposition of states; an integer with multiple values (in this case). Implementing such a thing in LSL would require rewriting all of LSL, I'm not exagerating; the LSL bytecode makes no pervisions for anything remotely like this, all functions would have to be rewriten, the way paramaters are passed to functions would change. It is a bad idea. Lets pretend for a moment what you inteded was to overload llSetLinkColor. For someone who edits the wiki so extensively not to understand the syntax of function definitions (they are at the top of every page) is a travisty; not to mention bring into question his ability to script. So pretending is what we will do as to avoid such a posability. llSetLinkColor(list faces, vector color, integer face) In the bytecode this would require a new function to be built (there is no way to detect the difference in the LSL bytecode between an integer and a list pointer). Since such a function would be selectively updating prims in the object it would probably have some delay on it proportional to the length of the list. _____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey |
|
Eep Quirk
Absolutely Relative
Join date: 15 Dec 2004
Posts: 1,211
|
03-30-2006 20:33
llParticleSystem & llSetPrimitiveParams each have a list paramater not an integer. "integer [LINK_NUM1,LINK_NUM2]" is a really scary syntax, because it suggests superposition of states; an integer with multiple values (in this case). Implementing such a thing in LSL would require rewriting all of LSL, I'm not exagerating; the LSL bytecode makes no pervisions for anything remotely like this, all functions would have to be rewriten, the way paramaters are passed to functions would change. It is a bad idea. Lets pretend for a moment what you inteded was to overload llSetLinkColor. For someone who edits the wiki so extensively not to understand the syntax of function definitions (they are at the top of every page) is a travisty; not to mention bring into question his ability to script. So pretending is what we will do as to avoid such a posability. llSetLinkColor(list faces, vector color, integer face) In the bytecode this would require a new function to be built (there is no way to detect the difference in the LSL bytecode between an integer and a list pointer). Since such a function would be selectively updating prims in the object it would probably have some delay on it proportional to the length of the list. |
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
03-30-2006 20:39
Unfortunately, using the integer as a bitfield, which is what you seem to be suggesting by:
(LINK_ALL_CHILDREN !LINK_THIS) or (LINK_SET !LINK_ROOT) Will only allow you to address 32 primitives of the 255 currently allowed primitives of a link set. We would need a bigger integer for it to work that way. Not to mention a rewrite of the llSetLink* functions. ==Chris _____________________
October 3rd is the Day Against DRM (Digital Restrictions Management), learn more at http://www.defectivebydesign.org/what_is_drm
|
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
03-30-2006 21:03
1) Well, perhaps when Mono is implemented in SL it should be written to accept this, then. 2) Why not? 3) Well, how do the link # constants do it so fast then? Perhaps multiple constants are needed: (LINK_ALL_CHILDREN !LINK_THIS) or (LINK_SET !LINK_ROOT). 1) This would require rewriting all code currently writen for implementing LSL in mono and requiring years of developer time. Trust me on this, it's not going to happen. I know there are times when SL seem to follow the laws of quantum physics; but we really really don't need quantum physics support in LSL. It would also confuse the heck out of everybody. 2) I take it you mean "Why can it not tell the difference between list pointers and integers." because LSL does not store types; only lists keep track of types. When lists are built by user code, the type of the variable is defined in the bytecode at the time it is inserted in the list. Its up to the compiler to track what the type is for that location in the stack. A couple years ago LL had screwed up how "--" worked on floats where the compiler mistakenly thought the return type was not float but integer. The result was the same effect as using a C Union on a float and integer. Keeping track of types at runtime would slow down LSL (if you can imagine that). 3) That syntax you have provided is invalid. LL could define new constants like LINK_SET_BUT_NOT_ROOT. But I don't see much point to that one. Just use a link message and route the call to the root and call with LINK_ALL_OTHERS or LINK_ALL_CHILDREN (will have the same effect). _____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey |
|
Zepp Zaftig
Unregistered Abuser
Join date: 20 Mar 2005
Posts: 470
|
03-30-2006 23:05
If the way Argent suggests gives trouble since linkmessages might not arrive at exactly the same times, maybe a time could be sent in the link message from the synchronizing script and then when receiving the message, hold the scripts in a while loop until time+1 before setting the color. I dunno, but I'd guess it would improve the chances of setting the colors at approximately the same time.
_____________________
![]() |
|
Eep Quirk
Absolutely Relative
Join date: 15 Dec 2004
Posts: 1,211
|
03-31-2006 00:37
1) This would require rewriting all code currently writen for implementing LSL in mono and requiring years of developer time. Trust me on this, it's not going to happen. I know there are times when SL seem to follow the laws of quantum physics; but we really really don't need quantum physics support in LSL. It would also confuse the heck out of everybody. 2) I take it you mean "Why can it not tell the difference between list pointers and integers." because LSL does not store types; only lists keep track of types. When lists are built by user code, the type of the variable is defined in the bytecode at the time it is inserted in the list. Its up to the compiler to track what the type is for that location in the stack. A couple years ago LL had screwed up how "--" worked on floats where the compiler mistakenly thought the return type was not float but integer. The result was the same effect as using a C Union on a float and integer. Keeping track of types at runtime would slow down LSL (if you can imagine that). 3) That syntax you have provided is invalid. LL could define new constants like LINK_SET_BUT_NOT_ROOT. But I don't see much point to that one. Just use a link message and route the call to the root and call with LINK_ALL_OTHERS or LINK_ALL_CHILDREN (will have the same effect). |
|
Eep Quirk
Absolutely Relative
Join date: 15 Dec 2004
Posts: 1,211
|
03-31-2006 19:07
Functions with a side parameter should also be rewritten to allow multiple sides in a single call.
|
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
04-01-2006 13:04
Functions with a side parameter should also be rewritten to allow multiple sides in a single call. A new function (eg: llSetColorList(vector color, list sides);) should be implemented. In LSL, types matter. In a language where types are derived or implicit, things would be very different. For example, in an OO language with late binding, color and sides would be classes, so the call would be object.sides[0].color = color; rather than llSetColor(color, 0);, and to change multiple sides you'd call object.sides[set(0,1,2,4)].color = color;. But that's clearly a different kind of language than LSL. |
|
Huns Valen
Don't PM me here.
Join date: 3 May 2003
Posts: 2,749
|
04-02-2006 00:03
why don't you just use a for loop?
_____________________
|
|
Eep Quirk
Absolutely Relative
Join date: 15 Dec 2004
Posts: 1,211
|
04-02-2006 01:53
why don't you just use a for loop? |
|
Eep Quirk
Absolutely Relative
Join date: 15 Dec 2004
Posts: 1,211
|
04-02-2006 01:55
Nope. A new function (eg: llSetColorList(vector color, list sides);) should be implemented. In LSL, types matter. In a language where types are derived or implicit, things would be very different. For example, in an OO language with late binding, color and sides would be classes, so the call would be object.sides[0].color = color; rather than llSetColor(color, 0);, and to change multiple sides you'd call object.sides[set(0,1,2,4)].color = color;. But that's clearly a different kind of language than LSL. |