Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Setting a texture on rez or wearing of attachment

StarSong Bright
SL Addict
Join date: 24 Jan 2007
Posts: 191
09-13-2009 16:25
Hi all, I am trying to make a simple script that will check / set a texture on one prim in a linkset anytime the item is worn or rezzed. It seems like this ought to be simple but i am getting caught up in all the code for positions and whatnot. Can somebody take pity on me and tell me how i set side 0 of a prim to a particular uuid anytime the linkset is worn or rezzed? thanks!
EF Klaar
Registered User
Join date: 11 Jun 2007
Posts: 330
09-13-2009 17:25
default
{
on_rez (integer parameter)
{
llSetTexture (uuid, 0);
}
attach (key id)
{
if (id != NULL_KEY)
{
llSetTextue (uuid, 0);
}
}
}

This should go in the prim in question. Use llSetLinkTexture from a different prim. Use llGetTexture to check the texture. See http://wiki.secondlife.com/wiki/LlSetLinkTexture and http://wiki.secondlife.com/wiki/LlGetTexture for details.
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
09-13-2009 17:49
"on_rez(integer start_param)

Triggered in an object whenever it is rezzed from inventory or by another object, or in an attachment when its owner logs in while wearing it, or attaches it from inventory."

Looks like you could do away with the attach event and just use on_rez.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
EF Klaar
Registered User
Join date: 11 Jun 2007
Posts: 330
09-14-2009 01:08
I thought that using the attach event would cover the eventuality of the object being rezzed to the ground, tampered with, and then being attached from there.
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
09-14-2009 10:11
Use ALL_SIDES rather than zero, in EF's post.

Use both events if you want to do something different on attach than on rez. Otherwise, on_rez is sufficient.
EF Klaar
Registered User
Join date: 11 Jun 2007
Posts: 330
09-14-2009 11:48
From: Lear Cale
Use ALL_SIDES rather than zero, in EF's post.
I must defend what little reputation I have left :)
From: StarSong Bright
tell me how i set side 0 of a prim to a particular uuid
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
09-14-2009 12:22
Oops, my bad! ALL_SIDES is -1. Silly me. Thanks for correcting my mistake. :)
VelvetThorn Nightfire
Registered User
Join date: 20 May 2008
Posts: 10
Ty Ty Ty
09-14-2009 13:40
Got it all working, thanks for the hand!