Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Chim on Wed 20/10/2010 14:09:28

Title: Core function Customization (AddInventory)
Post by: Chim on Wed 20/10/2010 14:09:28
Hello AGS community,

I would to know if there is any way to modify and customize a core function such as AddInventory()

I am currently working on a GUI that displays the inventory status bar for a few second every time an item is received and that would help me greatly if I could customize this function.

Cheers !
Title: Re: Core function Customization (AddInventory)
Post by: Wyz on Wed 20/10/2010 14:17:31
No there is not, but for AddInventory you are in luck.
There is a special event triggered each time inventory is added are lost.

function on_event (EventType event)
{
    if (event == eEventAddIneventory)
    {
        // ...
    }
    else if (event == eEventLoseInventory)
    {
        // ...
    }
}
Title: Re: Core function Customization (AddInventory)
Post by: Chim on Wed 20/10/2010 14:23:36
Cool, thank you very much, I'll try that right away :)