Yo!
Hiya! Sorry I didn't reply earlier, but I'm mostly offline this week.
Okay, I'm an artist, not a coder, so I was wondering if anybody found or created a code to make that "free position inventory" that was discussed earlier?
Well, I don't know, I've heard McCoy was experimenting with the inventory. McCoy? Are you reading this?
Maybe I'll try to implement the "free pos inv" when I have some time. But I suppose it will require a LOT of scripting.
Is there a way to display a screen centered inventory window without an "If" and "else" statement in code?
The position of the inventory is given by the "inventory box" definition file, which you've probably modified to add the backpack picture.
The definition file should contain comething like this:
WINDOW
{
X = 240
Y = 105
WIDTH = 555
HEIGHT = 532
IMAGE = "inv_back.bmp"
}
So simply by changing the X, Y, WIDTH and HEIGHT you can define the exact position of the inventory. Or am I missing something here?
I've managed to rig the interface/menu/menu.script to have a button in the menu bar (ie, take, look at, talk...) to open the inventory window with an "If (menuObject = null..blah blah,...) Game.InventoryVisible = true" statement but cannot seem to close it. I was hoping somebody could tell me the right code to tell the game to open the inventory window (even with using the "tab" button) and then close the window on right-click or anywhere clicked outside of the inventory window.
Ok, to close the inventory by clicking outside of it, just add EXCLUSIVE = TRUE somewhere to the inventory definition file. And to add a close button, you'll have to insert a button definition inside the code above. Something like this:
WINDOW
{
X = 240
Y = 105
WIDTH = 555
HEIGHT = 532
IMAGE = "inv_back.bmp"
; close button
BUTTON
{
NAME = "close"
X = 0
Y = 0
IMAGE = "someimage.bmp"
}
}
Of course, you'll have to change the position accordingly. All the window/button definition elements are described in the WME documentation.
To open/close inventory using a TAB key, you'll have to modify the game.script, namely the
on "Keypress" part.
Add the following line to the "Keypress" handler:
if(Keyboard.KeyCode==VK_TAB) Game.InventoryVisible = !Game.InventoryVisible;
I know it may seem messy to you as a non-programmer, but fortunately these interface-related tasks are only done once