X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=huffware%2Fhuffotronic_tools_n_testers_v6.5%2Fsculpty_morpher_v0.6.txt;fp=huffware%2Fhuffotronic_tools_n_testers_v6.5%2Fsculpty_morpher_v0.6.txt;h=60aa8940ed9a394500acc66d8536a505a6bed7f7;hb=ef90e9104684f535e8a5edef643f008592254019;hp=0000000000000000000000000000000000000000;hpb=8bca8b4404ce2236359f100b97b1d10abb1b94bb;p=feisty_meow.git diff --git a/huffware/huffotronic_tools_n_testers_v6.5/sculpty_morpher_v0.6.txt b/huffware/huffotronic_tools_n_testers_v6.5/sculpty_morpher_v0.6.txt new file mode 100755 index 00000000..60aa8940 --- /dev/null +++ b/huffware/huffotronic_tools_n_testers_v6.5/sculpty_morpher_v0.6.txt @@ -0,0 +1,46 @@ +// +// sculpty morpher +//needs header. + +integer position; // which texture are we on? + +change_sculpture() +{ + integer textures_available = llGetInventoryNumber(INVENTORY_TEXTURE); + if (textures_available == 0) { + // nothing to morph into. + return; + } + position++; + if (position >= textures_available) { + // we rolled over, so go back. + position = 0; + } + string texture_name = llGetInventoryName(INVENTORY_TEXTURE, position); + llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_SCULPT, texture_name, PRIM_SCULPT_TYPE_SPHERE]); +} + +default { + state_entry() { if (llSubStringIndex(llGetObjectName(), "huffotronic") < 0) state real_default; } + on_rez(integer parm) { state rerun; } +} +state rerun { state_entry() { state default; } } + +state real_default +{ + state_entry() + { + llSetTimerEvent(4.0); + position = 0; + } + + timer() { + change_sculpture(); + } + + changed(integer type) { + if (type & CHANGED_INVENTORY) { + change_sculpture(); + } + } +}