Forum rules - please read before posting.

Which item belongs to which player?

Hi!

I set up AC for 2 players, with switching allowed. The game is turn based, and in between turns the active player can give items to the other player. Both players have an inventory menu, which uses the AC InventoryBox menu.

For the item giving, I created a custom menu, which grabs the RuntimeInventory.localitems, and displays their labels for the player to make a selection of items to give. (possible important note: this menu does NOT use the AC inventoryBox menu component).

After selecting a few items, the turn passes over to the other player. I do some RuntimeInventory.Remove() and Add() to register the transaction. When I look at the inventory menu of the new player, the transaction looks succesfull. All items I gave away, now apear in the inventory of Player2. 

However, when I now go into the trade menu, again grabbing the localitems to create a list of tradeable items, I get a totally different list! In short: the InventoryBox menu's show the correct items after a trade, but the runtimeinventory.localitems seems to be screwed. 

Any idea whats going wrong?  

Comments

  • Oh and yes, they each have their own inventories set in the settings. 
  • Switched the localItems call for the KickStarter.saveSystem.GetItemsFromPlayer(int playerID) one, and update it continuously for now. It works! 
  • You may be able to populate the menu at the moment it's turned on, rather than every frame - that should be more efficient.  At least you have it working, however.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.