Quote: "Well, the problem is, currently WME supports only one inventory. If you need to display both the inventory AND the spells..."
From the WME documentation: (inside a game/working with the inventory)
quote: "Taking, dropping, destroying and querying items
You generally reference inventory items by their name. If you want to take an item into inventory, use the Game.TakeItem(), for example:
Game.TakeItem("book");
This will add the "book" item into inventory. If you are using multiple inventories, you'll need to call the TakeItem method on the actual object you want to take the item, for example OldGuy.TakeItem("book");
Removing item from inventory works in a similar fashion. Only use the Game.DropItem() method instead:
Game.DropItem("book");
This command will remove the item from inventory. Although the inventory item is no longer displayed in the inventory, it may be reused later. If you want to remove the item from the game permanently, use the Game.DeleteItem() method.
You can query an item using the Game.GetItem() method. It will return an item object which can be used to set item's attributes.
To query if a certain object is taken by some game object, use the Game.IsItemTaken() method. It will search the inventories of all game objects to see if one of them has the item taken. On the other hand, the game objects provide a HasItem() method, which you can use to ask one concrete object if he has the item.
Example:
// has anyone the book?
var IsBookTaken = Game.IsItemTaken("book");
// has OldGuy the book?
var OldGuyHasBook = OldGuy.HasItem("book");
(...)
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."
Well what do you say now? (sorry for being sarcastic)
Maybe you're right in the documention, maybe you're right here when you speak,
but I wanna know which of your statements is true, if it's not too much to ask for. (sorry for being so demanding)
As for the code...
I've made one window that displays the inventory on top if it only if a certain variable is greater than 3 . I'll make that later, and remove the loops too, you don't have to worry too much about them, it's the "spells.InventoryVisible=true;" that doesn't work.
When I use the code for the regular inventory it works just fine.
the "LeftClick"... part is inside an objects script, so that when you "Look" at it the spells entity will take the song spell.
I've figured out a way around that, by using more variables. Like when the spelltake variable is 1, the spells entity will take spell 1 and set it to 0. When it's 2, it will take spell 2 and set it to 0, and so on. U can't do this from another entitys script?
Anyway, it should work.
But the problem is, that I can't make the spells inventory visible.
I thought this engine really rocked when I read that about multiple inventories. And now I can't...