Jump to content

Detect when prim inventory changes (child prim perspective)


Errset
 Share

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

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

Recommended Posts

So I'm experimenting around with change events on prims. I know that you can detect when an inventory change happens on a prim from the 'parent' prim's perspective, but is there a way of detecting when a prim is inserted into another prim's inventory from the child perspective? Does anything detail wise on the child prim change when it is inserted into another prim?

 

I'm fairly new to scripting in second life so I'm still learning the caveats of the language.

 

Thank you!

Link to comment
Share on other sites

I imagine you'd need to have a script inside the target child prim which has its own changed event logic. Additionally , when CHANGED_INVENTORY fires, you could check llGetInventoryNumber against a saved value captured when the script first inits. If the returned value is different from the baseline, then you'll know the target prim gained some inventory.

Alternatively, I think you can accomplish the same thing without need of a script in the child prim by using llGetObjectDetails(llGetLinkKey(<child_prim_link_number>), [OBJECT_TOTAL_INVENTORY_COUNT]) to remotely query the child prim's inventory count from a single script in the root.

Edited to add a correction: OBJECT_TOTAL_INVENTORY_COUNT, even if used targeting a chid prim will only return the total inventory count for all members of the linkset combined. So my idea for using that from the root wouldn't work. I think your best bet is to have a script in the target child prim with its own changed event logic as outlined in the first part of my post.

Edited by Fenix Eldritch
correction after trying it inworld
Link to comment
Share on other sites

Hmm, I guess the more important question is when a prim (child) is put into the inventory of another prim (parent), does anything on the child prim change that could be captured? So far i haven't seen anything but i'll keep experimenting

Edited by Errset
Link to comment
Share on other sites

That's not the same question, because an object in the contents of another object is not linked to it.  It's not a "child" in the linkset.  And no, you can't tell anything about what that object in Contents may contain.  All you can tell is its type, its name, its creator, and (for some assets) its UUID.  

Edited by Rolig Loon
Link to comment
Share on other sites

My apologies, I was thrown by your use of the terminology a bit. Seeing "parent" and "child" in the context of SL often refers to linksets and their ordering within it. If you're talking about what happens to objects that get put into inventory, that's something else.

As far as I'm aware, objects that get put into inventory are essentially dormant. Not much will change other than perhaps the current owner key and the object's permissions in cases where the object being given originated from a different user. With that in mind, you might be able to detect a change by using llGetInventoryPermMask but that assumes you can discover the permissions of the object before it gets put into another object's inventory AND that they are set to be different for the next owner... I think? I'm not entirely sure...

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1536 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...