Jump to content

Making an Alpha Hud


IntrovertBV
 Share

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

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

Recommended Posts

Your mesh body should have come with a HUD to do that.  If not, and if you can figure out how the modeler assigned faces on the body, all you need to do is write a script to add to the body (assuming that you have mod perms) that will change the alpha on selected faces (llSetLinkAlpha) and a HUD with a dialog that sends specific signals to the body to tell it which faces to change.  The big limitations have to do with how much you know about the body and how much you can modify it.

  • Thanks 1
Link to comment
Share on other sites

9 minutes ago, Rolig Loon said:

Your mesh body should have come with a HUD to do that.  If not, and if you can figure out how the modeler assigned faces on the body, all you need to do is write a script to add to the body (assuming that you have mod perms) that will change the alpha on selected faces (llSetLinkAlpha) and a HUD with a dialog that sends specific signals to the body to tell it which faces to change.  The big limitations have to do with how much you know about the body and how much you can modify it.

https://gyazo.com/2ca2af05de22b7db8a8971fac4f8af44

I tried those 2 scripts one on the left prim as a hud and the other on the right prim with highlighted yellow borders as an attachment reciever, but once I click on the assumed hud (on the left), the other prim (on the right) disappear and never come back again...

Actually, the biggest limitation is that I barely know about LSL...

Link to comment
Share on other sites

25 minutes ago, IntrovertBV said:

but once I click on the assumed hud (on the left), the other prim (on the right) disappear and never come back again...

Yep - because your HUD script, as currently written, only sends one message (the vanish signal) to the receiver. If you want to toggle it off/on, you need to add additional logic to the HUD script so that each time you click, it will alternate between sending the vanish signal, and a reappear signal.

And in that regard, I would second Rolig's suggestion to consider using llSetLinkAlpha in the receiver instead of setting the texture to a full alpha image. By toggling the alpha parameter, you can make the target object/face invisible or visible without needing to keep track of the original texture.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

The script you've shown has it kind of backwards, which makes things more complicated.

You shouldn't send UUIDs from the HUD and have the mesh body just apply whatever texture it's given. One simple reason is that you're exposing the texture UUIDs, which makes them possibly easier to steal. Another is that the body will try to apply any message it hears on that channel, even if it's not a texture at all.

Instead, your HUD should send names like "left arm", "left forearm", "left hand" and the script in the body should be configured so that a specific name always means switching the alpha of a specific face(s) of the mesh.

The alpha should be toggled with llSetLinkAlpha (simple to use) or llSetLinkPrimitiveParamsFast (for multiple parts at once), not with texture-swapping. This way nobody has to load new textures, and having fewer textures on your mesh makes it "less laggy." (Easier to say than a lot of technical babble.)

That's the theory of it anyway. Depending on the mesh, it can be quite a bit of work to set it all up.

Edited by Wulfie Reanimator
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

1 hour ago, IntrovertBV said:

playing with some mesh stuff, mesh body... I just wanted the scripts of hiding and showing specific parts..

Also, if "mesh body" is about mesh avatars, this whole practice of toggling visibility of portions of the mesh is kind of obsolete, with the advent of Bakes-on-Mesh. Instead of changing the alpha of separate faces on the avatar mesh, the baking service applies alpha mask textures to hide portions of a mesh avatar, same as it used to work with the old system avatar, but with higher resolution, etc. This means outfits can simply include the alpha mask(s) that work best with them, and of course it drastically decreases the geometric complexity of the avatar mesh.

  • Like 2
Link to comment
Share on other sites

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