Drawing Your Inventory to Screen (GameMaker Studio 2 Tutorial)

preview_player
Показать описание
This video is part of our GameMaker Studio 2 Inventory tutorial series! Today we're talking about how to draw our inventory to the screen, which is necessary for building a UI to interact with the inventory.

In the first video I explained what inventory is conceptually (basically just an item identifier and a count of how many of those items you have), and then showed how to implement it in GML code. We ended up pairing object indexes with counts in a ds_map (one of GameMaker's built-in data structures).

In this one, we add on to that a little bit by adding a ds_list to track unique object indexes in our inventory, for the purpose of iterating through our inventory efficiently to draw it. We also add simple toggling functionality to control whether we draw the inventory to screen or not.

Using these simple techniques, you have the foundation you need to make your inventory look however you'd like, whether that be toggling a separate screen like Pokemon or Skyrim, or having a bar across the bottom of your screen like Minecraft!

As always, thank you guys for watching! Please post any questions you have in the comments below!

Music:
Thoughts - Eric Godlow
Рекомендации по теме
Комментарии
Автор

I'm in the middle of designing a game and have been having trouble to find a video that helps set up the inventory system and this video has helped me. Others worked but don't completely fit with the image of the game I'm working on. Or I'd have to watch the videos before the inventory system video because it references code from those videos. Your videos are short, straight to the point, and super helpful! Keep up the great work!

Lucy_Griefer
Автор

Great tutorial! It was incredibly hard for me to understand lists/maps in gamemaker so this tutorial is a real lifesaver.

ross
Автор

Kraig! This is one of the best Gamemaker tutorials I've found. Shocked you only have 200 views, but if you get this out there, people are gonna eat it up! Really really clear, and super recent -- lots of tutorials on here are tough to use if Gamemaker has changed a lot since they were posted. Huge thanks for these videos so far, definitely giving you a major shoutout in the credits if this game I'm developing comes to fruition -- or maybe you'll appear as an incredibly wise and well-spoken NPC who offers some sage advice.

godthemark
Автор

Great little tutorial here; It helped me a bunch with starting up my own inventory system.

DarrelOdin
Автор

Great tutorial! How would I add the name of the object after that though?

hot_dog
Автор

I loved the tutorial, and I am hoping to catch your attention and get an answer. How would we go about separating the inventory into "Tabs" like Pokémon, I.E. consumable Items, key items, equipment? My first thought would be make a map for each tab, and add those sections to an overall list? I'm new to the idea of ds_map and list so I am not the most knowledgeable about them. Any insight into how to do this would be amazing!

xXFinalEntryXx
Автор

how would i get an item to stop drawing on the list?

boeljuchanan
Автор

Shouldn't you Clean Up/Destroy your Data Structures?!?!?!?!

adminBlastoise
welcome to shbcf.ru