Jump to content

Texture script help needed


Stari Adder
 Share

You are about to reply to a thread that has been inactive for 4211 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

OK so I am a bit new to scripts and was looking for an advice,

I created some clothes (mesh) and would like the same (for instance) one shirt to have different textures, got the textures  and got the shirt, but my need is to make a hud to send the selected texture from hud to the shirt

 

I know that it is connected with llSay and llListen scripts but after drifting for 3 weeks in wiki library I am just lost =(

so if anyone can help me out with advice where to start it would be great.

Cheers

PS also should I place textures to the hud contant and object as well when add scripts?

Link to comment
Share on other sites

That's not a particularly difficult scripting challenge, but it's not one that most beginning scripters will be ready for.  Take a look here for some of the basic considerations in building and scripting a HUD.  To change the texture on any prim, you will need to use llSetLinkPrimitiveParamsFast or an equivalent function, focusing your attention on PRIM_TEXTURE.  In a multiprim object or in the case where you want to apply a different texture to different faces on your prim (or mesh, sculpty...), you will need to identify the prims/faces and apply that function several times.  You may get some ideas by looking at smple texture change scripts here.

Link to comment
Share on other sites

to get you started...

in the object:

 

 

integer index;list textures;default{    state_entry()    {        index = llGetInventoryNumber(INVENTORY_TEXTURE);        llListen(123,"", "","");                integer n = index;        while(n)           {             textures += [llGetInventoryName(INVENTORY_TEXTURE, --n)];           }    }    touch_start(integer total_number)    {           }         listen( integer channel, string name, key id, string message )        {            if(message)                      {                                                                            if (~llListFindList(textures,[message]))                 {                   llSetTexture(message, ALL_SIDES);                }                                             }        }                              }                                                                                                                              

 

this will check anything said on channel 123 ..

if you have 4 textures in your mesh objects inv, i.e. red, blue, green. pink

and the chat matches the texture name, it will change the prims texture.

your HUD can chat on the channel you choose, and you can also add a dialog box

to choose the textures..... you could put the textures in just the HUD and send the

texture UUID's to the  mesh obj,

 

the dialog for the HUD would look something like this, and in Touch_start you would have Dialog();

Curr should be set in your listen event in the HUD

 

Dialog(){                   integer channel = 123;           CurrBtnList = [];           cntrl = ["BACK","POWER","NEXT"];           index = llGetInventoryNumber(INVENTORY_TEXTURE);           ttlPages =  llCeil(index/9.0 );            pgMax = (page * 9);           pgMin = ( pgMax - 9);                                         i = (pgMin - 1);                             while (i < (pgMax - 1))          {             ++i;              if (i < index)              {                 CurrBtnList += [ llGetInventoryName(INVENTORY_TEXTURE,i)] ;              }          }                       llDialog(ID,"\nPlease choose your Texture:\n\n" +           " \nCurrent texture : "  + Curr,         cntrl + CurrBtnList,channel);                            }

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4211 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...