I am trying to make it so that my player can move normally as usual, but when the player presses the "i" key, I want the player's inventory to show, I want the mouse cursor to appear in order to manipulate the inventory, and I want the player's movement to cease, all happening simultaneously. If the player presses the "i" key a second time, I want the inventory to close, the mouse cursor to disappear, and the player be able to move again normally.
Here is the code I am using to try and make this happen
var bag_i_counter = 0;
function change_mouse_mode()
{
mouse_mode += 1;
mouse_mode %= 2;
if (1 == mouse_mode)
mouse_map = cursor_pcx;
}
...
if(key_i)
{
bag_i_counter = 1;
if(bag_i_counter == 1)
{
inv_open_bag(bag, 500, 0);
mouse_mode = 1;
if(key_i)
{
bag_i_counter = 0;
inv_close_bag(bag);
mouse_mode = 0;
}
}
}
When I run this code, all I see is this error box stating this:
Error E1512
Empty function called in inv_open_bag
I press the OK button, but nothing happens. The inventory does not show up, the mouse cursor does not show up, and my player can still move about as normal.
****************
Keep in mind that I do not have a fully functioning inventory yet. I am including the "inventory.c" code by Bret Truchan. In the past, when I pressed the "i" key, the only thing that happened was I got the same error message above.
When I pressed the OK button on this error box, I saw a horizontal row of images that I placed in the inventory slots using my Lite-C code, and was even able to drag the first image from the row across the screen.