Тёмный

INVENTORY & ITEM SYSTEM in Godot 

Code with Tom
Подписаться 13 тыс.
Просмотров 56 тыс.
50% 1

In this video I will show you how to create an inventory and item system in Godot 3.2 with persistant player inventory using Godot resources and ResourceSaver.
Third Person Character Controller Tutorial: • Third Person Character...
FPS Character Controller Tutorial: • FPS Character Controll...
Patreon: / codewithtom
Discord: / discord
Twitter: / codewithtom

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

 

18 июн 2020

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 182   
@ZPaul2Fresh8
@ZPaul2Fresh8 Год назад
It is to be noted that the syntax to export variables is now '@export var'. I've found this while using version 4.0.2 and I'm unsure when this started but hopefully this helps others.
@kblin517
@kblin517 4 года назад
deletes func _ready(): *procedes to write func _ready(): Is this the equivalent of opening up blender, deleting the default cube and instantly doing shift + a add cube?
@colossus779
@colossus779 4 года назад
searching google in google
@codybeach2258
@codybeach2258 4 года назад
If you delete the default method and create a new ready method you get more functionality
@kblin517
@kblin517 4 года назад
@@codybeach2258 HAEHKAEHKAEKHAEKAHEAHE
@wiktorwektor123
@wiktorwektor123 3 года назад
He could just select Template: None when creating script and it would just contain one line: extends Resource
@EidoEndy
@EidoEndy 3 года назад
I think it's just a case of brain on autopilot. So yes.
@tinokaartovuori
@tinokaartovuori 4 года назад
Absolutely great tutorial! Prolly the best I have ever watched. Super informative and detailed and still not too long. Thanks a lot dude, 5/5!
@snstarosciak
@snstarosciak 3 года назад
I wish this video had more views because your way of handling an inventory system using resources is absolutely top notch :) SUBSCRIBED :D
@t6_archives
@t6_archives 4 года назад
Scare Daddy. We miss you, glad to see you're still uploading!
@CodeWithTom
@CodeWithTom 4 года назад
T6! How you doing? Miss you guys too. Drop me a DM on Twitter 😁
@TheSubzeto
@TheSubzeto 4 года назад
Your videos are inspiring. I followed the "Make an FPS" parts and it really helped me to further understand how Godot works. keep it up
@CodeWithTom
@CodeWithTom 4 года назад
That's great to hear! Thanks!
@paxcallow
@paxcallow 2 года назад
this is a concept that has always intimidated me in gamedev, which has basically stopped me from making uh... any kind of complex game whatsoever lul. but you explained this very well, even for my tiny brain! it'll take more studying but i think i have a light grasp on it now. so thank you!
@kennethmontgomery1621
@kennethmontgomery1621 Год назад
WOW! Such a nicely designed tutorial. This really helped me out. Thank youI
@lynex5444
@lynex5444 Год назад
By the way, your video is amazing! I would love to see a second part, in which you approach some untouched aspects, like using the UI to "spawn" the items.
@VictorBStan
@VictorBStan 3 года назад
Great tutorial! Please more like this! Good programming practices
@sabinamariteslanada9748
@sabinamariteslanada9748 4 года назад
Can you make a video on how to save and load items using this inventory system of yours
@jordanmason4024
@jordanmason4024 3 года назад
I would love to see a tutorial on how to make an actual useable item with effects!
@pascalz9992
@pascalz9992 4 года назад
great video. easy to follow and very complete! I hope I'll be able to use this in a game soon.
@CodeWithTom
@CodeWithTom 4 года назад
I hope so too! :)
@redbu11
@redbu11 2 года назад
finally, a proper inventory implementation guide, unlike what other youtubers propose
@vickylance
@vickylance 4 года назад
Amazing the resource trick was very good. I am going to take this idea and going to expand onto it :D
@CodeWithTom
@CodeWithTom 4 года назад
Thanks Vignesh!
@SergioCandelaRamirez
@SergioCandelaRamirez 3 года назад
awesome vid Mr Tom, great!!
@chrisvogel.8370
@chrisvogel.8370 2 года назад
Excellent Tutorial!
@andersstrom740
@andersstrom740 4 года назад
Awesome video Tom. Just curious. How do you set the texture inside the InventoryGrid? Perhaps it will be explained in the next tutorial video =)
@danielchettiar4393
@danielchettiar4393 3 года назад
Hey thanks for this amazing tutorial , beginners like me get to learn a lot about the game engine this way. Although I was wondering : *How do you reset the items in the inventory to a constant value when you load the game?*. :)
@Eternic_
@Eternic_ Год назад
this might just be the best inventory tutorial i've seen so far. i love how clean your code is and on top of that you explain complex systems in a way that makes it easy to follow. do you consider making more videos about this topic? there are so many things still left untouched that i would love to see your approach on. for example making the inventory visuals, drag and drop (by clicking, not just dragging), splitting stacks, dropping items, equipping or consuming items and so on in any case that's an easy sub for me and i hope to see more of you in the future!
@juiceman7649
@juiceman7649 3 года назад
Keep making these videos Tom they are Oh so good
@maxwamsley
@maxwamsley 2 года назад
Holy sheet this is a great tutorial. It really is great for teaching you the gd script API and how it works.
@mrvladimir3795
@mrvladimir3795 3 года назад
Thx big for your work!!!
@alexsouthworth4978
@alexsouthworth4978 2 года назад
really good video bro
@1luckyjo
@1luckyjo 4 года назад
🤘 love you videos xx
@CodeWithTom
@CodeWithTom 4 года назад
Thank you!!
@dani.ochouno
@dani.ochouno 4 года назад
Awesome! Thanks
@CodeWithTom
@CodeWithTom 4 года назад
No problem!
@maneatingspam9069
@maneatingspam9069 3 года назад
I did not understand a f*cking thing in this video but my inventory system works so thanks :)
@aminimal_
@aminimal_ 2 года назад
Solid tut
@paolocrivello3646
@paolocrivello3646 3 года назад
I don't think the database approach would scale performance wise if you have more than a thousand items. Loading upfront all the items resource would require a lot of memory ( if you account the mesh and the textures). Same thing applied for the get item function, worstt case scenario would check the whole database to return an item. If you're going to manage a lot of items you don't really need to load the whole db upfront. I managed to make it fast by searching the item by it's resource name, and by checking if the resource exists
@cmds.learning7426
@cmds.learning7426 3 года назад
cool work
@Mayerisli
@Mayerisli 4 года назад
This works great! But where would i add custom code? Like what effect the Item would have if you right click with it or so.
@jaruizm1
@jaruizm1 4 года назад
I want to thank you for all your awesome tuts. I follow the top-down tut and I create a fun Combat-like tank game but I want to ask you if I can open source the game because I'm base the game in your code. Thank you. PS: sorry for my english
@CodeWithTom
@CodeWithTom 4 года назад
Thank you for your kind words. You absolutely can and I'd love it if you'd share your creation on our Discord 😁👍
@fruitdudetv
@fruitdudetv 3 года назад
well thanks for the video. now i have to figure out how to remove items xD this will be a hassle
@fruitdudetv
@fruitdudetv 3 года назад
if anyone has expanded on this system i would appreciate it if you write me a message :D
@andrianharrykennethwong1115
@andrianharrykennethwong1115 3 года назад
@@fruitdudetv Well, I've managed to remove items on it but I'm still figuring out how to equip or use the items. It's simple just create a new function in the Inventory.gd with _items.remove(index). Also, don't forget to emit signal inventory_changed.
@zero3259
@zero3259 4 года назад
Hi. Great video. How can i equip or use items that i collect?
@Willior47
@Willior47 3 года назад
SOLVED BEFORE I POSTED, SOLUTION AT END let's say i didn't want to save the inventory data in a separate file when it is changed (i'll save it elsewhere). how would you get the UI to update after changing scenes? the GameManager initializes the player once. i have the player.inventory reference passed through via a singleton script. i then reinitialize the player (via its own function) for the GameManager, except instead of loading the inventory from the file, i load it from my previous reference. all this works fine. in your initialise_player function in the GameManager, you emit a signal that is listened to by the UI, which connects player.inventory to the UI's _on_player_inventory_changed function to update the display. my problem is that this signal does not appear to be re-emitted when i re-initialize the player, therefore, when i change scenes and reinstantiate the player, nothing i do will make the label in the UI show up. nothing except for manually calling the GameManager's reinitialize function with a hard-coded keystroke - which, again, connects the player.inventory's "inventory_changed" signal to the UI's "_on_player_inventory_changed" function. is it "connecting" late? SOLUTION: fixed the issue by moving the UI's player_initialization connection from _ready() to _init().
@hozerino
@hozerino Год назад
Another doubt just appeared as I was near the end of the video. At 47:43, you create the Magic Orbs, what would be the best way to make it so as each Magic Orb has some unique stats? For example if I have a sword (non stackable), and it has a durability counter, what's the best way to store that between dropped/equipped/saved states?
@BoobCheese
@BoobCheese 4 года назад
Thank you tom
@CodeWithTom
@CodeWithTom 4 года назад
You are very welcome
@BoobCheese
@BoobCheese 4 года назад
@@CodeWithTom Do you mind doing some UI tutorial in godot sometime?
@hozerino
@hozerino Год назад
I have a question. At around 28:01, you create new_item as a dictionary. Is there a reason to not create a InventoryItem class (from Resrouce) to keep this data instead of a Dict? This way we would be able to have the static typing advantage. Is there a reason to not create it as a class?
@artfreak2074
@artfreak2074 2 года назад
Great tutorial, but how can we access item values and functions, to use a health potion, for example? ^^
@demetriusharris2169
@demetriusharris2169 3 года назад
just finished the last one ........i was wondering if you can tackle a leveling up and power up system every game has those also
@heyallisonshea
@heyallisonshea 2 года назад
Hi! This tutorial was super helpful and I learned a lot. I was curious how I would go about using textures rather than text so that I can have a visual inventory. I think I just need to reference the texture rather than have a string for the item name but I'm not entirely sure how to do that since each item has a different texture. Would I use the resource so it loads a general texture?
@garrettbates2639
@garrettbates2639 Год назад
You've probably gotten a solution worked out by now, one possible option would be to save an image somewhere in "assets/", and export a Texture from the ResourceItem script. In each concrete implementation of a ResourceItem, you can set that Texture in the inspector. Then instead of just adding a Label to the UI, you could also create a TextureRect, similarly to how he creates a Label in the video. You'll set the TextureRect.texture property to point to the Texture that is exported by your concrete ResourceItem (Pickaxe.texture, for example). Lastly you'll add it to the GridContainer. You'll probably want to combine the Label and TextureRect into a single UI node, which inherits from Control (or one of it's subclasses), so that they get added together as a single item in the GridContainer, instead of as two separate items. Hope this is helpful, if you haven't already found a solution.
@dsmeckt2283
@dsmeckt2283 Год назад
A very nice tutorial! Only thing i dont understand is why the _items in the Inventory Resource is an export variable. Because when you make the MagickOrb you use the exported vars to configure the MagickOrb, but with the Inventory you dont use the _items to configure anything. And you use the functions to manipulate the _items internally. Am I mising something here? Or is it an Export because it otherwise dont get saved on the disk?
@DrujdCZ
@DrujdCZ 3 года назад
Amazing tutorials. Works splendidly. But i want to expand it a little and use other variables / sprites / meshes :D. Any pointers where i should start? My guess is change somehow get item in item_database script and then add item function in invventory script. I don't want exact solution or tutorial, but just tell me if i am thinking right :D
@FameMonsterD3
@FameMonsterD3 3 года назад
How could we implement this code to have enemies drop gear when killed? I love the video man, best item system video tutorial for godot engine.
@sarfrazkhanabdullaleghari2044
@sarfrazkhanabdullaleghari2044 3 года назад
I have a question. How do you subtract a quantity or an item from the inventory when you are done (let's say) using the item or removing it in-game?
@missingnewjustice4292
@missingnewjustice4292 Год назад
Queue_free 🤑
@Shortclipsyt9
@Shortclipsyt9 4 года назад
Thx
@CodeWithTom
@CodeWithTom 4 года назад
No problem!
@nowherebrain
@nowherebrain 4 года назад
I enjoyed it. I don't think a persistent inventory is a good idea, but I understand you were just showing people some methods to do something like this.
@CodeWithTom
@CodeWithTom 4 года назад
Hi Justin, glad you enjoyed it. Can I ask why you say that you don't think a persistent inventory is a good idea?
@1986DarkStalker
@1986DarkStalker 2 года назад
We are still waiting, Justin. Tell us please.
@engerek666
@engerek666 Год назад
@@1986DarkStalker Create a 2nd world and you'll see why. I followed this tutorial to design my inventory but it quickly became a nightmare during changing scenes. This doesn't work even if you change the scene to itself. So I shifted to a "create when you need it" approach.
@GuitarGod229
@GuitarGod229 4 года назад
Hey Tom, I am having an issue with the items displaying in the inventory. I have it set to add 3 Oak Logs, and instead of adding a stack of 3 Oak Logs, it adds 3 stacks of x1 Oak Logs. I tried messing with the export var and even the max_stack_size check in the Inventory script but nothing seems to fix it?
@Pengoony
@Pengoony 4 года назад
How would this work if you have weapon items in your game? Like a sword that is an area2d and swings around?
@badstorygames5391
@badstorygames5391 3 года назад
Hello. How can you implement a method to remove an item from inventory?
@venturex8441
@venturex8441 3 года назад
how can i remove items from the inventory?
@GrimOwlForth
@GrimOwlForth 9 месяцев назад
For those using Godot 4.1 or later, there are a lot of issues you'll run into with the code in this video.
@pinkspyro_nl4040
@pinkspyro_nl4040 7 месяцев назад
almost finished my code on godot 4 with the changes needed
@danielhaup599
@danielhaup599 Год назад
hi, since the folder structure doesnt exist after export do we know how to create a system like this which respects the conversion of the gamefiles?
@GamerPlaya12
@GamerPlaya12 3 года назад
Would this way of using resources as items be expandable upto 100’s of items in a game?? (Performance wise and in general)
@Joe-yv6zj
@Joe-yv6zj 2 года назад
Pls can u explain this part of the code " inventory_item.item_reference.name " in the player inventory Resource script , cause I have gone through godot doc to find such functions or methods so to understand what it does , the return value , and the type it extends
@kenreed1467
@kenreed1467 3 года назад
how to work in an incremental item_id when creating new item sending int over network is more desireable
@54m0h7
@54m0h7 3 года назад
Edit: Solved it, see edit below. Thanks! Mine was saying it couldn't find the inventory.tres file. I created a new resource named that and copied it into my user data, but it's still saying "Invalid Call. nonexistent function 'get_items' in base 'Resource' ". It's highlighting line 23 in the GameManager, the line that says "player.inventory.set_items(existing_inventory.get_items())", so I don't think I created the inventory.tres file correctly, or something. Do you have a solution? Edit: Ok, so I copied the ResourceSaver.save(user://inventory.tres") part just above the If statement so it would create a correctly parsed file. It was still giving me the get_items error. I just copied the "get_items" text from the func and pasted it over it and then it suddenly worked. It's like there was a hidden character or something goofy going on there. I'll leave this comment here in case anyone else has this issue. Thanks for the tutorial!
@Cherry-zg7el
@Cherry-zg7el 3 года назад
I don't know why the line of code at 15:22 gives me a "The getter function isn't defined." Where did I go wrong?
@Axelvad
@Axelvad Год назад
i get the error message "Directory" not declared in the current scope? Any sugestions?
@Karmo77
@Karmo77 3 года назад
hi , thanks for this , now how to have slots and have one item per slot
@karim8030
@karim8030 Год назад
I've been building my own inventory/ interactabale object system and it functions using a basic node structure (sprite, area2D, etc), and built-in scripts which I'm planning on extending for each unique item. Can anyone help me extrapolate whether I'll run into any limitations with that system as opposed to this one which is based around resources? Saving is something I need to consider, I haven't gotten around to learning that part, or resources in general. But from this tutorial I changed my Inventory (which is an autoload) to extend the Resource type, so I should be able to save that with a bit of added functionality? One of the only other "advantages" I can see to the resource method, is that you have less in your scene tree, and store objects in the file system, which might be preferable subjectively? would appreciate any thoughts
@karim8030
@karim8030 Год назад
great video btw, even if i'm still figuring it out, I can tell its an absolute gold mine.
@lynex5444
@lynex5444 Год назад
Hey, I have a problem with the get_item(item_name) function in the ItemDatabase. It gives me an error at the if i.name == item_name "Invalid get index 'name' (on base: 'null instance')". I don't really understand the error (since I'm pretty new to Godot), can somebody help me? UPDATE: Problem solved. It apparently appended the items from a wrong folder or smth. I just reassigned the folder and it worked. I don't know what the problem actually was.
@BigDaddyWes
@BigDaddyWes 3 года назад
Thanks for the tutorial, but I'm getting this error when I try to play my project: E 0:00:01.159 emit_signal: Error calling method from signal 'player_initialised': 'GridContainer(InventoryGrid.gd)::on_player_initialised': Method not found.. core/object.cpp:1228 @ emit_signal() GameManager.gd:17 @ initialise_player() GameManager.gd:9 @ _process() Not sure what the problem is, any ideas? Code at the noted lines seems correct.
@jvstAsYouAre
@jvstAsYouAre 3 года назад
How would i access the item type in the script?
@stephelton
@stephelton 3 года назад
FYI, "if it's not a directory, it's definitely a file" is not true on anything other than windows (or even WSL).
@zachaydraws8764
@zachaydraws8764 Год назад
Following this tutorial, followed everything to a tee and yet when I run it says "Invalid get index 'inventory' (on base: Spatial) Version 3.5.1
@zackyang123
@zackyang123 4 года назад
Broh this is a great video in general but you should use a dictionary instead of an array for constant time access to those inventory items instead of having to search that array.
@2tired2sleep2
@2tired2sleep2 3 года назад
Finally did it, WITH NO WARNINGS😩
@juiceman7649
@juiceman7649 3 года назад
what were the problems ? mine keeps crashing at the moment
@2tired2sleep2
@2tired2sleep2 3 года назад
@@juiceman7649 I don't even know. I rewatched multiple times and I gave up for like 3months. Gave it another shot and retyped everything again and it worked. I guess I missed something but I truly couldn't tell you :(
@juiceman7649
@juiceman7649 3 года назад
@@2tired2sleep2 Yeh I've done that with a few tutorials usually I'll just re read over it a bunch till I understand as much as a I can and see if I can find anything that didn't make it work but otherwise sometimes you do just have to type it all out again
@2tired2sleep2
@2tired2sleep2 3 года назад
@@juiceman7649 yup. This time I guess I was extra careful. If you want I can send my project and you can disect what I wrote
@juiceman7649
@juiceman7649 3 года назад
@@2tired2sleep2 Should be alright for now gonna give it a look over again in the future I feel like it's throttling my laptop to hard trying to process the inventory that it can't even throw an error because it's too much for it to compile, I am running it on a pretty average - low spec laptop once I upgrade it'll hopefully just throw an error but i'll look over it again before then, cheers anyway really appreciate it, just gonna work on some more animation battle mechanics for my game in the mean time and dialogue
@FameMonsterD3
@FameMonsterD3 3 года назад
Hey @Code with Tom I'm not seeing the name of the items im picking up on the panel, not sure why
@loki_str4568
@loki_str4568 3 года назад
did u fix it? got the same problem
@buttondefine4988
@buttondefine4988 Год назад
Hi, this probably won't be seen, but I have an issue. I've followed the tutorial up to 43:00, but when I play the scene, none the label simply does not come up. I have a different name for both the player and the item. Idk what's gone wrong.
@buttondefine4988
@buttondefine4988 Год назад
Problem fixed. Simply a typo in my code. Really check your scripts, peeps!
@ToastedGears
@ToastedGears 4 года назад
hey I really like your inventory system, I was so free to add it to my project but I have one issue and I don't know how to fix it. Can you make that the text won't delete every node in the grid? Maybe I'm just stupid but I don't want to have Potion x2 but a texture of the potion in a texture rect inside the grid container.
@Karmo77
@Karmo77 3 года назад
hi do you find a solution? if so could you give it to me
@ToastedGears
@ToastedGears 3 года назад
@@Karmo77 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-FHYb63ppHmk.html
@TheVegen
@TheVegen Год назад
Is there any plans to make a Godot 4 version of this tutorial? I am stuck with converting this line into the new format: export var _items = Array() setget set_items, get_items. So far I have this: @export var _items: Array but don't know how to get the setget part working.
@fisher2470
@fisher2470 Год назад
I think this would work: @export var _items : Array : set = set_items, get = get_items
@pinkspyro_nl4040
@pinkspyro_nl4040 7 месяцев назад
@@fisher2470 almost, it's @export var _items = Array(): set = set_items, get = get_items
@pinkspyro_nl4040
@pinkspyro_nl4040 7 месяцев назад
almost finished the godot 4 version
@bity-bite
@bity-bite 4 года назад
Can you fix sliding from slopes?
@vickylance
@vickylance 4 года назад
3d or 2d?
@thomaslaville1178
@thomaslaville1178 4 года назад
Amazing work! However, I've follow all your tutorial but when I'm launching my UI scene, nothing appear on the screen (no error in the code, just no visual result). Do you know how to resolve this issue ? Sorry for the question as you are already giving us a great inventory system, but I don't find where is the issue. thanks a lot!
@CodeWithTom
@CodeWithTom 4 года назад
Hi Thomas, do you have your UI as a separate scene? Can you make sure when you run your game that you have the correct scene set as the launch scene in project settings.
@thomaslaville1178
@thomaslaville1178 4 года назад
@@CodeWithTom Hey thanks for your reply ! Actually I checked the debugger one more time and I simply mistook to give the proper path to my player node. I'm working on fixing that
@commentingexistentialcrisi9564
@commentingexistentialcrisi9564 3 года назад
why is it when i make a new array in the inventory, it copies all the items in the _items array?
@commentingexistentialcrisi9564
@commentingexistentialcrisi9564 3 года назад
is this a bug?
@neronim1141
@neronim1141 4 года назад
Question, wouldnt Dictionary be better for item database instead of array? Array works well when you dont have lot of items, but i belive Dictionary is quicker with lots of them, or im wrong?
@CodeWithTom
@CodeWithTom 4 года назад
Hey Nero. Both are perfectly valid options. Arrays are easier to use when you want an inventory with a defined amount of slots and you want to put items in a specific item slot. For example with an array you could easily put an item in the 9th slot by assigning it to inventory [8] (since arrays in Godot start at index 0). With regards to speed and performance. I doubt you would ever encounter an inventory large enough to see any meaningful difference in performance, unless you had thousands of inventory items.
@neronim1141
@neronim1141 4 года назад
@@CodeWithTom i understand using array for players Inventory, im talking about part at 13:07 where you setup Item database and using For Loop, to get Item script variable by name instead of: items.append(load(...)) do something like: var item = load(...) items[item.name] = item then get_item(item_name): return items[item_name]
@CodeWithTom
@CodeWithTom 4 года назад
@@neronim1141 oh apologies. Yes this would potentially be a better solution for the item database for sure 😁
@redex991
@redex991 4 года назад
At the end,when you pick up the orb the First stack goes 1,2,3 and the second one goes from 1 to 3 whitout taking the ladt orb (i didn't see all the video lol)
@CodeWithTom
@CodeWithTom 4 года назад
I picked up both orbs at the same time because they were close together and had a large collision sphere 😁
@redex991
@redex991 4 года назад
@@CodeWithTom Oh,ok 👍
@Zen-rw2fz
@Zen-rw2fz 3 года назад
Any reason why you would prefer this over just creating a dictionary for all items in a standard autoload alongside an inventory array?
@tnuoccaeht
@tnuoccaeht 3 года назад
My inventory is now many stacked and unstacked items which don't go away even after I close the game then run it again. Maybe I missed something.
@tnuoccaeht
@tnuoccaeht 3 года назад
oh i deleted inventory.tres to clear it and it just made a new one upon running
@4steroid
@4steroid 9 месяцев назад
Can anyone help me to make a remove_item function for the inventory? I want to make a shop, so I need to remove items when the player sells them. I'm having trouble reverse engineering the add_item function.
@CodeWithTom
@CodeWithTom 9 месяцев назад
My upcoming FPS series will have a section for inventory management.
@shonen991
@shonen991 12 дней назад
@@CodeWithTom as far as I can tell, something that never came out. Please. How to remove_item?
@NerChick
@NerChick 4 года назад
Hello, thanks for tutorial but I have error that saying that it can't find player node 32:35
@ksiomix5062
@ksiomix5062 4 года назад
same here
@rl_ledge9284
@rl_ledge9284 4 года назад
@@ksiomix5062 i am also getting that error :(
@rl_ledge9284
@rl_ledge9284 4 года назад
Oh already fixed it, what i did wrong was that i used /root/world/player but in my world I also have a ysort and my player is a child of the ysort so it should be /root/world/ysort/player
@ksiomix5062
@ksiomix5062 4 года назад
deuwe im fixed that 1 week ago but i forget to swy
@BrotherGokuSon
@BrotherGokuSon 4 года назад
I have a few errors, and i dont know how to fix them, here they are: E 0:00:03.072 load_interactive: Cannot open file 'user://inventory.tres'. Condition "err != OK" is true. Returned: Ref() scene/resources/resource_format_text.cpp:1228 @ load_interactive() GameManager.gd:20 @ initialize_player() GameManager.gd:9 @ _process() E 0:00:03.171 _load: Failed loading resource: user://inventory.tres. Condition "found" is true. Returned: RES() core/io/resource_loader.cpp:278 @ _load() GameManager.gd:20 @ initialize_player() GameManager.gd:9 @ _process() it is also saying that Invalid get index 'name' (on base: 'String')
@JohnSmithULIR0
@JohnSmithULIR0 4 года назад
E 0:00:03.072 clearly states: [Cannot open file 'user://inventory.tres'] at the end of the error stack. Meaning essentially there is no file named `inventory.tres` at the location (root) where it tried to find it. Then E 0:00:03.171 clearly states that it failed to load the same resource, subsequently because it was not found at first. - To resolve this issue you must create the file in question.
@jomarllamas7890
@jomarllamas7890 3 года назад
Have you found an answer to this i have the same problem. I tried creating an inventory.tres file but problem's still there
@brokedustpan1778
@brokedustpan1778 Год назад
I'm having the same issue with _load: Failed loading resource: user://inventory.tres.
@masterox2
@masterox2 4 года назад
First
@loopatronic
@loopatronic 4 года назад
Okay, so I went by your video, but for some reason in the "Player.gd" script it throws out an error " Attempt to call function 'new' in base 'null instance' on a null instance." (video time 30:21)
@Kaptinkumar
@Kaptinkumar 3 года назад
I have the same error did you figure it out?
@loopatronic
@loopatronic 3 года назад
@@Kaptinkumar Sadly I didn't. I moved on to coding discord bots, from time to time I go back to godot, but most of the time I make maps and stuff like that.
@yamiprincess
@yamiprincess 4 года назад
Is this tutorial on github?
@flow1194
@flow1194 4 года назад
my label is empty and I don't know what I have done wrong. Where are the "typical beginner mistakes"? Ps: I added the control nodes to the player because I wanted the inventory to move with the player
@loki_str4568
@loki_str4568 3 года назад
did you fix it? got the same problem
@BrotherGokuSon
@BrotherGokuSon 4 года назад
29:08 time in vid :P
@midasmyad
@midasmyad 4 года назад
Is the code on your github tom?
@CodeWithTom
@CodeWithTom 4 года назад
Hey I'm afraid this one isn't right now, but I'll look to get it up asap!
@EllisTheMenic3
@EllisTheMenic3 3 года назад
initialise_player() i have wrote Var Player and Var player_initialised() Yet it says I have not declared initialise_player() in the current class even though I have, I am comparing my script and I see no difference, you also should explain a bit more instead of just typing, help
@2tired2sleep2
@2tired2sleep2 3 года назад
I have the same issue!
@EllisTheMenic3
@EllisTheMenic3 3 года назад
@@2tired2sleep2 Ahh im so confused! I lost all motivation for my project now :( Ill keep looking for tutorials and reply if I find a working one. hopefully it helps.
@2tired2sleep2
@2tired2sleep2 3 года назад
@@EllisTheMenic3 I feel it, I couldn't figure out inventory for the longest. I watch a few tuts and now I have a botched up script that finally works (half the time). Keep trying bro, watch EVERY VID, read EVERY DOC in the official godot doca
@EllisTheMenic3
@EllisTheMenic3 3 года назад
@@2tired2sleep2 Thanks! GG for staying motivated and making it! I have high hopes for you game!
@afamefuna1682
@afamefuna1682 4 года назад
For some reason when i click play, now it dosnt even load up the game or screen
@CodeWithTom
@CodeWithTom 4 года назад
Hi, any error messages?
@afamefuna1682
@afamefuna1682 4 года назад
@@CodeWithTom for some reason there isnt any error messages it just wont load up.
@afamefuna1682
@afamefuna1682 4 года назад
@F - BEATS ye same
@codeziefer9250
@codeziefer9250 4 года назад
Same here also has anyone found a solution?
@ejordifon
@ejordifon 4 года назад
@@codeziefer9250 I had the same problem and got it working by checking the indentation on line 15 in ItemDatabase.gd (the one that goes "filename = directory.get_next()"). This line needs to be outside the previous "if" condition. Tom has it right in his code at 12:00, so just check if you have the same indentation level as him. Hope it helps!
@NerChick
@NerChick 4 года назад
PLease help me!
@rynnbrandt
@rynnbrandt 3 года назад
I don't have a user://inventory.tres file. How do i create one? Please excuse me if my question is silly, I'm new to game development.
@rynnbrandt
@rynnbrandt 3 года назад
I tried creating a new resource file but item.gd defines the resource class. get_items is not a function of this class but instead of inventory.gd which extends node. I cannot create inventory.tres using the inventory.gd because it's not a resource type. What am I doing wrong?
@mrkel2137
@mrkel2137 2 года назад
I cant find the items gd script i made and it says my item is a invalid export type any solutions
@NOOBDP
@NOOBDP Год назад
Please, before starting a 50 min tutorial dont just straight up jump into the code. An explanation of what the system is going to be able to do and what is going to be needed for that would be much appreciated. (To be a bit more blunt: Im not going to watch this video because what I explained above is missing in the first few minutes of the video.)
@titustech7219
@titustech7219 2 года назад
when you realize you shouldnt have deleted make human why did i delete it
@joeferrum2179
@joeferrum2179 Год назад
var item var items fkng hell...
@houseofosborne1173
@houseofosborne1173 Год назад
I hard to work through some random bugs for hours that eventually seemed to resolve themselves rip
@_dinnerbox
@_dinnerbox 2 года назад
violets are red roses are blue ctrl: C i stole your code too
@AndrewOBannon
@AndrewOBannon 3 года назад
Why do you create resource? Why not just script with a class_name? Why not new scene?
@aleksitjvladica.
@aleksitjvladica. 3 года назад
[05:01] I can not find ItemResource (Item.gd).
@Haku_Hatake
@Haku_Hatake 3 года назад
When you created your Item.gd script did you change it's type to Resource? Look at the top of your item.gd script, it should say Extends Resource. If not then you won't be able to find it because you never made one.
@mrkel2137
@mrkel2137 2 года назад
@@Haku_Hatake how do i do that i tried to solve it and no luck amd also it says invalid export type for my item any fix?
@mrkel2137
@mrkel2137 2 года назад
If someone can put all the code here so i can post it itl be great lol
@mrkel2137
@mrkel2137 2 года назад
Update it says that invalid export type and i cant see my items resource script
Далее
GDScript (and Programming!) for Beginners in Godot 3.2
37:29
I Made the Same Game in 8 Engines
12:34
Просмотров 3,9 млн
다리에 힘이 풀려버린 슈슈 (NG Ver.)
00:11
Просмотров 2,4 млн
Using Composition to Make More Scalable Games in Godot
10:13
Google Sheets to Godot
14:23
Просмотров 9 тыс.
choosing a game engine is easy, actually
15:08
Просмотров 337 тыс.
My Thoughts on Unity's Pricing Changes
8:22
Просмотров 1,6 тыс.
Creating Diablo IV's Inventory UI in Godot 4
27:51
Просмотров 5 тыс.
Building Better Crafting Systems
18:24
Просмотров 794 тыс.
How to Make an Inventory System in Godot - (#1)
9:25
Просмотров 120 тыс.
Interact with Objects in your World in Godot 4
9:25
Просмотров 14 тыс.
다리에 힘이 풀려버린 슈슈 (NG Ver.)
00:11
Просмотров 2,4 млн