Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: spook1 on Thu 12/06/2003 12:41:20

Title: How to remove and display inv.items in inv.window??
Post by: spook1 on Thu 12/06/2003 12:41:20
I try to handle inv.window in a global script. Unchecked the "handle inventory items..." in the AGS main menu.
Now when I pick an inventory item from the inv. window, it is not removed from there.
How can I turn it off??

I hope someone can help.

Kind regards,

Martijn
Title: Re:How to remove and display inv.items in inv.window??
Post by: Scorpiorus on Thu 12/06/2003 15:08:27
QuoteNow when I pick an inventory item from the inv. window, it is not removed from there.
How can I turn it off??
You mean you want to know how to remove it? I just ask because AGS sets up the inv cursor to appear with an item image but the last is not remove from the inventory. It's by-design.
You could do it manually:

LoseInventory(<item>);

or if that will change the cursor then the next instead:

character[GetPlayerCharacter()].inv[<item num>] = 0;
UpdateInventory();


but once you want to change the active item you have to get it back to the inventory, so it wouldn't get lost:

int active = character[GetPlayerCharacter()].activeinv;
character[GetPlayerCharacter()].inv[active] = 1;

//then choose another one

QuoteUnchecked the "handle inventory items..." in the AGS main menu.
You want to say it's checked? Or otherwise you can't handle 'em.

-Cheers
Title: Re:How to remove and display inv.items in inv.window??
Post by: spook1 on Fri 13/06/2003 14:07:43
Thanks for the help. It owrks great!

martijn