Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Susanog on Thu 20/10/2005 10:21:09

Title: Inventory items views
Post by: Susanog on Thu 20/10/2005 10:21:09
Hi there
I was wondering - how do you change the way your inventory item look like ofter you pick it up out of you inventory. Each item in my inventory is on a coloured block (block only shows up after intem in is inventory.) When i take it out of the inventory, i want it to not have the block anymore. what would the coding be if i have two different picture for one item

hope that made sense  ;D
Title: Re: Inventory items views
Post by: Elliott Hird on Thu 20/10/2005 10:55:57
Go into the inv item section, look for a "use sprite option" pick your sprite, Tada.
Title: Re: Inventory items views
Post by: Akumayo on Sat 22/10/2005 03:04:50
On a slightly related subject, don't you think it would be interesting to add something in the repeatedly_execute that would first check to see if you had an item, and if you did woud proceed to animate it by changing it's spriteslot?  I always thaink that would look cool, but haven't seen it in any games.
Title: Re: Inventory items views
Post by: Ashen on Sat 22/10/2005 11:26:38
I think the original question (sorry I'm a bit late) was to change it back and forth in-game, rather than set it in the editor.

There's the InventoryItem.Graphic property. You could run a check in rep_ex for what item is the active inv, and change it's sprite accordingly, then change it back if it's not active. You may want to give each item two properties, to store the 'block' graphic slot, and the 'real' graphic slot. Cumbersome, but I can't think of another way off the top of my head.

Akumayo:
strazer's written a script module that allows you to do just that. Preliminary version is available here (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=22888.msg281466#msg281466).
Title: Re: Inventory items views
Post by: Akumayo on Sat 22/10/2005 16:20:45
Oh, thanks Ashen, I guess it's not a new idea at all  :)  I'll have to download that.
Title: Re: Inventory items views
Post by: Susanog on Sat 22/10/2005 19:55:27
Thank you Ashen, and also everyone else for trying to help ;D