Jump to content

What is the throttle for CHANGED_INVENTORY ?


Miranda Umino
 Share

You are about to reply to a thread that has been inactive for 3508 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I am using the change event and i check with it CHANGED_INVENTORY .

 

When i remove ( or when i add) several items in the content inventory of the prim , for instance 30 objects , several change events are triggered .

Not one per item added or deleted but one by "block"

 

Does someone know  if the size of the number items changed before to trigger an another change event is fixed ?

Is it variable ? What is the rule exactly ?

 

 

Link to comment
Share on other sites

I don't know the answer to your question.

I myself had some trouble in the past with this event being triggered "randomly" when more than one objects are being added/removed.

What I did was simple, maybe this can help you.

    changed(integer change)    {        if (change & CHANGED_INVENTORY)        {            llSetTimerEvent(2);        }    }        timer()    {        llSetTimerEvent(0);        //do stuff here    }

 So this triggers whatever you need to happen 2 seconds after the inventory last changed. And since this timer is reset to 2 seconds everytime the inventory is changed, it disregards how many times the inventory is changed and only triggers once, after 2 seconds.

 

Hope it makes sense.

Link to comment
Share on other sites

I don't know either, but I would expect it to be highly variable because the process of adding or removing inventory to an object must be parallel to (and almost completely independent of) the script scheduler's check of whether an event handler should run. I'd also expect this to be highly dependent on sim lag and the number of scripts in the sim, on the rationale that there's some minimum slice of each frame that will be alloted to scripts, but that otherwise scripts have the lowest priority of any task in the frame, so that will affect how far inventory operations can proceed before a CHANGED_INVENTORY script gets a chance to run.

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3508 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...