Hey! I have a few questions...
1 - How can I use my inventory when the GUI is hidden (called only by script)?
2 - How can I use a item from my inventory only in a determined situation?
3 - For example, the player gets a knife on his inventory, and then a new area of the game opens. How can I do that?
Thanks!
For simple checks to see if the player has the inventory item before moving to another room, use player.HasInventory(itemid);
So:
if (player.HasInventory(iKey)) player.ChangeRoom(3);
If you need to change the appearance of a particular room while the character is in it you can use the on_event function (this is built-in and doesn't require binding in the room editor):
function on_event(EventType event, int data) {
if (event == eEventAddInventory) {
if (data == iKey.ID) oDoor.Visible = false;
}
}
But how can I, in the moment of fight, show the inventory with the knife on it, if the inventory is hidden? What script can I use?
gInventory.Visible = true;
With the default settings, this will pause the game. If you want to change that, just change the visibility setting on the gInventory properties pane to "Normal, initially off" or the respective setting as you want.
Oh my god, I'm terrible at that. Can you just add me on msn, to help me with this part, please?