Jump to content

attach texture


Kwezalcoatl
 Share

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

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

Recommended Posts

Hello to all the lovely and beautiful people :)

of course - i need some help :)

I want to create a script that simply add a texture (for example a tattoo) to the owner of the hud who is attached on a hud position.

I found few scripts in the deep of the forum with own concepts but i really have no idea how to use it. maybe because i do from scratch ... newbie ...

I found this the following script at the end of this post.

It looks useful but ... i guess i have to insert an uuid of the texture somewhere?

default
{
    attach(key AvatarKey)
    {//give instructions for use and prevent item from being attached to avatar
        if(AvatarKey)
        {//event is called on both attach and detatch, but Key is only valid on attach
            llOwnerSay ("
            DAs BoM Tattoo wurdde angeheftet");
 
            llRequestPermissions(AvatarKey, PERMISSION_ATTACH );
        }
    }
    run_time_permissions(integer perm)
    {
        if(perm & PERMISSION_ATTACH)
        {
            llDetachFromAvatar( );
        }
    }
}

 

 

Link to comment
Share on other sites

An object is attached to an avatar, but a texture is applied to one or more faces of an already attached object.

In your snippet the object the script is in will attach itself to the avatar but then immediately detach when run_time_permissions event occurs so I suspect you'll see nothing.

Have a look at llSetTexture in the LSL Wiki, or if you need much more control over offsets, repeats and rotation, look at llSetPrimitiveParams

Inside run_time_permissions, assuming you want the texture of one or more faces to change to show the item is attached, instead of the detach function, use one of the two I referred to above to change the texture.

 

Edited by Profaitchikenz Haiku
Link to comment
Share on other sites

Hi Profaitchikenz Haiku, Thank you - i will going to resarch about hat ... just one question - if i want to apply ... to the meshbody - a BoM tattoo - what 'face' are we talking about? (applier scrips for applying on ie maitreya body i found).

Edited by Kwezalcoatl
Link to comment
Share on other sites

You want to wear a layer for the body. Skin, tatoo, etc.

A script can't do that, you need to do that manually  or make an outfit.

A script can send  a texture to a mesh body, but you don't have the info to do that and it's not BOM then. Creator kits for mesh bodies deliver a (nomod) script for that purpose and can apply a tatoo to an extra BOM layer for the body.

RLV can probably apply tatoo layers but I don't need and don't use RLV so you need to get info from someone else about that.

Link to comment
Share on other sites

«

You want to wear a layer for the body. Skin, tatoo, etc.

A script can't do that, you need to do that manually  or make an outfit.

A script can send  a texture to a mesh body, but you don't have the info to do that and it's not BOM then. Creator kits for mesh bodies deliver a (nomod) script for that purpose and can apply a tatoo to an extra BOM layer for the body.

»

Thank you for your answer ...
Ok - now i see the difference between objects, faces,  textures and layers ... applying and attaching ... If i have a BoM Tattoo with that pink scribbled icon like we had on classic bodies. I can 'add' this tatto manually by clicking 'add' (or 'wear' but i expicit want 'add'). Then it adds the tattoo on the mesh body. And same i want to do with a script integrated in a HUD. I alread did this with the meshbody appliers in the developer kit's.

Is that tatto an own layer? Do i apply a new layer?

Thank you for your kind help - i am sorry but all this is technically confusing me a little -

Edited by Kwezalcoatl
Link to comment
Share on other sites

BOM textures are different from applier textures. By "wearing" or "adding" a BOM texture, you're using the viewer to cause the system to "bake" that texture into a system-defined stack of textures that end up painting that BOM surface. When your applier script applies a texture, it paints it onto a surface which may be one of a stack of layered surfaces (the "onionskin" layers that make pre-BOM mesh bodies so laggy to render). The problem is that scripts have never been able to perform that viewer-triggered "wear"/"add" function from the server; RLV-based scripts instead tell the RLV-enabled viewer to trigger that function.

That's the current state of play, but there's a feature request for llWearFromInventoryTemp() that might someday change this. Intended to provide a BOM equivalent to auto-alpha, it might also enable scripts to trigger wearing of other BOM textures.

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

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