I created a bunch of flexi fishes a while ago. About a dozen of those briskly little critters swim around in a large prim lake. In addition to rotate around a center prim, I also slightly change their position in a fast rythm, for a realistic "wiggling" of the flexi prim.
Now, every second day one of the lil' fellas is dead. Stopped swimming around, that is. That's an unwanted level of realism, somehow. When I check them, the script inside is gone, the inventory completely empty. How can that be? No one else has modify rights on them. Here's the script:
CODE
integer x; //movement timer on/off
integer y=0; //wiggling
startup()
{
llListen(1,"",llGetOwner(),"fstop");
llListen(1,"",llGetOwner(),"fstart");
x=0; //no rotation until clicked or fstart command
}
started()
{
llTargetOmega( < 0, 0, 1 >, .13 * PI, 1.0 ); //rotation
llSetTimerEvent(0.1); //wiggle timer; too fast?
x=1;
}
default
{
state_entry()
{
startup();
}
on_rez(integer nevermind)
{
startup();
}
touch_start(integer total_number)
{
if (llDetectedKey(0)==llGetOwner()); //start movement only if clicked by owner
started();
}
listen(integer chan, string name, key id, string mes)
{
if (mes == "fstop")
{
x=0; //stop wiggling
llStopMoveToTarget(); //just saw that this is unneeded... a relic of another approach at movement. However, it shouldn't cause a bug
llTargetOmega( < 0, 0, 1 >, 0 * PI, 0 ); //stop rotating
}
else if (mes == "fstart")
started();
}
timer() //wiggling; jerks fish to the left and right unless x=0
{
if (x > 0)
{
if (y==1)
{
y=0;
llSetPos(llGetLocalPos() + <0.035,0,0>);
}
else
{
y=1;
llSetPos(llGetLocalPos() - <0.035,0,0>);
}
}
}
}
Is there anything in there that could cause the server to delete the script? I'd like to sell those fishes at some point, together with swans, ducks, butterflies and other prim critters, and them floating upside down after some days would reduce their value quite a bit.
/Edit: I know the timer runs quite fast with 0.1 seconds, but anything slower doesn't have the right "wiggle" effect on the flexi prim.
