Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

parent texture applied to child

Snowy Penguin
Registered User
Join date: 18 May 2005
Posts: 3
01-05-2006 09:31
so... i have a box which contains: an object, a texture, a script.
is there any way to have the script apply the texture to the object?
like object.texture=box[texture]... but in linden script?
Alphazero Sugar
Noob Tube
Join date: 24 Mar 2005
Posts: 60
01-05-2006 10:08
You're probably looking for something like:

llSetTexture("mytexture", ALL_SIDES);

So, slap on a script like:

default
{
state_entry()
{
llSetTexture("mytexture", ALL_SIDES);
}
}

then you'd probably want to remove the script once the texture
is set.
Oasis Perun
Registered User
Join date: 2 Oct 2005
Posts: 128
01-05-2006 10:15
So you want to change the texture of the object in the inventory of the 1st prim?.. Am i understanding you right?

The only way i could think to do this is an on_rez in the object in the box and have the box rez the object. There isnt a way to change the an objects texture while its in inventory though.
_____________________
Alphazero Sugar
Noob Tube
Join date: 24 Mar 2005
Posts: 60
01-05-2006 10:17
Whoop, I think I missed the point of your message there...

I believe scripts can only apply textures to the object their connected
with, so you would want to have a script in the object that listens for
some message from the parent box, then applies the texture.

There should be some way to give the texture to the child object as
well. Alternately, you could have any potential textures already residing
on the child object and apply the appropriate one by script when needed.

Something like:

int COMM_CHANNEL 123456

default
{
state_entry()
{
llListen(COMM_CHANNEL,"",NULL_KEY,"";);
}

listen(integer channel, string name, key id, string message)
{
if (channel == COMM_CHANNEL && message == "Texture1";)
{
llSetTexture(ALL_SIDES, "Texture1";);
}
}
}
Snowy Penguin
Registered User
Join date: 18 May 2005
Posts: 3
01-05-2006 10:42
awesome, thanks for the help! i will try alphazero's idea and see what goes on. thanks again!