Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Scripts get deleted without a reason

Ishtara Rothschild
Do not expose to sunlight
Join date: 21 Apr 2006
Posts: 569
09-01-2006 05:13
Hello,
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.
HtF Visconti
Registered User
Join date: 21 Jul 2006
Posts: 123
09-01-2006 06:28
I have no idea why those scripts disappear but te 0.1 second timer worries me a bit - I'm thinking about a pond full of those little critters next to me. :)

Have you considered doing the movement in a for-loop with a bit of llSleep in between and raising the timer time thus a bit?
Adriana Caligari
Registered User
Join date: 21 Apr 2005
Posts: 458
09-01-2006 07:56
Have you had any sim rollbacks recently ? ( that could do it )

Are the fishies multi prim - is the script just dead but in a sub-prim or something.

Next up - are they group fishies ( not sure if you can delete contents within a group tho )

Last suggestion - has the sim been lagging quite a lot recently and have you noticed some strange people walking around with "L" on their foreheads looking under stones in a mysterious manner ?

( could be a linden decided the script was a griefer and deleted it )
_____________________
Maker of quality Gadgets
Caligari Designs Store
Ishtara Rothschild
Do not expose to sunlight
Join date: 21 Apr 2006
Posts: 569
09-01-2006 16:42
Could be due to sim rollbacks, probably. I didn't notice any crashes or increased lag though. The fishes aren't group objects and consist just of 2 prims, both without a script inside when they "die". Hm... I'll try HTF's approach with a loop, timed with llSleep.

Thanks for the help :)
Gattz Gilman
Banned from RealLife :/
Join date: 29 Feb 2004
Posts: 316
09-02-2006 01:03
i also noticed that you dont stop the timer on the stop command. and you have an extra ; in your touch event (which one make it so that anyone could start it.), delete the ; in if (llDetectedKey(0)==llGetOwner());<<
_____________________