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
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.
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!
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
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🥰
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
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.
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!
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
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!
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!
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
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.
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.
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?
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 🤷♂
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. 😵💫😵💫😵💫
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 :)
@@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.