Added the tree scripts, w/ comments
[ProgettoPaperellaDiGomma.git] / changeSkinOnNewTextureEvent.lsl
blobddc50e25f47b29ef15d6e14de11fb44138c47d78
1 //originally written by Davide Byron
2 //this code is released under the GPLv3
3 //
4 // Reacts to E_NEW_INVENTORY_TEXTURE event
5 // When a new texture is received it's immediately used
6 // as a skin
7 //
8 // a creature with this script is able to change the texture if a user or another creature drops one
9 // into it's inventory. To be used it needs to have also the inventory manager script, or the
10 // new texture event won't be generated.
12 // WARNING: due to an unresolved bug the texture passed could not be the last one dropped
14 //dedicated to Mealea, thanks for the passion you put into things and for being able to pass it on to me :)
16 //standard stuff
17 integer E_NEW_INVENTORY_TEXTURE = 15;
22 default
25 on_rez(integer param)
27 llResetScript();
33 state_entry()
35 //this should help humans knows what this creature can do
36 llSetObjectDesc( llGetObjectDesc() + "drop a texture to inventory for me to 'wear' it-" );
43 link_message( integer sender_num, integer num, string str, key id )
45 //if a message of a new texture arrives, put the texture on as a skin
46 if(num == E_NEW_INVENTORY_TEXTURE )
48 //apply the texture to the whole linked set
49 llSetLinkTexture(LINK_SET, str, ALL_SIDES);