Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Inventory changes

Aritus Anansi
Registered User
Join date: 1 Jul 2004
Posts: 21
01-12-2005 12:12
Just come across something strange. When dragging a script into a prim with a script that's looking for inventory changes, the changed event is not called. However it is called if you manually remove a script from the prim. It is triggered if you drop an object or something else into it.

Has anybody else noticed this? Or know of anyway around it?
_____________________
RCR Racing Dosojin 124,15: Race radio controlled cars around specially designed circuits. Visit the Pit Shop to buy your own RC cars and accessories.
Also available for purchase on-line: SecondServer
Want to resell RCR products with a 10% commission? Contact me for details of my RESELLER VENDOR
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
01-12-2005 13:30
Interesting. Just tested, and no changed event whatsoever (let alone CHANGED_INVENTORY) seems to be called when a script is added in this manner. :eek:

That said, workarounds are timer events to check the number of scripts in the prim, link messages, listeners, etc, etc, etc. Just depends on how you want to do it.

Interesting, though. :)
Aritus Anansi
Registered User
Join date: 1 Jul 2004
Posts: 21
01-12-2005 13:58
From: Jeffrey Gomez
Interesting. Just tested, and no changed event whatsoever (let alone CHANGED_INVENTORY) seems to be called when a script is added in this manner. :eek:

That said, workarounds are timer events to check the number of scripts in the prim, link messages, listeners, etc, etc, etc. Just depends on how you want to do it.

Interesting, though. :)


Well I want to ensure that nobody drops a script into the object that shouldn't be there, and this surely must be the most efficient way of doing that. I suppose what would be good to know is if this is something recently broken and used to work? It has to be a bug as it's inconsistent with the changed event being called if a script is removed from the object, which it is.
_____________________
RCR Racing Dosojin 124,15: Race radio controlled cars around specially designed circuits. Visit the Pit Shop to buy your own RC cars and accessories.
Also available for purchase on-line: SecondServer
Want to resell RCR products with a 10% commission? Contact me for details of my RESELLER VENDOR
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
01-12-2005 17:40
You are correct, this behavior is a bug. changed( ) has been bugged for awhile now, certain texture, color, or scale changes wont trigger their CHANGED_* constant counterpart. LSL functions that change the object also don't trigger the changed event.

LL needs to add some consistancy to changed():
ALL scaling operations (even those done with llSetScale()) should trigger a CHANGED_SCALE
ALL texture operations (even those done with llSetTexture) should trigger a CHANGED_TEXTURE
ALL inventory operations (even those done with llRemoveInventory) should trigger a CHANGED_INVENTORY

etc.
I think the changed event has been b0rk3d since I got here, during the beta (v0.5)
==Chris
Apotheus Silverman
I write code.
Join date: 17 Nov 2003
Posts: 416
01-13-2005 09:18
I bug-reported this back in October or November.
_____________________
Apotheus Silverman
Shop SL on the web - SLExchange.com

Visit Abbotts Aerodrome for gobs of flying fun.
Aritus Anansi
Registered User
Join date: 1 Jul 2004
Posts: 21
01-13-2005 09:43
Thanks Christopher and Apotheus. So it appears that this is a known issue and has been for a long time now. OK, I'll work around it. If it hasn't been fixed yet it's pointless waiting to see if it will be.
_____________________
RCR Racing Dosojin 124,15: Race radio controlled cars around specially designed circuits. Visit the Pit Shop to buy your own RC cars and accessories.
Also available for purchase on-line: SecondServer
Want to resell RCR products with a 10% commission? Contact me for details of my RESELLER VENDOR
Don Linden
Bug Reaper
Join date: 14 Jun 2004
Posts: 58
01-13-2005 15:40
I am looking into this. Also, I would like to get some feedback about how the changed event is used.

Currently, calling something like llSetColor repeatedly (applying the same color) triggers the changed event every time. To me, it would make sense if the changed event *only* triggered if there was an actual color change. I would like to 'fix' this behavior.

So... is anyone currently relying on the changed event to trigger everytime a llSet* call is made, even if there is no actual change?
_____________________
Its not a glitch, its a feature.
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
01-13-2005 16:07
The only problem that immediately comes to mind about changing that behavior, Don, is for those scripts calling the changed event as a link in their script. For example:

CODE
state_entry()
{
llSetPrimitiveParams([PRIM_SIZE,<1,1,1>]);
}

changed(integer change)
{
llSay(0,"Current Scale is: " + (string)llGetPrimitiveParams([PRIM_SIZE]));
}

touch_start(integer total_number)
{
llSetPrimitiveParams([PRIM_SIZE,<1,1,1>]);
}


Worst-case, this would force people to just make function, timer, or state calls instead, and I see it as relatively moot in light of getting the change function to be actually called in the first place. Besides. It wouldn't be half as sudden as the collision changes a few patches ago. :D

While you're at it, I believe changing the name of inventory to the same name triggers a CHANGED_INVENTORY event. Not positive since it's been a week since I've tested, but also worth pursuing. :cool:
Moleculor Satyr
Fireflies!
Join date: 5 Jan 2004
Posts: 2,650
01-13-2005 16:35
Please don't remove the "changed but not changed and I'm going to fire anyway" thing.

Why remove options from LSL? Maybe someone in the future would like to use that particular functionality. Maybe someone does so now. Hell, maybe someone coded "badly" and uses it now and doesn't even realize it.

Whatever the case, removing things that could potentially be used in the future (and I can think of one or two uses for changed events firing when nothing is actually changed) is not a good idea. (Please, instead give us things like llLandAutoReturns(), llLandIsNoScript, llLandSize(), llLandAvailablePrims, llLandTotalPrims, llLandUsedPrims, llDetectedCollisionPoint, and other such things.)
_____________________
</sarcasm>
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
01-13-2005 16:42
would be nice if there was a changed event filter, as most of the time we are only looking for the change of just one attribute.

llSetChangedEventFilter(integer flags)
would default to -1
_____________________
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
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
01-14-2005 09:11
I believe changed( ) should only fire when the objects properties actually undergo a change. Does applying the same colour to an object change the object at all? - No.
==Chris
Cross Lament
Loose-brained Vixen
Join date: 20 Mar 2004
Posts: 1,115
01-14-2005 14:58
From: Christopher Omega
I believe changed( ) should only fire when the objects properties actually undergo a change. Does applying the same colour to an object change the object at all? - No.
==Chris


No, it doesn't change anything on the object, as we perceive it. But a call was made that changes the properties of the object... simply the change was to the exact same parameters as it already had. I suppose it depends on what you call 'change': perceivable change, or property-level change. :D

Ie. if I have a white prim, and call llSetColor(<0, 0, 0>, ALL_SIDES);, it'll change the color parameter of all sides to be black. But this is no different whatsoever as calling llSetColor(<1, 1, 1>, ALL_SIDES);... it changes the color parameter of all sides to be white. It doesn't matter if the sides were already white... it's still resetting the color parameters. So in that sense, yes, a change has occurred. :)
_____________________
- Making everyone's day just a little more surreal -

Teeple Linden: "OK, where did the tentacled thing go while I was playing with my face?"