Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: Art on April 06, 2006, 02:18:55 PM

Title: Different inventories for different actors
Post by: Art on April 06, 2006, 02:18:55 PM
Sorry for may be lame question, but i really could not get result myself, and did not find any help on forum.

So i have a classic problem. There are two main actors on my game. I change between them pretty well by updating Game.MainObj property. But, I also want these actors to have different inventories. I tried to use following code:
Code: [Select]
spirit.TakeItem( "astral_tele" );
Game.LOG( spirit.HasItem( "astral_tele" ) );
Game.LOG( Game.IsItemTaken( "astral_tele" ) );
Game.TakeItem( "astral_zre" );

What i get:
astral_tele - is taked, as show LOG functions, but i can't see it in inventory
astral_zre - is also taked (globally), and i can see it in inventory, but the problem is - it was not taked by exact actor.
Title: Re: Different inventories for different actors
Post by: Art on April 06, 2006, 02:34:02 PM
I've found answer myself in manual:
Quote
Multiple inventories

In WME each object (game, actors, entities) can have its own private inventory. It's mainly useful for games with multiple main characters. In that case you can control whose inventory is currently displayed on screen. This is done by setting the Game.InventoryObject attribute. By default this attribute is set to the Game object, which is just fine for single-inventory games. If you have multiple switching actors you'll want to set this attribute to the current actor.