Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Inventory changed to chat

MacDracor Jun
Registered User
Join date: 1 Jun 2007
Posts: 11
09-02-2008 14:57
I have an object being used for a contest. To enter, you'll drop a no copy notecard. When the box is touched, it gives a random inventory item.
What I would LIKE to do is...
if John Doe drops their item in..
Contest Box: John Doe has entered the contest!
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
09-02-2008 18:19
you can not detect who dropped an item.

You could make them "touch" the box, which would start a (15 second? 30 second?) timer.. and allow them to drop an item while the box was green. Then anyone could drop an item while the box was green, and the person who touched it would get credit. You could add a sensor (say 5m).. and seach for the toucher.. and if they left range, the box could go back into "no drop" mode.
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
MacDracor Jun
Registered User
Join date: 1 Jun 2007
Posts: 11
Ok, but still useful to know...
09-02-2008 18:42
I have seen many things that detect changed inventory. How is that done, precisely?
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
09-02-2008 19:03
with the changed event

CODE

changed (integer change)
{
if (change & CHANGED_INVENTORY)
{
//do stuff
}
}



You can detect THAT the inventory HAS changed.. and through some detective work, you can even determine which item is "new" or whether an item was added or removed (by comparing it to a list or count of items from before the drop)... You can also determine who created the new item, but you can't actually discern who dropped it in.
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
MacDracor Jun
Registered User
Join date: 1 Jun 2007
Posts: 11
09-02-2008 19:24
You... ROCK.
Thank you!