Wintermute Engine > Technical forum

Inventory and response area always on top

(1/5) > >>

Indra Anagram:
Hello, WME forum community!

I am trying to make a 2D game and my inspiration is The Cat Lady. In The Cat Lady in most scenes there is constantly inventory box on top, which changes to black rectangle for response options. I'd like to achieve following features for the inventory and response areas in my game:
1. At the bottom of screen
2. Constantly on top of the scene (see screen)



3. Become darkened and inactive during scripted behavior, some dialogues and cut-scenes (smth. like in the screen below)



4. Black rectangle background for response options - like this:



I know such things ARE possible with WME, and there is a chapter dedicated to dealing with inventory in WME documentation and Book online. However, I can't figure out how to send inventory window to the bottom of screen and keep it functional and always on top. See, like it was said in documentation, I changed Y value of WINDOW from 0 to 510 in inventory.def, but it keeps being dependable on cursor at the top of screen. If cursor moves to the bottom of screen, inventory just disappears. Changing AREA values made no good. I guess something must be altered in game_loop.script... If so, what exactly? After spending a considerable time with those scripts open in Notepad, I opened inventory.def in WindowEdit tool and tried changing several things (like setting InGame control to "True") and... nothing changed. Except inventory.def changed its structure when I reopened it in Notepad and it became very hard to read, because all lines got aligned horizontally.  ???

I am sure someone might have dealt with inventory objectives similar or close to mine, because it is typical for many adventures to have inventory and response areas at the bottom of screen and visible constantly. Could you please share your experience in that matter? Any ideas?

Big Thanks!!!

Indra Anagram:
Hey Muties!

It seems I've managed to solve points 1 and 2 of the "wishlist" for inventory area. Maybe... Would be great if someone more experienced confirms if this was done correctly.

First, I opened game_loop.script and set Game.InventoryVisible after "else if" to "true" (it was "false" by default):


--- Code: WME Script ---  // display the inventory window  if(Game.Interactive && Game.MouseY < 45 && !Game.ResponsesVisible && !WinMenu.Visible) Game.InventoryVisible = true;  else if(Game.MouseY > 100 || Game.ResponsesVisible || !Game.Interactive) Game.InventoryVisible = true; 
Second, I opened inventory.def and changed Y value from 0 to 510:


--- Code: WME Script ---  WINDOW  {    X = 0    Y = 510    WIDTH = 800    HEIGHT = 90    IMAGE = "interface\inventory.bmp"
Now the scene looks this way, with inventory always being on top (even during scripted events with no interactivity for player):



And here I'm seriously stuck... During scripted events the window stays white and I need it to:


--- Quote ---3. Become darkened and inactive during scripted behavior, some dialogues and cut-scenes (smth. like in the screen below)
--- End quote ---

Also currently during the dialogue response options appear on top of inventory window. However, I wish there was


--- Quote ---4. Black rectangle background for response options
--- End quote ---


Any ideas on how 3 and 4 could be achieved?

Thanks for your attention and any kind of advice!

 



anarchist:
First, since you want the inventory window to always be visible, you can completely remove the below code:


--- Code: WME Script ---// display the inventory windowif(Game.Interactive && Game.MouseY < 45 && !Game.ResponsesVisible && !WinMenu.Visible) Game.InventoryVisible = true;else if(Game.MouseY > 100 || Game.ResponsesVisible || !Game.Interactive) Game.InventoryVisible = true; 
The above code is useful when you only want to display the window when the cursor moves to a particular area of the screen. But, you want it to always be visible, therefore remove the code. A programming hint: when you have if/else and they both do the same thing, you probably don't need the if/else. In your case you have an if/else if, but judging by what you want, you don't need it.

As for modifying the inventory window on the fly, take a look at the command GetInventoryWindow() to "get" the window. After you have the window in a variable, you can handle it like any other window (I have never done this so please test). I guess you can use inventoryWindow.SetImage() to change the background. I guess the same applies for responses window, where you can use Game.GetResponsesWindow().

Indra Anagram:

--- Quote from: anarchist on November 15, 2017, 04:52:01 PM ---As for modifying the inventory window on the fly, take a look at the command GetInventoryWindow() to "get" the window. After you have the window in a variable, you can handle it like any other window (I have never done this so please test). I guess you can use inventoryWindow.SetImage() to change the background. I guess the same applies for responses window, where you can use Game.GetResponsesWindow().

--- End quote ---

anarchist, great!  ::thumbup Hopefully I'll be able to figure out how to use those commands through testing)))


--- Quote from: anarchist on November 15, 2017, 04:52:01 PM ---First, since you want the inventory window to always be visible, you can completely remove the below code
--- End quote ---

anarchist, THANK YOU for this advice! What if I place some video files between scenes? Will the inventory window still be visible then?

P.S. Please kindly view my last reply in the previous post (about scripted *cutscene*).

Indra Anagram:

--- Quote from: anarchist on November 15, 2017, 04:52:01 PM ---As for modifying the inventory window on the fly, take a look at the command GetInventoryWindow() to "get" the window. After you have the window in a variable, you can handle it like any other window (I have never done this so please test). I guess you can use inventoryWindow.SetImage() to change the background. I guess the same applies for responses window, where you can use Game.GetResponsesWindow().

--- End quote ---

anarchist, I tried the commands, but since there is no information in tutorials about what exactly should be inside brackets, I inserted path to the definition file ("interface\inventory.def"), but it didn't work. What exactly should be inside? What value? And what would the code be like, if I want the inventory window dynamically change during scripted things and be replaced with response window?

About responses window...


--- Code: WME Script ---  WINDOW  {        X = 0    Y = 510    WIDTH = 800    HEIGHT = 180    IMAGE = "interface\dialog.png"
I opened responses.def and changed Y value from 0 to 510 just like with the inventory window, however when I run the game, the background image seems to cover response options, so it is impossible to click on them.

Can't figure out what to do with this either  :P

Please help me, if you've got any idea about the values and use of GetInventoryWindow(), inventoryWindow.SetImage() and Game.GetResponsesWindow() commands.

HUGE THANKS!

Navigation

[0] Message Index

[#] Next page

Go to full version