Jump to content

Help with making Texture changer Hud & Script


iMsQUEEN
 Share

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

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

Recommended Posts

The basic principle is this:-

 

  1. You find out the faces of the mesh that you want to apply texture to.
  2. You define the communications between HUD and mesh object.  Typically a "listen" in the object for a message from the HUD.
  3. You make the HUD (just a bunch of prims is one simple way) and detect which of these is touched, then send the message, to the object that is listening.

The object listen script is pretty simple, it just listens for a message and when it receives it, it parses the message to determine what to do, in the case of a texture script, it needs to know the object link number (if there are multiple parts to the linkset), it needs the face of that link and it needs the texture. 

The message that might represent this would be something like "2,3,<some UUID for the texture>"

So, in a listen event, once you receive a message, call llCSV2List and make a list such that you can easily use each piece of the message.

Then in the object listening script, you call llSetTexture or llSetLinkPrimitiveParamsFast, passing the bits of the message to the right parts of these functions to set the texture on the item.

Back to the HUD then...

A HUD in a simple form is just a collection of prims worn on a HUD attachment point.  You can detect which button was touched by calling llDetectedLinkNumber.

There's a multitude of ways to then do this, one way would be to set the description of the button to the UUID of the texture and then just retrieve that and send it via llRegionSayTo to the object via a chosen channel number.

Downside to this is that the texture UUID is easily found but newsflash, anyone that knows what they're doing can find the UUID with ease anyway and since mesh textures are somewhat single purpose, there's possibly less drama about this than used to be.

Alternatively, you could just hard code the UUID's into the script or you could choose to retrieve them from a notecard read, or from an external database.

I don't know if this is anything like what you wanted to get started with but that's about it in the simplest form.

 

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3455 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...