Тёмный

Pickup & Use Items - Inventory (part II) // E17 // Make a 2D Action & Adventure RPG in Godot 4 

Michael Games
Подписаться 3,8 тыс.
Просмотров 2,6 тыс.
50% 1

Опубликовано:

 

30 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 38   
@skrrtfm6940
@skrrtfm6940 Месяц назад
These are the best. as a experienced dev, these are the best tutorials to learn great design patterns for game dev. i really like your approach to the item use effects. still following along, see you at episode 20 soon
@YouTuberFourTwentySixtyNine
@YouTuberFourTwentySixtyNine Месяц назад
These tutorials are amazing. I'm learning so much. Thank you!
@ArktikusYoutube
@ArktikusYoutube 28 дней назад
For anyone interested in having a maximum per slot of for example 99, this is my solution (I'm a beginner and it's maybe not the best, no guarantee it will always work xD): if s.item_data == item: if s.quantity != 99: s.quantity += count print("Addition to quantity") return true else: if slots[slots.size() - 1]: print("Break because slot was at 99") break The: if slots[slots.size() - 1]: | is really important, without that and just doing break it would always look in the first slot, see oh it's 99 and break. This works now so that it fills to 99, then gets the next free spot and starts filling that one until 99.
@metropolis10
@metropolis10 2 месяца назад
48:00 I'm actually a huge fan of "showing your work" in terms of debugging stuff in tutorials. It is not enough to just learn how to do something the first time, showing how you solve problems when you run into them helps teach us how to reason and solve our own problems in the future as well!
@vaanidel2117
@vaanidel2117 2 месяца назад
Loving this series so far, just got into Godot. Wouldn't mind seeing inventory updated with stackable/non-stackable and max stack sizes. Maybe even an update with different pages based on categories, like Breath of the Wild and Tears of the Kingdom if at all possible
@MichaelGamesOfficial
@MichaelGamesOfficial 2 месяца назад
Yes, I will need to make some more advanced tutorials on the inventory and UI in the future for sure.
@goodoldhoward6151
@goodoldhoward6151 2 месяца назад
hey Michael, thank you so much for explaining everything in such details! The whole 'Resource' concept is very new to me so i've taken down lots of notes in my code (seriously they are so much longer than my actually code in each line), and i wouldn't have been able to do it if you didn't explain it so well. So Thank you! BTW garbage picking is one of my fav things to do in a game so really glad you've done tutorials on this🥰
@MichaelGamesOfficial
@MichaelGamesOfficial 2 месяца назад
Thank you! Good to see you making it further through the series!
@metropolis10
@metropolis10 2 месяца назад
okay another tutorial down! thank you so much, really enjoying these and how far into the game creation you're getting. In addition to my previous idea (repeated here), here are some other episode ideas I'd love to see in the future! - Control + remap settings - Graphic and resolution settings - Audio settings - Ui scale accessibility settings - Multiplayer local duo co-op (steam remote play together makes it online co-op!) - Title screen + studio logo flash - Title screen 3 save profiles - localization of text
@TranquilSideQuestASMR
@TranquilSideQuestASMR 22 часа назад
Awesome video as always loved this
@bobbodaskank
@bobbodaskank 3 месяца назад
I feel like in a Zelda-like, I would want the "0" items to stay in the inventory as quantity zero, so I handled my zero quantity code in the SlotData resource as an "update quantity" function basically copy-pasted from the Player "update HP" function, with a clampi to keep it in the bounds of the min and max for that resource. Then I fiddled with the code a bit to prevent use() when the quantity is zero. But I'm still glad to learn this part, because I think this would be essential for like a "key items" inventory that has things like quest items that should go away when used up or when quests are over.
@smellfungussports
@smellfungussports 6 месяцев назад
Amazing stuff. I hope this turns into a fully fledged game that we can play.
@dylanwalters8573
@dylanwalters8573 3 месяца назад
Finally making progress, took a little break from working on this stuff, but I have been looking forward to inventory systems! Can't wait! Keep up the great work!
@CassyCodes
@CassyCodes 6 месяцев назад
Wow, this game looks really smooth. I'll have to go back to the beginning to follow along!
@CptTiki
@CptTiki 5 месяцев назад
Forgot to comment on this one - i was excited to get the inventory loading!! :D
@Geminosity
@Geminosity 5 месяцев назад
To get the focus to remain consistently after using the last of an item I had to move the await get_tree().process_frame to the start of the update_inventory function. I suspect when the focus was being lost it was generating the new ones before the old ones had been removed and so the new items indexes were 10 higher than they should be. By moving the wait to the start of the function the old buttons are definitely gone and the new ones are generated with the correct index... or at least that's my theory :P
@NastroGG
@NastroGG 4 месяца назад
Thank you!
@metropolis10
@metropolis10 2 месяца назад
36:19 you did set audio to the potion, but then we renamed the export variable which deleted/cleared them all when we changed `sound` to `audio`! Sometimes fancy IDEs have a "refactor" / "rename" menu that will resolve these for you, but doesn't look like this does it!
@metropolis10
@metropolis10 2 месяца назад
4:35 especially true of game programming, if it works, no bugs, great! In the computer science world premature optimization is a huge problem and trap we too often fall into as well. While you want to build on good design principles, worrying about small efficiencies like this is a waste of time and money!
@goodoldhoward6151
@goodoldhoward6151 2 месяца назад
Also i think i found a bug :) - if you've already given the player a potion in the inventory slot before run the game (ie. start the game with a potion already existing in inventory), the potion can still be -1, -2... once used up
@MichaelGamesOfficial
@MichaelGamesOfficial 2 месяца назад
Oh! I'll make a note to look into that one :)
@jayr5421
@jayr5421 Месяц назад
Waahoo!!!!
@kevinkowalski1
@kevinkowalski1 6 месяцев назад
very cool tutorial series so far. Working with custom_resources to the max_Level :) will you cover in the future certains things like how to create a cutscene. (Someone is talking. Monsters attacks and stuff like that) and by any chance how to create your own debug_(cheat)plugin. Something like, porting to a specific map, recovering health whenenver you want and stuff like that. I think thats helps a lot in the whole game dev process.
@MichaelGamesOfficial
@MichaelGamesOfficial 6 месяцев назад
I hadn't thought of the debug panel - that's a great idea!
@McHumaty
@McHumaty 6 месяцев назад
Will you teach how to randomize the drops of these items on the map? Godot knows which of the items she can provide to the player as a reward.
@MichaelGamesOfficial
@MichaelGamesOfficial 6 месяцев назад
Soon I will cover adding random/semi controlled drops (with drop rates) to enemies :)
@christopher2573
@christopher2573 28 дней назад
For some reason I have the situation where the first item collected stacks properly but others all take up new inventory slots. Has anyone else run into this? I've compared the inventory code and can't find a difference between mine and Michael's.
@HayasakaAi-wj4zb
@HayasakaAi-wj4zb Месяц назад
Can you make some more videos about the item ? item stats for character , craft item ...
@MichaelGamesOfficial
@MichaelGamesOfficial 28 дней назад
Yes! They are on their way… slowly right now, but coming
@HayasakaAi-wj4zb
@HayasakaAi-wj4zb 26 дней назад
@@MichaelGamesOfficial thank you
@Aphex26
@Aphex26 4 месяца назад
Seems the item focus bugs out randomly and the menu loses focus. Any ideas?
@Tuto1902
@Tuto1902 5 месяцев назад
Running into an issue where the focus is inconsistent. Sometimes it will work fine and other times it will loose focus after use. This happens randomly and in different items. I tried what @Geminosity suggested by moving the await to the start of the update inventory but I still get the same problem. Any ideas?
@Tuto1902
@Tuto1902 5 месяцев назад
Update: I solved it by adding one extra await line before grabbing focus (so, that's two await lines. One at the start and one before the end). I don't know if it's the best solution since there's an almost unnoticeable flicker after using the item, but at least it is consistent now 🤷‍♂
@simspam87
@simspam87 6 месяцев назад
great video... something strange is happening with godot, in the laptop I use daily the 'fix item unfocus defect when item is depleted' does not work, but if I use the same project directory on another pc everything works. 😵‍💫😵‍💫😵‍💫
@MichaelGamesOfficial
@MichaelGamesOfficial 6 месяцев назад
Oh no! Perhaps I did something goofy that doesn't always work? I have been prepping a discord community for people to come share/help with issues, etc. So, I guess it's ready enough: discord.gg/zp2WDWgD If you join, perhaps you can share some snippets of your code, or any other info you have and we can figure out a solution :)
@simspam87
@simspam87 6 месяцев назад
@@MichaelGamesOfficial thanks... I don't think the problem is somewhere in my files.... I tried downloading the project from github and it gives exactly the same problem. That is, on the laptop the focus does not always work, but on the desktop it always works.
@MichaelGamesOfficial
@MichaelGamesOfficial 6 месяцев назад
I updated the invite link: discord.gg/zp2WDWgD
@Tuto1902
@Tuto1902 5 месяцев назад
@@MichaelGamesOfficial Discord link has expired
Далее
Why I Started Game Dev In My Late 30s
7:32
Просмотров 26 тыс.
Small games win big, here's how to make them
14:59
Просмотров 45 тыс.
I Made the Same Game in 8 Engines
12:34
Просмотров 4,2 млн
18 Laws of Gamedev Everyone Knows But No One Follows
20:18
Building a Tiny Office Pod Under My Stairs
51:47
Просмотров 7 млн