Jump to content

how to tell owner of new contents item


Restless Swords
 Share

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

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

Recommended Posts

someone drag and drops an item into my receiver object.  the new item is immediately is owned by my receiver object (and me) and the changed event can log and test what item was just added, but cannot tell that items previous owner?

- how can i tell who dropped the new object into my receiver object ?

Link to comment
Share on other sites

You can't.  You can guess if you also manage to simultaneously record a touch on your object and grab the person's name.  Another ploy is to trigger a short range sensor in a changed event that tests for CHANGED_INVENTORY.  With either method, you'll still need to have some way of telling which item was just added to inventory, so that you can make an entry of [new item name, new item's owner] in a strided list.  You can do that by clever use of a list comparison routine.

Nothing is foolproof, of course. A sensor could tag the person standing next to your real donor, or two people could drop things in at once, or the donor could be standing just outside sensor range, or....   Still, you can go nuts trying to script around lower-probability cases.  Get the basics working first and then try to plug as many holes as you can.

Link to comment
Share on other sites

If you always assume the object being dropped was created by the person dropping it, you can use llGetObjectDetails and OBJECT_CREATOR to get the creator of the object.  I used this successfully at one time for vendor gift cards.


EDIT:  Brain lapse, as Innula pointed out below, I recommended the wrong function.  Somehow my mind got set on llGetObjectDetails, when I really meant llGetInventoryCreator.  *slaps forehead*

Link to comment
Share on other sites

I don't understand.  For llGetObjectDetails  you need  the object's uuid, which isn't going to be available while the object is inside the inventory of another object and not rezzed in world, is it?

You could use llGetInventoryCreator, so long as all the object's components are by the same creator.   If, though, the object in question is a scripted object and I've made the prim and you've made the script, that's not going to work (just as it won't show the object's creator on inspection in your inventory if that's the case).

 

Link to comment
Share on other sites


Innula Zenovka wrote:

I don't understand.  For llGetObjectDetails  you need  the object's uuid, which isn't going to be available while the object is inside the inventory of another object and not rezzed in world, is it?

You could use
, so long as all the object's components are by the same creator.   If, though, the object in question is a scripted object and I've made the prim and you've made the script, that's not going to work (just as it won't show the object's creator on inspection in your inventory if that's the case).

 

My apologies. I meant llGetInventoryCreator, but somehow my brain grabbed ahold if llGetObjectDetails and ran with it.  There is no way to get a creator from an object's inventory using llGetObjectDetails but my mind must've been somewhere else.  I remember thinking, but wait... you can get the creator from an inventory item, because I had used it as a gift card system years ago... but yeah... my brain locked on llGetObjectDetails and the rest is history. Sorry for the confusion, OP.

Very good point Innula.  This function is best used if you're the creator of the object and author of the script(s).  Since I used it for gift cards that I made myself, it wasn't a factor.

Link to comment
Share on other sites

1) The objects being dropped inside are in-world prim coins, so the owner dropping them is not the creator of the coins being dropped.  so sadly that (getting creator) does not help

2) I considered scanning for close avatars, but typically there are several so that does not help

3) CTRL-Drag a coin into the payment box does not cause a Touch or Collision event (that would have been REALLY nice.)

3) Best i have come up with is when contents changed even occurs, when coin is deposited, to SAY a message saying to touch the payment box to get payment credit.  A little sloppy but sort-of functional

ANY and ALL other ideas still appreciated.

 

Link to comment
Share on other sites

If you are scripting the coins, how about asking people either to rez the coin on top of the prim or (if rezzing is an issue) simply to wear the coin?

The coin then sends a message to the box, which collects all necessary information about the coin's owner, value of the coin and so on, and processes it as you wish.   The coin's script then autodeletes (or deletes the coin, too, if it's rezzed rather than worn) to prevent it being "spent" again.

Would that be a possible work-round?

Link to comment
Share on other sites

Option #3 is really your only sure way.  I agree that it's a little sloppy, because it requires an extra click.  You can disguise it, though, as a "security measure".  Set llAllowInventoryDrop(FALSE) until the user clicks the prim to "authorize security access".  Then capture the user's UUID and set it TRUE until the changed event reacts to CHANGED_INVENTORY. There's still a chance that the person next to your donor has clicked the object, of course, so you can try to minimize false hits by

1. Setting llAllowInventoryDrop (FALSE) again if there's no inventory change within 5(?) seconds or if someone else touches your object before there's an inventory change.

2. Firing a very short range sensor when a user clicks, and only allowing inventory drop if the user is within 3m.

3. Not allowing an inventory drop if anyone else is within 10(?)m.

I'm sure there are other traps you can lay too. There's no way to make the system foolproof, but you should be able to block a lot of the problem cases.

 EDIT:  Ah, I like Innula's idea too.  It's a variation on the method that a lot of merchants use for in-world gift cards or "credit" cards. Wear the card and deduct value from it after a vendor verifies that the card is legitimate and has recorded its owner's UUID.

Link to comment
Share on other sites

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