Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Event for Dropping One Object on Another

Moose Pegler
Registered User
Join date: 22 Apr 2006
Posts: 33
10-27-2006 05:47
Is there any event for dropping one object on another? I understand that dropping an object on an av triggers the attach event in the dropped object? Is there any corresponding way/hack/trick for either the dropped or the droppee to react to one being dropped on the other?

Thanks for any insight.

Cheers, Moose
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
Not sure what you want....
10-27-2006 08:16
The changed() event is triggered if you drop an object into the inventory of the object with the script. I am not aware of any event that happens if you drop an object onto another object...unless you count on_rez(), which happens when you drag an object into the world.
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
10-27-2006 08:20
What do you mean by "dropping on another" from the title I was going to point you in the way of the collision events.

The rest of the context suggests you mean something else... I'm not sure if you're talking dropping on as in "adding to inventory" or dropping on as in adding to and linking.

If it's either of those, the changed event is the place to start. You can use (in part of your script)

CODE

changed(integer change)
{
if(change & CHANGED_INVENTORY)
if(change & CHANGED_LINK)
}

to sort them out.
_____________________
Eloise's MiniMall
Visit Eloise's Minimall
New, smaller footprint, same great materials.

Check out the new blog
HtF Visconti
Registered User
Join date: 21 Jul 2006
Posts: 123
10-27-2006 08:20
This is indeed maybe a problem of wording.

To drop something onto something I understand as placing it physically on top of something, whereas to drop something into something I'd take as putting into the other object's inventory/content.

For the "on top" thing you can use collistion/volume detect - for the into thing you can use, as stated before, the change and with the CHANGED_INVENTORY flag.

Edit: Drat, Eloise must have been a microsecond faster :)