Game Maker Studio: How to Create a Easy Inventory System for PC?

Channel:
Subscribers:
268
Published on ● Video Link: https://www.youtube.com/watch?v=LOo50fcDM5A



Duration: 23:56
114 views
0


​GMS File: https://rb.gy/dr71gd

Similar Video: https://rb.gy/wngtd5

Code File: https://rb.gy/ar3aid

Link on how to save a INI File, https://rb.gy/6zfls8

Note: 2/21/21: If you wanted to continue to the next room with your inventory you collected from the first room, you can do this. Make o_draw and o_global mark them as Persistent. Do not put o_draw and o_global in the next room, only in the first room. Then, when player moves outside room, say go to next room, then you would still have you're collected items. I just don't know how to save and load inventory yet. This means, when you exit game and go back to it, you will not have your collected items. So it works if you continue to play, but when you exit game, it will be gone.

Idea Example: You could have two levels, then at the end of the 2nd level, deactivate the o_draw and o_global, then the 3rd level could be a Bounce level, it would save there, then do a collision and hit something activating your o_draw and o_global which then inventory would be zero items, but you could recollect and move to next level with items collected in Bounce level. So when you exit game and load it back up you would be at the Bounce level with zero inventory, but recollect, before time runs out, then go to the next level with your items.

Note: You can expand on this, and add more weapon boxes if you like. I will be doing another video on inventory, but its for Android, and it could be used for the PC, just have to change somethings around, like don't show buttons, and using other button to select items with selector like the spacebar, so you can hide the mouse, while playing game.

Also, I found out how to hide the selector when you turn off the inventory. Instead of using the hide code, we are going to use the deactivate and activate code. So this will deactivate the selectors, and items, and activate the selectors and items. While its deactivated you can't use the up button to move through your items, which makes since, only when activated you can do so. Go to Global Game Setting, up at top near plus sign, Windows tab, uncheck Display the cursor. Update Splash to black screen. You can make a room for a Splash Screen, have a video on that. Graphics, check Interpolate colors between pixels, Scaling Keep aspect ratio, Allow switching to fullscreen, Size 2048x2048

For the Android video: I moved around the inventory items, adding a backing, and added one more item. Will show this weekend, if everything goes as planned.

So for....

btt_out_inv

Events:

Left Pressed

Actions:

instance_deactivate_object(o_select1);

instance_deactivate_object(o_select2);

instance_deactivate_object(o_select3);

instance_deactivate_object(o_global);

instance_deactivate_object(o_draw);

btt_in_inv

Events:

Left Pressed

Actions:

instance_activate_object(o_select1);

instance_activate_object(o_select2);

instance_activate_object(o_select3);

instance_activate_object(o_global);

instance_activate_object(o_draw);




Other Videos By MC Designs


2021-03-27Game Maker Studio: (Part 2) How to Save, & Load you're Inventory?
2021-03-21Game Maker Studio: (Part 1) How to Save, Load You're Room, & Mark Inventory Persistent?
2021-03-20Game Maker Studio: How to Move, Parenting, & Void Getting Stuck in Walls?
2021-03-13Game Maker Studio: (Part 2) Randomly Choosing Set of Numbers & Images?
2021-03-13Game Maker Studio: (Part 1) How to Gain, Take Away, & Move to Next Room?
2021-03-07Game Maker Studio: How to Gain 50 Coins, then Restart Game?
2021-03-06Game Maker Studio: How to Save & Load Coins you Pick Up, Room, & Score?
2021-02-27Game Maker 8.1: How to Create a Mini Map, & find Enemies & Items?
2021-02-20Game Maker Studio: How to Create Googly Eyes, when Getting Hit?
2021-02-16Game Maker Studio: How to Create a Easy Inventory System for Android?
2021-02-13Game Maker Studio: How to Create a Easy Inventory System for PC?
2021-02-12Game Maker Studio: How to Angle Shake an Object, when getting Hit?
2021-02-12Game Maker 8.1: How to Open a Door, once Equal Number of Prisoners are Saved?
2021-02-12Game Maker 8.1: How to Scale Buttons, when Pressed?
2021-02-06Game Maker 8.1: How to Collect Key, Messages, Open Cell, & Save a Prisoner?
2021-01-30Game Maker Studio: How to Shake an Object, when getting Hit?
2021-01-23Game Maker Studio: How to Unlock Rooms?
2021-01-23Game Maker 8.1: How to Unlock Rooms?
2021-01-16Game Maker Studio: How to Jump through a Platform, & Land on it, using Parented Objects?
2021-01-16Game Maker 8.1: How to Jump through a Platform, & Land on it, using Parented Objects?
2021-01-02Game Maker 8.1: How to Use a Path, for Movements?



Tags:
easy
inventory
system
instance
destroy
other
computer
pc
pick
up
item
items
learn
teach
how
show
find
arrow
bomb
windows
collision
object
obj
sprite
select
selector
hide
true
false
throw
global
ammo
if
else
create
view
xview
yview
dynamite
box
gravity
selected
angle
step
begin
image
mouse
button
down
wheel
visible
draw
set
font
color
depth
inv
person
charactor
pickup
choose
make