Objects refuse to shift-drag-copy, refuse to delete...
Posted: Tue Apr 29, 2014 8:40 pm
I have a problem with objects failing to delete, no allowing me to copy using shift-drag, failing to run scripts, failing to even admit that there's a script in the prim.
Objects seem to behave normally, except for one script I wrote which corrupts them somehow. I put the script in, and it fails to run. I click the "reset" button on the edit pane and get an error telling me there is no script in the object.
I try to shift-drag in edit and get no new prim. I put a llOwnerSay in the state_entry handler and get a message every time, indicating that a new prim is being created and the script is being run in the new prim, but there's no prim left behind as there should be when you shift-drag.
I created another prim and dropped the same script into it, and tried to link the two prims. They refused to link.
Now one of them can't even be deleted.
This takes one of my designs for a project and flushes it down the toilet. But it also raises concerns that I might get this freaky behavior any time I write a script.
Here's the simplest variant of the script that corrupts prims like this:
vector color = < 1.0, 1.0, 0.5>;
float prob = 0.3;
integer on = FALSE;
turnon() {
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_COLOR, ALL_SIDES, color, 1.0,
PRIM_POINT_LIGHT, TRUE, color, 5.0, 0.5, 1.0,
PRIM_FULLBRIGHT, TRUE]);
on = TRUE;
}
turnoff() {
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_COLOR, ALL_SIDES, <0.5, 0.5, 0.5>, 1.0,
PRIM_POINT_LIGHT, FALSE, color, 1.0, 0.5, 0.5,
PRIM_FULLBRIGHT, FALSE]);
on = FALSE;
}
default {
state_entry() {
llOwnerSay("about to reset");
turnon();
llOwnerSay("done reset");
}
link_message(integer sender, integer num, string msg, key id) {
float blah = llFrand(1.0);
if (blah > prob) {
if (on) {
turnoff();
} else {
turnon();
}
}
}
}
The turnon() routine apparently does nothing, which is nonsensical as it works fine in another script.
I just logged back in and found a bunch of other prims I'd deleted come back from the dead, and the undeletable prim has its parameters changed as if the turnon() routine ran while I was logged off. WTF?
The prims that came back from the dead and the undeletable prim allowed me to delete them, but what guarantee do I have that they'll STAY deleted -- they've already come back from the dead once today.
Can anyone tell me what in that script is causing the sim to fail so badly? I have an almost identical script that runs perfectly. Prims can be shift-dragged to copy, they change parameters correctly, they can be rezzed and deleted when I want, etc.
Objects seem to behave normally, except for one script I wrote which corrupts them somehow. I put the script in, and it fails to run. I click the "reset" button on the edit pane and get an error telling me there is no script in the object.
I try to shift-drag in edit and get no new prim. I put a llOwnerSay in the state_entry handler and get a message every time, indicating that a new prim is being created and the script is being run in the new prim, but there's no prim left behind as there should be when you shift-drag.
I created another prim and dropped the same script into it, and tried to link the two prims. They refused to link.
Now one of them can't even be deleted.
This takes one of my designs for a project and flushes it down the toilet. But it also raises concerns that I might get this freaky behavior any time I write a script.
Here's the simplest variant of the script that corrupts prims like this:
vector color = < 1.0, 1.0, 0.5>;
float prob = 0.3;
integer on = FALSE;
turnon() {
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_COLOR, ALL_SIDES, color, 1.0,
PRIM_POINT_LIGHT, TRUE, color, 5.0, 0.5, 1.0,
PRIM_FULLBRIGHT, TRUE]);
on = TRUE;
}
turnoff() {
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_COLOR, ALL_SIDES, <0.5, 0.5, 0.5>, 1.0,
PRIM_POINT_LIGHT, FALSE, color, 1.0, 0.5, 0.5,
PRIM_FULLBRIGHT, FALSE]);
on = FALSE;
}
default {
state_entry() {
llOwnerSay("about to reset");
turnon();
llOwnerSay("done reset");
}
link_message(integer sender, integer num, string msg, key id) {
float blah = llFrand(1.0);
if (blah > prob) {
if (on) {
turnoff();
} else {
turnon();
}
}
}
}
The turnon() routine apparently does nothing, which is nonsensical as it works fine in another script.
I just logged back in and found a bunch of other prims I'd deleted come back from the dead, and the undeletable prim has its parameters changed as if the turnon() routine ran while I was logged off. WTF?
The prims that came back from the dead and the undeletable prim allowed me to delete them, but what guarantee do I have that they'll STAY deleted -- they've already come back from the dead once today.
Can anyone tell me what in that script is causing the sim to fail so badly? I have an almost identical script that runs perfectly. Prims can be shift-dragged to copy, they change parameters correctly, they can be rezzed and deleted when I want, etc.