Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: Different inventories for different actors  (Read 2880 times)

0 Members and 1 Guest are viewing this topic.

Art

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 54
    • View Profile
Different inventories for different actors
« 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.
« Last Edit: April 06, 2006, 02:23:16 PM by Art »
Logged

Art

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 54
    • View Profile
Re: Different inventories for different actors
« Reply #1 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.
Logged
 

Page created in 0.111 seconds with 19 queries.