No video

Resource Based Inventory - Godot 3.2 Intermediate Tutorial

  Рет қаралды 96,949

Heartbeast

Heartbeast

Күн бұрын

Thanks for watching my video!
Here is the source code (MIT License): github.com/uheartbeast/invent...
If you are interested in taking a deeper dive into the Godot game engine you can buy my 1-bit Godot Course at this link: www.heartgamedev.com/1-bit-go...
Check out my Patreon: / uheartbeast
Follow me on Twitch for GameDev livestreams: / uheartbeast
Twitter: / uheartbeast
Facebook: / heartgamedev
Thank you all so much for your support!

Пікірлер: 165
@uheartbeast
@uheartbeast 3 жыл бұрын
Here is the source code (MIT License, download the images here): github.com/uheartbeast/inventory-tutorial I've got some plans for a new Godot series (similar to my GameMaker 2D Hack-n-slash series but not using the Grave resources). I'm still working through the details for that series but hopefully I can start making videos for it soon! Here is the link for the fall sale of my Godot course: www.heartgamedev.com/1-bit-godot-course-fall-sale Have a great weekend! - Ben
@stefans8885
@stefans8885 3 жыл бұрын
You are the hero we need but don't deserve
@wiktorwektor123
@wiktorwektor123 3 жыл бұрын
Good tutorial, but if your script doesn't need any code exept base class then why you never set proper option when crating new script? You should change "Template" from "Default" to "None" and save yourself deleting all this junk comments + _ready function. With template set to "None" every script has exactly one thing inside: "extend Base_Class_Name".
@boone_e
@boone_e 3 жыл бұрын
When are you making another videos of the action rpg?
@mio-xh1ln
@mio-xh1ln 11 ай бұрын
if you're using Godot 4.0, the code at 23:45 has new syntax. I got the error code invalid argument for "connect()" function and switched the code to the following: func _ready(): inventory.connect("items_changed", Callable(self, "_on_items_changed")) update_inventory_display() which fixed the error :) happy coding everyone!!
@brandongroth4569
@brandongroth4569 9 ай бұрын
Even easier syntax for 4.x: inventory.items_changed.connect( _on_items_changed)
@yonatankravitz8402
@yonatankravitz8402 Жыл бұрын
In Godot 4 exporting is done with @export var name : String = "" @export var texture : Texture
@ChrisTutorialsYT
@ChrisTutorialsYT 3 жыл бұрын
For the get_drag_data function, it seems to work better to use (var item = inventory.items[item_index]) instead of (var item = inventory.remove_item(item_index) because removing it before the drop means that if you move the item off screen, that it will disappear into the void. Testing with print(inventory.items) in drop_data it seems that the swap items already handles moving the data around so there's really no need to remove the item if it never gets to the drop_data function.
@r5LgxTbQ
@r5LgxTbQ 2 жыл бұрын
19:10 the Vseparation and Hseparation are now in Theme Overrides -> Constants instead of Custom Constants. I'm using Godot 3.4.2
@アドチ
@アドチ 3 жыл бұрын
sweeettt! have no need for a inventory but need something to manage custom decks in a card game
@USNTM2
@USNTM2 3 жыл бұрын
Make a card resource and place the cards into an array.
@icefoxzettai
@icefoxzettai 3 жыл бұрын
Not only i learned a good way to use Resources, but also how to make a simple UI inventory! Thanks a bunch!
@anicepineapple9067
@anicepineapple9067 3 жыл бұрын
I hope you realize you have saved me alone hundreds of hours on my life in my game development, not to mention everyone else who watches your videos.
@Yoni123
@Yoni123 3 жыл бұрын
That's not even a finished inventory. Just like he didn't finish the APRG tutorial
@anicepineapple9067
@anicepineapple9067 3 жыл бұрын
@@Yoni123 Well with a few simple additions I have turned it into one. So it works as a base.
@Joonysuke
@Joonysuke 2 жыл бұрын
@@Yoni123 I'm a little late on this, but the thing you have to realize about tutorials is that they're not always going to be finished, or updated. Considering this is free content, this should be more than enough of a basis to get started. There are plenty of people about there who get stuck for days, weeks, months, maybe even years trying to wrap their head around starting programming systems like this. While others, it can only take moments after looking at the documentation and logic. Personally, I'd like to take the time at some point and try and dissect this video and its code to boil it down to be more readable and understandable for beginners, and brainlets(such as myself).
@CraftingDiamond
@CraftingDiamond 3 жыл бұрын
Im already seeing this video being one of the most useful godot tutorial you ever did. Custom Resources are really useful. Nice work!
@DevDuck
@DevDuck 3 жыл бұрын
Hey Ben! This is such a huge improvement to what I had, thanks for creating this series! Question about your `drop_data` implementation at 36:00 - calling `swap_items` and then `set_item` seems a bit unintuitive, since conceptually 'swap' should handle the movement of both items. It also results in our "items_changed" signal being fired twice in a row. Going to take a stab at refactoring on my end, but curious if you had any thoughts.
@uheartbeast
@uheartbeast 3 жыл бұрын
Yeah, it is a bit strange. That is a good question. So the swap will swap the item in the target drop slot with the null that is in the slot we picked up our item from. Then we set the drop slot to have the item we are dragging. I guess I did it this way cause it skips a step. The alternative would be to get the item in the drop slot and set the slot we picked up our item from to be that item. Then set the drop slot to contain the item we are dragging. Hope that makes sense.
@RACOONLPs
@RACOONLPs 3 жыл бұрын
@@uheartbeast thanks for the great the tutorial! I adapted your code to fit my use case. In ran over the same "problem" as @DevDuck and found the following solution: instead of removing the item when calling _get_drag_data( ) I set the item sprite to invisible. Later when dropping the data, I set it to visible again. That way when I call the swap method both items are still on there actual place and I don't to call set_item( ). I use this because it allows me to also prevent the user from dropping the item outside of the inventory. When the left mouse button is released I just make all invisible items visible again. If I would remove the item from the inventory and the player drops it outside the inventory I would loose the reference.
@wall_k
@wall_k 3 жыл бұрын
@@RACOONLPs hey, I did almost the same! I didn't set it to invisible, I set texture to empty slot texture. And then swap_items method restored it all back to normal! Except when dropping outside the inventory, haven't found a good way to handle it yet ):
@RACOONLPs
@RACOONLPs 3 жыл бұрын
@@wall_k If I remember it right, I have added a flag "dragged" to the item slot, that controls the visibility or the texture in your case. Whenever the player drags the item in the slot I set it to true and turn the item invisible. Then I check for a mousebutton released event. If the mouse button is released and dragged is true I set it to false an make it visible. Provided you swapped it with another slot the correct item (or none if only moved to an empty slot) should be visible. But if you draggeg it on an invalid space its still in the slot but invisible and you just have to set dragged to false and visible to true again. You could also implement logic that allows you to drop items on the map using the mousebutton released event. Hope that can help you. ;)
@wall_k
@wall_k 3 жыл бұрын
@@RACOONLPs yeah, that makes sense, thank you!
@slydogg9692
@slydogg9692 3 жыл бұрын
Another great tutorial! I'm incredibly thankful for all the content and tutorials you've put out. I'm sure your content is, and will be, a springboard for many future games and gamedevs. Cheers to you and your efforts!
@chicao.do.blender
@chicao.do.blender Жыл бұрын
i'm glad i looked for your tutorial, i literally searched for "godot intermediate" so that i wouldn't get 10 videos of people repeating what is a node to my face and i'm glad i did it, i'm reading the documentation along with your video and you're ready to explain more than the tutorial requires, you're a great content creator
@greenapple4080
@greenapple4080 3 жыл бұрын
Thanks for the video! Inventory is one of the things I had a hard time imagining how would work.
@nickcy5083
@nickcy5083 3 жыл бұрын
Awesome, never tried to actually create an inventory system but Godot's workflow is surprisingly simple and intuitive, thanks for the vid!!
@noxalas
@noxalas 3 жыл бұрын
Thank you so much for this! There are a couple Godot tutorials on inventory I've seen, but either they don't fit what I need or they're a bit hard to understand. I really liked the way you used resources here rather than json, the solution is really neat and easy to understand. (Also really easy to expand upon) c: Would love to see more on inventory systems from you, since you always explain everything so well. Thank you again for another great tutorial.
@himhim4150
@himhim4150 3 жыл бұрын
I recently looked for a similar tutorial again, thank you very much!
@whitedevil9262
@whitedevil9262 3 жыл бұрын
Just what I was looking for from you! Thanks for the video :)
@Baeso66
@Baeso66 Жыл бұрын
This video was a great introduction to resources in Godot while implementing a nice inventory system. I feel like it opened a world of possibility for me. I already added healing potions that restore player's health when right-clicked from the inventory.
@noahpen
@noahpen 3 жыл бұрын
Amazing tutorial, just what i needed!
@AndrewCothill
@AndrewCothill 3 жыл бұрын
20 seconds in and i'm already loving it!
@RamonCavalcante
@RamonCavalcante 3 жыл бұрын
I spent more than a month studying ways to make a simple inventory, yours is still better than what I got. I wish I had found this video before, hahaha. now i think i will redo it from scratch.
@GamerReborn1979
@GamerReborn1979 3 жыл бұрын
thank you this is really helpful, please make a follow up video about equipping items to a player from inventory i couldn't find any tutorial about that. keep up the good work :)
@wagnerrodrigues6440
@wagnerrodrigues6440 3 жыл бұрын
Very nice tutorial, didn't know about the import presets for 2d pixel images! makes things much sharper!
@drunkard103
@drunkard103 3 жыл бұрын
your videos are the clearest and easiest to understand godot tutorials i've come across. i know it's probably very basic stuff but i'd love to see a video on how to set animations correctly in 8 way movement and/or setting NPC movement paths thanks for all the great content ^_^
@trapshooter
@trapshooter 3 жыл бұрын
I'm not even working on a game with an inventory system or even use godot (I use unity) but I still really enjoyed this video. I really like seeing how you organize and structure your code and it's also very calming. Great content man!
@sergeiorlov5096
@sergeiorlov5096 3 жыл бұрын
I never needed such a system, or inventory in general, but now Ill have to start a new project around it. Well THANKS, Ben! xD
@crashannburnFPV
@crashannburnFPV 3 жыл бұрын
This is just what I need just when I need it! SO much easier than ue4! :D Thank you so much for making this tutorial!
@StrawberryRaccoonNixie
@StrawberryRaccoonNixie 8 ай бұрын
This was immensely helpful, thank you
@drbuni
@drbuni 3 жыл бұрын
Thank you, Mr. Heartbeast. I always look forward to your Godot tutorials. The development of my game wouldn't be nowhere near as far without your help!
@uheartbeast
@uheartbeast 3 жыл бұрын
You're welcome :) Feel free to send me screenshots or a trailer of your game when you feel ready to share it. I'd love to check it out.
@drbuni
@drbuni 3 жыл бұрын
@@uheartbeast Thank you for offering me an opportunity to show my work! I will send you pictures of it soon!
@veselinborisov369
@veselinborisov369 3 жыл бұрын
@@drbuni Wish you luck with your game, man! Don't forget to send a link for your game when you upload it.
@drbuni
@drbuni 3 жыл бұрын
@@veselinborisov369 Thank you
@nincompoop17
@nincompoop17 2 жыл бұрын
Brilliant! I learned so much!
@Rodoru
@Rodoru 3 жыл бұрын
Hello, I’ve just started your course in Udemy. It’s super cool. Wish you the best.
@anfi8673
@anfi8673 3 жыл бұрын
wow, your tutorials are always interesting and useful
@uheartbeast
@uheartbeast 3 жыл бұрын
Thanks!
@MrHaloisthebomb
@MrHaloisthebomb 3 жыл бұрын
I'm going through your godot course right now and this is just one more thing to add to my toolbelt!
@liampeterson8299
@liampeterson8299 3 жыл бұрын
This is pretty cool, when i created an inventory, it was just a bunch of auto-generated panels and buttons
@nubunto
@nubunto 3 жыл бұрын
This is so good! Thanks HeartBeast! I avoided having a to add a script to the InventoryContainer to "catch" data dropping outside of the InventorySlot by doing the following: instead of removing the item from the inventory inside get_drag_data, just get the item with inventory.items[item_index] then, on drop_data, you can do: func drop_data(_position, data): var item = data.get("item") var item_index = data.get("item_index") var my_index = get_index() inventory.swap_items(my_index, item_index)
@cyzaine
@cyzaine 2 жыл бұрын
Underrated comment for sure. Less scripts to track the better!
@agriasoaks6721
@agriasoaks6721 Жыл бұрын
How do we move items if we have different arrays?
@Parrexion
@Parrexion 2 жыл бұрын
Man, I remember starting out in high school learning game maker 8 using an inventory tutorial. And now I'm back again but with Godot instead ^^
@andresgrimminck8674
@andresgrimminck8674 2 жыл бұрын
Great video!
@aartigupta7048
@aartigupta7048 2 жыл бұрын
You are dope bro! Damn , thank you so much, subbed
@MicahT
@MicahT 4 ай бұрын
This video is really great and (with the help of a couple comments) wasn't hard to convert for Godot 4 (mostly adding the _ before _get_drag_data, etc.) but wanted to share something that took me hours to figure out. My items are a Sprite2D sprite sheet w/ 38 images and I tell it from the Resource what frame and hframe to use. But for the drag image, you can ONLY use a Control node, not a Sprite2D node. A TextureRect is a Control node, but you can't set hframes and use a sprite sheet and I really didn't want to individually export all 38 items just for the drag. I figured out the solution and it still took me a couple more hours to crack it, but here's the code if you want to get a Sprite2D to drag: var preview_texture = Sprite2D.new() preview_texture.texture = _drag_texture preview_texture.hframes = _drag_hframes preview_texture.frame = _drag_frame var preview = Control.new() preview.add_child(preview_texture) set_drag_preview(preview) I tried to just use my current sprite_2d.texture, etc. but I'm pretty sure that gets deleted right before the drag preview is made, so I had to add the _drag_texture etc. global variables and set those in the display_item(item) function. Works now and I'm relieved. Anyways, thanks Heartbeast.
@goshinbi44
@goshinbi44 3 жыл бұрын
if anyone is looking for how to have the dragged item be centered with your mouse cursor # set_drag_preview seems to put the top left corner where the mouse is # to fix this create a container, then add the texture as a child # then set it's rect position which is relative to parent var previewCon = Control.new() previewCon.add_child(dragPreview) dragPreview.texture = item.texture dragPreview.rect_position -= dragPreview.texture.get_size() * .5 set_drag_preview(previewCon)
@tunicatetheawful606
@tunicatetheawful606 3 жыл бұрын
You've proven that reading the youtube comments can be good after all. :)
@agriasoaks6721
@agriasoaks6721 Жыл бұрын
If we have another container like chest or item bank, it means we'll make another array. How do we move items in that scenario?
@mrgreensuit7379
@mrgreensuit7379 4 ай бұрын
in godot 4.0 rect_position is now just position or global_position so. "dragPreview.position -= dragPreview.texture.get_size() * .5"
@Dante3085
@Dante3085 Жыл бұрын
13:50 The swap_items() implementation only requires 1 local variable, like so: var target_item= items[target_item_index] items[target_item_index] = items[item_index] items[item_index] = target_item emit_signal("items_changed", [item_index, target_item_index])
@noid3571
@noid3571 3 жыл бұрын
Just started with godot and you are one of the reasons I am able to speedrun the learning process. Thank you
@Mysterygamer420
@Mysterygamer420 Жыл бұрын
So how did that speed run go? Been a year haha
@noid3571
@noid3571 Жыл бұрын
@@Mysterygamer420 Made a pixel topdown multiplayer game about knights with MP5s in a randomly generated dungeon with endless waves. Took me about an hour to get used to shortcuts and stuff, about a week for GDscript and all different classes (like tf is an AStar). Few more days digging through networking documentation and tutorials and that's about it. I want to continue working on a new iteration with bosses and "tinykeep generation" but my whole year was consumed by college : (
@Mysda_
@Mysda_ 3 жыл бұрын
That moment you start to understand many new things even after having made some games
@LordJuz
@LordJuz 3 жыл бұрын
the moment you called a function that didn't exist yet, I felt that
@MrPoporucha
@MrPoporucha 3 жыл бұрын
"Tall shields are the best shields" >SEETHES IN ROUND SHIELD
@RonDLite
@RonDLite 2 жыл бұрын
I love how you are always concerned about the audio of the recording. Rest assure it is top notch.
@ss2cire
@ss2cire 3 жыл бұрын
Very nice tut. Glad you posted it, but i take it this means the walker videos are done?
@BrannoDev
@BrannoDev 3 жыл бұрын
I found a pretty horrible way of 'fixing' the bug at the end. Just add a 2nd ColorRect above the Inventory Container on the tree, make it absolutely massive so you can't drag your mouse away from it and then attach the same script we added to the InventoryContainer. You will need to add a control node at the parent to everything though. It would be nice if there was a better way of resolving this but i don't even get information returned from any of the functions if it is dragged outside of the container. anyway thanks for the tutorial, I learned a lot.
@bitbutter
@bitbutter 3 жыл бұрын
1:14 to anyone confused about what the height/width and test height/width settings are doing: height/width refers to *render* height and width. test height/width refers to *window* height and width. these properties will likely be given more fitting names in a future release of godot. more detail here: github.com/godotengine/godot/issues/16863
@halobread
@halobread 3 жыл бұрын
so basically if not test is 1x1 and test is 2x2, it will be not test scaled to 2x2? am i right
@traceletz6786
@traceletz6786 2 жыл бұрын
Ples ples ples make a new third video tutorial going more into this, I love how it look so much but after finishing the second video I'm still left confused on how to properly use the items and add it to my game.
@mio-xh1ln
@mio-xh1ln 11 ай бұрын
I'm using Godot 4.0.3 and it was working all the way until the get_drag_data() and the other two functions, turns out in Godot 4 the syntax is with an underscore at the start so get_drag_data() is now _get_drag_data()
@craybarmanhorn
@craybarmanhorn 8 ай бұрын
preciate you big dog
@funky_pepe
@funky_pepe 3 жыл бұрын
Here, \o/ have a hug u nice Internet person
@ethanspurrier7120
@ethanspurrier7120 2 ай бұрын
9:33 The array can be export with the following code @export var items : Array[Resources} = [ ]
@user-zd2qz8cx7s
@user-zd2qz8cx7s 2 жыл бұрын
awesome
@jazzy8391
@jazzy8391 2 жыл бұрын
how do you add and remove items in the array for when you want to pick them up and remove them in the game (instead of dragging the .tres files into the array)?
@lufog
@lufog Жыл бұрын
I believe it's better to handling unsuccessful drags in slot script: In _get_drag_data(...) instead of removing item, just hide the TextureRect. In _notification(...) handle NOTIFICATION_DRAG_END, check with is_drag_successful() if the drag was successful, if not show the TextureRect. And in _drop_data(...) remove item inventory.remove_item(data.index), when it is reliably known that the grag was successful.
@buterbrodxd7259
@buterbrodxd7259 3 жыл бұрын
Hi HeartBeast, will this video be part of an episode or is it a standalone video without a sequel?
@1986Hikaru
@1986Hikaru 3 жыл бұрын
I wonder who hard is to combine it with your old Mobile RPG project... And i really wanted something like a update and expansion of that tutorial, maybe with how put more character at same time or extra exploration elements.
@alanzulwas
@alanzulwas 2 жыл бұрын
wow i never thought that resource can be save the array node. before i do it the same but i have to make one scene for save and load arrays data
@severe2460
@severe2460 3 жыл бұрын
A quick question: When setting the drag preview, I get an error: Invalid type in function 'set_drag_preview' in base 'CenterContainer (InventorySlotDisplay.gd)'. The Object-derived class of argument 1 (StreamTexture) is not a subclass of the expected argument class. Something I did wrong with the item resources and texture settings?
@BlackCat-gh8fr
@BlackCat-gh8fr 3 жыл бұрын
Thank you! Great video.
@kaboomsihal1164
@kaboomsihal1164 2 жыл бұрын
Items is one of those words that very quickly lose all meaning if you read it too often lol
@MrLexDog
@MrLexDog Жыл бұрын
Can you tell me how to make the item selection function? So that you can left-click and the item is saved to a separate variable? I just want to implement descriptions and item interaction for my quest
@damian1722
@damian1722 3 жыл бұрын
I'm having an issue with the InventoryDisplay.gd I can't run Inventory.tscn because of this error message: "Script inherits from native type 'GridContainer', so it can't be instanced in object of type: 'CenterContainer'", but then if I change the extends to CenterContainer I get an error saying the opposite: "Script inherits from native type 'CenterContainer', so it can't be instanced in object of type: 'GridContainer'"
@user-lg7fz9bu2w
@user-lg7fz9bu2w Жыл бұрын
Here's an unintuitive solution to the "dropping items" problem: dragPreview.tree_exiting.connect( _on_drag_end.bind(item) ) This will cause the drag preview to call some function (_on_drag_end in my case) when it disappears, with the argument 'item'. The called function can make use of the 'is_drag_successful' function, which returns false if we dropped the item somewhere that could not accept its data: func _on_drag_end(item): if not is_drag_successful(): inventory.set_item(get_index(), item) I feel like this solution is very clean as it does not require a new script and can be reused if we put the slot display somewhere else.
@agriasoaks6721
@agriasoaks6721 Жыл бұрын
What if we have more than one containers to store items?
@kushal8621
@kushal8621 3 жыл бұрын
Hey friends Needed some help i want to move my character through area2d or any other node And I want to make my character appear double or more Like the game SKY by ketchapp
@hozerino
@hozerino Жыл бұрын
If I want to store some "transient" info, like keeping a "condition" for a sword that is different between instances, how would the best way be? I'm losing myself when trying to store these infos while switching scenes like Inventory -> Dropped -> Inventory -> Equipped while still having the advantage of the resource inheritance... I tried having a ItemResource with a custom_properties = {} but didn't go well :c
@ASimpleRobot
@ASimpleRobot 3 жыл бұрын
can you pls make a video on item stacking? P.S. amazing video, was exactly what i was looking for
@uheartbeast
@uheartbeast 3 жыл бұрын
I was actually planning on having that in this video but had to cut it because of time. I'll see what I can do about getting a second video with stacking in it :)
@ASimpleRobot
@ASimpleRobot 3 жыл бұрын
@@uheartbeast thank you, cant wait :D
@G69G71
@G69G71 Жыл бұрын
this method works in 3.5? beacuse I loved so much this tutorial, I want to put a pause screen in this style.
@bergglobus2428
@bergglobus2428 3 жыл бұрын
12:04 filling an array with null kind of hurts because I know I will forget the null check at some point😂
@mattdavis3036
@mattdavis3036 2 жыл бұрын
I'm having a strange offset issue, when I drag the item it appears far away from the mouse cursor, and when I move around (which moves the camera) the offset changes. I have a RemoteTransform2D, when I turn off "Use Global" the drag offset stays the same, but it is still far from the item. Anybody else notice this?
@felineentity
@felineentity 3 жыл бұрын
What did the preview part actually do? I think I missed that. Either way, great tut, can definitely use that! Didn't know the drag and drop was that simple.
@okyloky9432
@okyloky9432 3 жыл бұрын
The preview is what adds the picture of the item near the mouse, otherwise you would drag just your mouse. It makes it easier to see what you're hovering over to drop your item in a new slot basically
@USNTM2
@USNTM2 3 жыл бұрын
"Tall shields are the best shields". *REEEEEEE's in Tower Shield*
@mlmattin
@mlmattin 3 жыл бұрын
Very cool tutorial. I am new to Godot, but have done a lot of experimenting with Unity. Godot has caught my attention though. With regards to this inventory tutorial, how would this work with a save system? Obviously, if I save and quit then when I come back later I want the inventory to match what I saved. Would I just need to set all of those items in the Inventory resource at runtime when I load my save file? I'm thinking I would just save the index and resource path for each slot in the save file somehow. Anyway, some guidance on how you persist the inventory would be helpful.
@aerendyll
@aerendyll 2 жыл бұрын
My guess is that you just need to make sure you save the array that holds all the items from inventory.tres.
@thetiphon
@thetiphon 7 ай бұрын
I dont see point of using swap_items function inside drop_data() because we dont actually swap anything. It's just more convoluted way to set_item inside inventory inventory.swap_items(my_item_index, data.item_index) inventory.set_item(my_item_index, data.item) -> inventory.set_item(data.item_index, my_item) inventory.set_item(my_item_index, data.item) works same
@usikstory
@usikstory 3 жыл бұрын
when my swap the item changed but the icon not change.. whats wrong? i think the code work and similiar
@jellybon
@jellybon Жыл бұрын
20:49 Make sure you drop in the actual .tres files and not the .png files here like I did 🤦
@Yoni123
@Yoni123 3 жыл бұрын
How to make this work with a gamepad instead of a mouse?
@astraldreamer331
@astraldreamer331 3 жыл бұрын
Now if I actually had a clue how to use that in a game project?
@anjanavabiswas8835
@anjanavabiswas8835 3 жыл бұрын
thank you. the code is ... oddly very comprehendible. that was not the case with other tutorials i could find on youtube and thank god it takes care of swap.
@pteale
@pteale 3 жыл бұрын
Do you prefer Godot over Gamemaker?
@calumbeer4637
@calumbeer4637 3 жыл бұрын
this sounds hard but could u find out how to make a crafting system
@caligox6320
@caligox6320 2 жыл бұрын
Most relatable tNice tutorialng ever
@noahgaming2504
@noahgaming2504 3 жыл бұрын
Can you make a farming video
@Elterapeuta_rd
@Elterapeuta_rd 2 жыл бұрын
i love you ♥
@sidned5768
@sidned5768 2 жыл бұрын
can we see a tutorial implementing this into a game?
@TheAgentAPM
@TheAgentAPM 3 жыл бұрын
How can I make the drag preview appear in a better spot? Like, the center of it being centered on the cursor. Because I don't like dragging the image by the top left corner.
@ZeroPlayerGame
@ZeroPlayerGame 3 жыл бұрын
I have not tested this, but since it's a control you can set the preview texture rect_pivot_offset to be its rect_size / 2 and that should work.
@G69G71
@G69G71 Жыл бұрын
this method works using keyboard instead of mouse?
@benjamin20149
@benjamin20149 3 жыл бұрын
please make a followup
@MrPoporucha
@MrPoporucha 3 жыл бұрын
So, lets say I use this inventory and need to have equip slots in the same display...do I have to make ANOTHER inventory for the equipable slots? Same with item types: equipable, consumable, quest items, etc? If that the case, it will make my life perposterously easy :P
@agriasoaks6721
@agriasoaks6721 Жыл бұрын
Have you found the answer for that?
@gnomemann6986
@gnomemann6986 2 жыл бұрын
If i wanted to have multiple inventories or chests/other types of slots how would i go about adding those without getting index errors when moving between containers?
@agriasoaks6721
@agriasoaks6721 Жыл бұрын
I'm getting just that exact error. Have you found any solution? Share it, please
@surajsalian583
@surajsalian583 3 жыл бұрын
Can you make Godot. Hack and slash game tutorial
@MassiveBreaker
@MassiveBreaker Жыл бұрын
How would I use this with a hot bar or a crafting system? I am trying to figure it out, but it seems like I keep getting errors!
@agriasoaks6721
@agriasoaks6721 Жыл бұрын
Have you found a solution?
@takoyaki_1i
@takoyaki_1i 3 жыл бұрын
If I wanted to add functionality to an item, would I have to create a new class that inherits from item and make it a resource? for example, if I wanted my potions to actually increase the players health, should I make a Potion class that inherits from Item, then create the resource and add it to the inventory?
@valentinocerutti8764
@valentinocerutti8764 3 жыл бұрын
Hey, did you find a good solution to this problem?
@takoyaki_1i
@takoyaki_1i 3 жыл бұрын
@@valentinocerutti8764 sadly no
@vickylance
@vickylance Жыл бұрын
Hi Do you have separate day job for a living?
@MegaGnads
@MegaGnads 3 жыл бұрын
Wow. This comes out like a week after I finish working on an inventory system. Really like this video helps me see what I got right and wrong. The only thing I didn't like is that it uses drag and drop. Would have preferred it be click to pick up and then click to drop. I think most games have it like that instead of drag and drop. Right?
@vickylance
@vickylance 3 жыл бұрын
most games uses drag and drop from what I have seen. Also that way its easier to port to mobile/touch devices
@MegaGnads
@MegaGnads 3 жыл бұрын
@@vickylance I didn't think about mobile games. Agree drag and drop would be better in that context. I guess i was remembering old RPGs like Diablo... I think Stardew valley is also the same right?
@TheGiakaama
@TheGiakaama 11 ай бұрын
This is interesting, but how can you use this in another system . EX: You have this inventory on your character, but also want to have another inventory on a chest. If you put the same thing on the chest even though you instantiate-it it as a new scene, when opening the " chest " inventory it's the same inventory because of the inventory.tres. From what I've tested you must have another scripts to handle that second inventory, and If you have less slots in the chest then again it's trouble because moving an item from index 3 in your character to index 0 in the chest inventory get's buggy . Wondering if someone tried this yet ? :)
@yapayzeka
@yapayzeka 3 жыл бұрын
9:00 why cant we write we want a spesific type of resource like this: export (Array, Item) var items
@yapayzeka
@yapayzeka 2 жыл бұрын
godot STILL doesn't support custom class export types T-T
@faridrifai2166
@faridrifai2166 3 жыл бұрын
Here i come again
@andrewsimpson4134
@andrewsimpson4134 2 жыл бұрын
This was a great tutorial and also shows how to set up and use Resources, which I hadn't done until now. I changed quite a bit to suit my needs. I did have a question though. How would you account for items that might be of the same "type" but have different properties? For example, you might have a SteelSword.tres that all steel swords share, but say the player has one and enchants or upgrades it giving it more damage or elemental attributes? You wouldn't just be able to change the SteelSword.tres without changing ALL steel swords in the game, right?
I Created LAVA Chess
8:06
ChessTraps
Рет қаралды 42 М.
Советы на всё лето 4 @postworkllc
00:23
История одного вокалиста
Рет қаралды 5 МЛН
Why Is He Unhappy…?
00:26
Alan Chikin Chow
Рет қаралды 91 МЛН
Kind Waiter's Gesture to Homeless Boy #shorts
00:32
I migliori trucchetti di Fabiosa
Рет қаралды 2,4 МЛН
Using Composition to Make More Scalable Games in Godot
10:13
Firebelley Games
Рет қаралды 215 М.
How to Code (almost) Any Feature
9:48
DaFluffyPotato
Рет қаралды 673 М.
6 Tips to Better Organize your Godot Projects
11:39
GDQuest
Рет қаралды 134 М.
Overconfident Guy Thinks He Can Beat Me In Chess
18:17
Anna Cramling
Рет қаралды 1,7 МЛН
Grid Based Inventory System | Godot Inventory Tutorial
24:24
Game Development Center
Рет қаралды 39 М.
Building Better Crafting Systems
18:24
Adam Millard - The Architect of Games
Рет қаралды 797 М.
Easy Inventory System in Godot 4
24:47
Outback Nerd
Рет қаралды 4,1 М.
Советы на всё лето 4 @postworkllc
00:23
История одного вокалиста
Рет қаралды 5 МЛН