|
saxxony Parx
Registered User
Join date: 26 Feb 2009
Posts: 2
|
02-26-2009 06:40
hi,
I am new to scripting.
I would like to modify the offset texture coordinates of three linked box prims on specific sides (2 and 4) via a menu script.
I can alter offsets on individual box prims using llOffsetTexture but haven't figured out to how to structure my script so that when a user selects a menu choice, it changes all three linked prims together (it shouldn't matter which of the three prims are clicked).
Any help would be appreciated.
Thank you.
|
|
Monster Behemoth
Registered User
Join date: 22 Dec 2004
Posts: 6
|
02-26-2009 14:08
Well there's 2 ways to do this I think (it depends on your preference I guess):
a) Use 3 calls to llSetLinkPrimitiveParams. You can set the offset with the PRIM_TEXTURE parameter. You can just add 2 PRIM_TEXTUREs together in the parameters list. You can then set each of the faces separately. If you don't have the texture in your inventory or can't find it's UUID, then you probably can't use this one. Keep in mind that it will take .6 seconds to modify 3 prims this way.
b) Use llMessageLinked. You would then put in the code to modify the offset in each prim in the link_message event. The advantage would be that this will take .4 seconds to execute (1 call for each face), but you'd have to manage 3 scripts.
In either case, I believe putting a touch_start event in the root prim will cause the entire link set to be touchable. Is this what you wanted?
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
02-26-2009 15:34
using the sub script method, those sub scripts need not be in the individual prims to get the time savings, they can be in the root and target the individual prims from there
a trick to increasing maintainability in such a scenario is to create a single script that does the identical change on a single child prim, then make multiple copies of the script but changing the script name to reflect which prim it targets, and have it read that name into a variable which it will use to target it's specific prim. for small sets that OTHER individual information, you can include a list of that info in the script and reference it by it's order.
_____________________
| | . "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... | - 
|
|
saxxony Parx
Registered User
Join date: 26 Feb 2009
Posts: 2
|
02-26-2009 23:39
From: Monster Behemoth Well there's 2 ways to do this I think (it depends on your preference I guess):
a) Use 3 calls to llSetLinkPrimitiveParams. You can set the offset with the PRIM_TEXTURE parameter. You can just add 2 PRIM_TEXTUREs together in the parameters list. You can then set each of the faces separately. If you don't have the texture in your inventory or can't find it's UUID, then you probably can't use this one. Keep in mind that it will take .6 seconds to modify 3 prims this way.
b) Use llMessageLinked. You would then put in the code to modify the offset in each prim in the link_message event. The advantage would be that this will take .4 seconds to execute (1 call for each face), but you'd have to manage 3 scripts.
In either case, I believe putting a touch_start event in the root prim will cause the entire link set to be touchable. Is this what you wanted? Appreciate the response. I'll look up llSetLinkPrimitiveParams, PRIM_TEXTUREs and UUID in the wiki to see if this is what I need. The textures are already applied to the prims and there is only one texture so I don't have to load additional textures, just alter the UV coordinates.
|