I've been trying to get help for this for a while now. So there's that.
I've been following this tutorial (but with some things removed to fit what I wanted). I finished the second part and decided to mess around a bit by changing the
to "inv_slots = 10" but then it broke; the inventory menu/gui didn't draw. It's set to where it draws when you open the game so pressing "I", the button you use to open the inventory, wouldn't matter. But even when I press "I", it doesn't work.
The only other thing I can currently remember doing was adding
to make the items random each time (as the items are currently randomized because that's what was called for in the tutorial for testing?). If I remember anything else, I'll be sure to add.
Here are some bits of the coding I think could be relevant:
While looking around, the only theory that came to mind was "perhaps I accidentally removed an "if(!show_inventory) exit;" but that didn't work. I also had the debug(ger?) redirect me to my player object's Step Event which doesn't have anything to do with anything and was working perfectly well. (It did give me the chance to change the controls from arrow keys to WASD lol) And to be honest, I'm not sure how I could even fix this in general? What do I Google? I looked for anything off in the code and checked the comments section. No luck. (I'm also new to GML and coding in general so...there's that)
I've been following this tutorial (but with some things removed to fit what I wanted). I finished the second part and decided to mess around a bit by changing the
Code:
inv_slots = 15;
The only other thing I can currently remember doing was adding
Code:
randomize();
Here are some bits of the coding I think could be relevant:
Code:
///getting the inventory on screen.
depth = -1;
scale = 1;
show_inventory = true;
inv_slots = 15
inv_slots_width = 5;
inv_slots_height = 3;
Code:
if(!show_inventory) exit;
/// inventory back
draw_sprite_part_ext(
spr_inv_UI, 0, cell_size, 0, inv_UI_width, inv_UI_height,
inv_UI_x, inv_UI_y, scale, scale, c_white, 1
);
Code:
/// i = open up the inventory.
//if(keyboard_check_pressed(ord("I"))) { show_inventory = !show_inventory };
if(keyboard_check_pressed(ord("I"))) { show_inventory = !show_inventory };
/// r = reset
if(keyboard_check_pressed(ord("R"))) { game_restart() };
/// r = close game
if(keyboard_check_pressed(ord("P"))) { game_end() };
if(!show_inventory) exit;
While looking around, the only theory that came to mind was "perhaps I accidentally removed an "if(!show_inventory) exit;" but that didn't work. I also had the debug(ger?) redirect me to my player object's Step Event which doesn't have anything to do with anything and was working perfectly well. (It did give me the chance to change the controls from arrow keys to WASD lol) And to be honest, I'm not sure how I could even fix this in general? What do I Google? I looked for anything off in the code and checked the comments section. No luck. (I'm also new to GML and coding in general so...there's that)