|
Max Pitre
Registered User
Join date: 19 Jul 2006
Posts: 370
|
08-24-2007 07:28
I'm trying to get a prim to switch the sculpty texture only but can't seem to get it right. I tried to modify my texture change scripts with no luck. I tried to use PRIM_TYPE_SCULPT within llSetPrimitiveParams but I don't see how that can work and I am missing something in the wiki on changes to just the sculpt texture and not the prim texture if there is one. Any help?
Thanks
|
|
Darko Lednev
Registered User
Join date: 20 Aug 2007
Posts: 31
|
08-24-2007 08:40
Here is a little script that will randomly change the sculpt texture on your prim on touch. Put this script along with all sculpt textures you want in your object.
*IMPORTANT* !!! Put ONLY sculpt textures in your object or you will loose the object !!!
//////////////////////////////// Script code \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ string texture; key uuid;
default { state_entry() { llSetText("Touch to randomly change the Sculpt Shape", <1,0,0>, 1); }
touch_start(integer total_number) { integer j; j = llGetInventoryNumber(INVENTORY_TEXTURE) - 1; float FloatValue; integer IntValue; FloatValue = llFrand(j); IntValue = llRound(FloatValue);
texture = llGetInventoryName(INVENTORY_TEXTURE, IntValue); uuid = llGetInventoryKey(texture); llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_SCULPT, uuid, PRIM_SCULPT_TYPE_SPHERE]); } } //////////////////////////////// End of code \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
|
|
Darko Lednev
Registered User
Join date: 20 Aug 2007
Posts: 31
|
08-24-2007 09:25
After some testing I realized that you will not loose your object if you put normal textures inside but it may turn up invisible and shrinked depending on the texture so it's better to avoid them. It just came on my mind that you may use a list for textures if you want both types in your object but that would need some more scripting.
|
|
Max Pitre
Registered User
Join date: 19 Jul 2006
Posts: 370
|
08-24-2007 12:13
I couldn't get that script to work at all, it compiled fine but even the text didn't show up. But it gives me something to work with.
Thanks
Oh, Darko, you forgot which dimension in your profile location...hehe
|
|
Darko Lednev
Registered User
Join date: 20 Aug 2007
Posts: 31
|
08-24-2007 18:33
Have no clue why it isn't working for you...it worked just fine for me. In any case the command is: llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_SCULPT, uuid, PRIM_SCULPT_TYPE_SPHERE]); where uuid is the key of the texture...simple enough  edit: LOL for the dimension
|