Inventory items not showing up after Setasplayer

Started by amanta4ray, Sat 19/04/2008 13:47:49

Previous topic - Next topic

amanta4ray

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...

Khris

Every character has their own inventory. Are you using the default inventory GUI or a custom one?

amanta4ray

I'm using the default inventory window.

       
 
       

Khris

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.

amanta4ray

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!!!!  :)

SMF spam blocked by CleanTalk