Author Topic: OnDisturbed help  (Read 316 times)

Legacy_doomie22

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
OnDisturbed help
« on: October 27, 2010, 11:43:01 pm »


               Hi,

I am trying to create a max limit on items in a chest.

I am trying to set it up using the OnDisturbed section.  Is there a way of checking if an item is being put in so I can add or take away a stored int?

If not, anyone know of another way?

Thanks,

 
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
OnDisturbed help
« Reply #1 on: October 28, 2010, 12:54:20 am »


               // Get the type of disturbance (INVENTORY_DISTURB_*) that caused the caller's
// OnInventoryDisturbed script to fire.  This will only work for creatures and
// placeables.
int GetInventoryDisturbType()

Uses these consts:

INVENTORY_DISTURB_TYPE_ADDED
INVENTORY_DISTURB_TYPE_REMOVED
INVENTORY_DISTURB_TYPE_STOLEN

So,
if (GetInventoryDisturbType() == INVENTORY_DISTURB_TYPE_ADDED)

is what you want.

Funky