Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: tinchopunk on October 24, 2005, 04:41:44 PM

Title: inventory
Post by: tinchopunk on October 24, 2005, 04:41:44 PM
i want to make an inventory like in the game shelock holmes 2 that you right click of the mouse and apear the inventory and a book that you can go to a map, see past dialogos, etc. How can i do that??? and of course you right click again and diseapear...
thanks
 Martin
Title: Re: inventory
Post by: Mnemonic on October 25, 2005, 07:00:36 AM
I haven't played the game, but from what you described, it could be easily done using a GUI window in WME. Or am I missing something? Remember, the inventory in WME is just a window, and you can add as many controls to it as you want. The tricky part would be the past dialogues. WME doesn't keep track of them, you'd have to script it somehow, such as overriding the default Talk() and GetResponse() methods and store each spoken line and player's response somewhere.
Title: Re: inventory
Post by: tinchopunk on October 25, 2005, 02:43:58 PM
ok. Thanks well the past dialogues can be change cose they are not necesary... another question, how can i do that wen i right click press the windows appear but with a scroll going from the boton and stop. And the same but inverse wen you right click again...
thanks
 MArtin
Title: Re: inventory
Post by: metamorphium on October 25, 2005, 08:09:35 PM
ok. Thanks well the past dialogues can be change cose they are not necesary... another question, how can i do that wen i right click press the windows appear but with a scroll going from the boton and stop. And the same but inverse wen you right click again...
thanks
 MArtin

You want the window with inventory scrolling in from the bottom of the screen after right click?
Title: Re: inventory
Post by: tinchopunk on October 26, 2005, 03:54:35 AM
yes u click and apear, another click disapear. But with scroling, moving up and down to totality of the inventory
Title: Re: inventory
Post by: Mnemonic on October 26, 2005, 05:04:57 PM
It's easy, really ;)
All you need to do is to increment/decrement the X or Y coordinate of the window in a loop.
For example, to slide the window from the right edge of the screen, you'd do something like this (untested):

for(var i=Game.ScreenWidth; i>0; i=i-10)
{
  SomeWindow.X = i;
  Sleep(100);
}

If you want to use it for the inventory, just fill SomeWindow variable with Game.GetInventoryWindow()

var SomeWindow = Game.GetInventoryWindow();

And of course, handling the right click is just a matter of adding an on "RightClick" handler to game.script.

By the way, the WME 3D Demo project already contains a sliding inventory window, but it's not triggered by right-click but by moving the mouse pointer to the top edge of the screen.
Title: Re: inventory
Post by: tinchopunk on October 26, 2005, 11:06:23 PM
thanks!!!