Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: amanta4ray on Sat 19/04/2008 13:47:49

Title: Inventory items not showing up after Setasplayer
Post by: amanta4ray on Sat 19/04/2008 13:47:49
Hello everyone,

        I have a game where you switch player characters, but the problem is when you switch back to the original player character, any items the player picks up does not show in inventory window.  I have tried update inventory, but it doesn't seem to do anything.

       
            Any help would be appreciated...
Title: Re: Inventory items not showing up after Setasplayer
Post by: Khris on Sat 19/04/2008 14:59:42
Every character has their own inventory. Are you using the default inventory GUI or a custom one?
Title: Re: Inventory items not showing up after Setasplayer
Post by: amanta4ray on Sat 19/04/2008 15:09:00
I'm using the default inventory window.

       
 
       
Title: Re: Inventory items not showing up after Setasplayer
Post by: Khris on Sat 19/04/2008 15:28:54
Ok. Afaik, the default one will always display the inventory of the current player character.
Which version of AGS are you using and how are you adding inv items (player.AddInventory(iKey);)?

To solve your problem, you can either
-use a custom gui with an inv window set to display one character's inv and always add new items to that char
-move all inv items to the other char during the switch

Depending on your answers, one of the two will probably be preferable.
Title: Re: Inventory items not showing up after Setasplayer
Post by: amanta4ray on Sat 19/04/2008 15:52:29
Thank-you very much for the help!!!

                I'm not very good with GUI's so I just use whatever is there.  Usually, I add the items by player.AddInventory(iwhatever) and am using AGS 3.0.  Even though I read that about each player having their own inventory, I didn't realize that you had point it back when you switch characters.  I thought it just switched with them.   Now, I am using the invWindow.CharacterToUse script and everything works fine.

                   Sorry about posting too soon!!!!  :)