I'm new to this forum so I'll start by saying hello to everyone. Hello!
I've been using Wintermute (which is an awesome bit of kit) for a few months now, and I think I understand the basics.
Now things are getting a bit more advanced, I'm having a bit of trouble with utilising windows to create an inventory that opens when the player clicks on an inventory icon in the top left hand corner of the screen (a bag).
The icon displays great. It's hidden when I don't need it and it doesn't break the game. What I'm trying to do now is when the player left clicks the icon, a window appears displaying the "inventory" (although I haven't coded this bit yet).
The code I have implemented thus far is as follows:
game.script
//load the inventory window
var WinInventoryOpen =
Game.
LoadWindow("interface\inventory\inventory.window");
//load the inventory bag icon
var WinInventoryIcon =
Game.
LoadWindow("interface\inventory\inventoryicon.window");
//Hide the inventory window
WinInventoryOpen.
Active =
false;
//hide the inventory icon
WinInventoryIcon.
Active =
false;
scene_init.script (for a scene in which I
don't want the inventory icon OR window to display:
//load the inventory window
var WinInventoryOpen =
Game.
LoadWindow("interface\inventory\inventory.window");
//Hide the inventory window
WinInventoryOpen.
Active =
false;
//load the inventory icon
var WinInventoryIcon =
Game.
LoadWindow("interface\inventory\inventoryicon.window");
//Hide the inventory icon
WinInventoryIcon.
Active =
false;
scene_init.script where I want the
icon to display, but not the window
//get the inventory icon
var WinInventoryIcon =
Game.
LoadWindow("interface\inventory\inventoryicon.window");
//and display it
WinInventoryIcon.
Active =
true;
//load the inventory window
var WinInventoryOpen =
Game.
LoadWindow("interface\inventory\inventory.window");
//but make it disappear until needed
WinInventoryOpen.
Active =
false;
and finally, the script for when you click the icon, when the inventory window should display:
var WinInventoryOpen =
Game.
LoadWindow("interface\inventory\inventory.window");
////////////////////////////////////////////////////////////////////////////////
on "LeftClick"
{
WinInventoryOpen.
Active =
true;
}
The behaviour at the moment is that the inventory icon displays and hides when I want it to, but the inventory window is always there.
What have I done wrong here?
Thanks for your responses in advance.
Squin