Added the tree scripts, w/ comments
[ProgettoPaperellaDiGomma.git] / changeSculptedShapeOnNewTextureEvent.lsl
blobbe8d5ad29fc9cb2905c01fbf722b45f67a989f1d
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 shape
7 //
8 // when a creature has this script it gains the ability to change the shape by apllying a sculpted texture.
9 // this is useful to have complex shaped creatures that uses just one prim, but it has the shortcoming of
10 // creatures with multi prims that can acquire this script via evolution. In that case results are unpredictable
11 // and untested. Be careful and please report back any discovery :)
13 // WARNING!!! this causes your creature to have very weird shapes if the texture passed is not a sculpted.
14 // until a standard for naming texture or something is not in place it should be avoided
16 //dedicated to Mealea, thanks for the passion you put into things and for being able to pass it on to me :)
18 //standard related
19 integer E_NEW_INVENTORY_TEXTURE = 15;
24 default
27 on_rez(integer param)
29 llResetScript();
35 state_entry()
37 //this should help humans knows what this creature can do
38 llSetObjectDesc( llGetObjectDesc() + "drop sculpted textures into inventory-");
39 //no need to init the object as sculpted right now, the first texture received will turn it
40 //into a sculpted and apply immediately the texture received.
47 link_message( integer sender_num, integer num, string str, key id )
49 //if a message of a new texture arrives, put the texture on as a skin
50 if(num == E_NEW_INVENTORY_TEXTURE )
52 //turn the object into a sculpted and apply the sculpted texture
53 llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_SCULPT, str, PRIM_SCULPT_TYPE_SPHERE]);