Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

problem with changed event

Arbus Fahid
Error: No Error
Join date: 16 Apr 2005
Posts: 6
07-14-2005 08:40
I'm looking at the LSL wiki's description of changed where integer change==CHANGED_INVENTORY. I'm trying to use this to maintain several prims in a link set each of which needs an identical copy of another script.

During testing it seems that contrary to the Wiki, the changed event (never mind even CHANGED_INVENTORY) is NOT triggered when a script is recompiled or dropped or saved in the prim, but ONLY when the script is renamed or deleted.

Am I going crazy?
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
07-14-2005 09:59
I've not tested it, but I think it should fire for adding, deleting or renaming.

Recompiling it and saving it after changes I wouldn't expect to fire changed because the inventory hasn't changed, it still has the script inside it and none of the things about the script from the inventory's point of view have changed...

The name, presence etc. have stayed the same even if the content has changed, and I suspect the key has been retained too.
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
07-14-2005 11:43
actualy when you recompile the script it is given a new uuid.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
07-14-2005 15:20
Your object has two scripts, right? One with a changed() event in the active state, and one that you're recompiling?

changed() won't fire if you terminate and recompile a script. There's nothing to cause it to do so -- the script isn't running at that point.
_____________________
Need scripting help? Visit the LSL Wiki!
Omega Point - Catherine Omega's Blog
Arbus Fahid
Error: No Error
Join date: 16 Apr 2005
Posts: 6
07-14-2005 18:07
That's correct, Catherine. What it boils down to is this: A single prim contains two scripts: one called "do something" that includes a changed event. (Currently it just llOwnerSay-s that something changed.) The second script I have imaginatively named "New Script" (well, actually that wasn't my idea).

So. When I reset "New Script" or make a change and save it, the changed event in the script "do something" is *not* triggered. It *is* triggered when I 1) delete "New Script" or 2) rename it in the prim's inventory.

Edit: Not that this necessarily clears anything up, but it seems to be the case that if I drop, say, a notecard from my inventory onto the object, the changed event *is* triggered. When I drop a script (any script), same as above, no changed event.

I love scripting but I seem to beat my head against the wall with mysterious problems like this a lot. Frankly, it's a bit discouraging; but I've decided not to let this one go until I at least know whether I'm just incompetent, or what.
Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
07-14-2005 18:37
Huh, you're right. That's certainly odd.
_____________________
Need scripting help? Visit the LSL Wiki!
Omega Point - Catherine Omega's Blog
Zeno Concord
To infinity, and beyond!
Join date: 28 Mar 2005
Posts: 51
07-14-2005 19:38
From: Arbus Fahid
I'm looking at the LSL wiki's description of changed where integer change==CHANGED_INVENTORY. I'm trying to use this to maintain several prims in a link set each of which needs an identical copy of another script.


Curiously, I was trying to do the same thing recently. I gave up and resorted to a manual intervention to propagate the changes. That led me to several more problems :(

From: someone
During testing it seems that contrary to the Wiki, the changed event (never mind even CHANGED_INVENTORY) is NOT triggered when a script is recompiled or dropped or saved in the prim, but ONLY when the script is renamed or deleted.


I wrote a comment in the wiki saying exactly this same thing, plus some more.
Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
07-16-2005 12:00
yep but recompiling a script trigger another event in the new script. I"m also pretty sure dropping a script into an object, also triggers another event.
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
07-16-2005 12:18
i'm vaguely recalling a revision where they added this quirk.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey