Basic Inventory System [Part 1] - Godot 4.x

Поділитися
Вставка
  • Опубліковано 21 гру 2024

КОМЕНТАРІ • 41

  • @nue_hazel
    @nue_hazel 5 місяців тому +13

    the fact that you provide both GDscript and C# version, thanks for the effort !

    • @SynfulWuulf
      @SynfulWuulf 5 місяців тому

      it is fantastic since I believe a lot of people are migrating to Godot, but at the same time makes the videos hard to follow at least for me with 2 different scripting languages needing to be addressed at the same time, makes it really hard to absorb the broad range of information. If this is really targeted towards developers at this point rather than people getting INTO game dev, it should probably just give us the run down of how to create said system without getting into the nitty gritty per line

  • @Akalabeth
    @Akalabeth 2 місяці тому +2

    Followed step. Works in Godot 4.3 atm

  • @harmonichaoticart
    @harmonichaoticart Місяць тому

    Dude youre insane. Finally a tutorial i can somewhat grasp and it actuall works first try.

  • @sanyi9667
    @sanyi9667 2 місяці тому +1

    such a nice tutorial and way of making things. magic! thanks a lot!!!

  • @belgbeladel
    @belgbeladel 5 місяців тому +1

    Excellent exactly what i needed

  • @ilhanilhanDev
    @ilhanilhanDev 5 місяців тому +3

    "Oh, here we go again."
    Again need watch about inventory system after Unity :)

    • @Bonkahe
      @Bonkahe  5 місяців тому +1

      Lol, they sprout like weeds around here.
      But I was asked several times a while back to do it so here I go making inventories again xD
      That being said, for the most part, if your willing to dip your toes in c#, the implementations in unity are pretty similar, UI aside.

    • @ilhanilhanDev
      @ilhanilhanDev 5 місяців тому +1

      i know how make inventory system, one on Unity guys explain me on example supermarkets boxes-cases with items. Now i can do this. But me need understand ui Godot. I think Ui Unity and Godot4 little differ.
      I don't know becouse i not long worked hard with this side stuff, becouse of this not intereseted me before ;)

  • @BigSmokke-pj8zz
    @BigSmokke-pj8zz 3 місяці тому +1

    I am getting an error that exeprestion of type node3d cant be type of InteractableItem

  • @Moni-ob7xi
    @Moni-ob7xi 2 місяці тому +1

    what do i have to change to have a second iteractable item? i have the test cube but i want to also have a colored box iteractable

    • @Bonkahe
      @Bonkahe  2 місяці тому +1

      You should be able to just make a new packed scene, then add that scene to a new ItemData resource and add that to the list of item types just like I did with the one in the video.

  • @pvpworld
    @pvpworld 5 місяців тому +10

    the thing i hate about all these inventory tutorials is how theyre all single slot inventory items and not more like diablo 2 or tarkov type inventory

    • @Bonkahe
      @Bonkahe  5 місяців тому +6

      Lol I totally agree, but I'm also understanding of the dilemma, do you on one hand make an inventory system that is more complex and allows for more interesting gameplay and risk the majority of people not actually use the thing, or do you go the list route and make it simpler, allowing the majority of projects to at least make use of the underlaying code, but it's pretty boring for the more experienced devs.
      I think what I'll do is, since the underlaying system is very similar, go ahead and make the list kind as the basic inventory system, and then make a couple of episodes following that with implementing a grid based system, it's actually not too complicated, so maybe I could get it in just one episode...

    • @Andserk
      @Andserk 5 місяців тому

      ​@@BonkaheMan I would love to see a grid tutorial, your tutorials are always top quality. Keep up the good work 💪

    • @pvpworld
      @pvpworld 5 місяців тому

      @@Bonkahe that would be awesome.. ill definitely sub so i dont miss out

    • @pvpworld
      @pvpworld 5 місяців тому

      @@Bonkahe would also be cool if you went over implementing rotating items in the inventory as well, like tarkov and DayZ

    • @kulak8548
      @kulak8548 4 місяці тому

      It is also a bit frustrating that they all use godot's built-in hold click and drag functionality, rather than just a click and release to grab the data. Most games use the latter.

  • @sosigwithnobucks4636
    @sosigwithnobucks4636 Місяць тому +1

    It picks up the object but shows no outline...

    • @sosigwithnobucks4636
      @sosigwithnobucks4636 Місяць тому +1

      Okay it does work now, I added the material to the mesh instead of the outline. Amazing job buddy.

  • @kiryonnakira7566
    @kiryonnakira7566 4 місяці тому +2

    I would like to suggest some changes to the github repo.
    I would love to see a branch for each episode.
    The reason being that I just picked up the tutorial, but it's really hard to get the project as it is at the start of the first episode.
    In reality, it's not much of a problem. i mean, Godot offers a pretty decent player controller to start with, and when you're used to it, it's not that hard to implement movement. The scene can also be whatever you want, it doesn't need to follow exactly what you do.
    But i can see begginners who would want it that way.

    • @kiryonnakira7566
      @kiryonnakira7566 4 місяці тому

      7:48, for better performances, I recommand using "DistanceSquaredTo" instead of "DistanceTo" as we don't use the distance itself. All we care about is finding the nearset item.

    • @Bonkahe
      @Bonkahe  4 місяці тому +1

      So this ones a little bit complex, I actually did a similar method with my fps horror series, but it ended up being rather bloated, I have not thought to do them as different branches though, I will have to try this out and see if it works, that might very well be a better method to keep it clean, but have access to every tutorial version.
      Sorry about the clunkiness xP

  • @Originalshy
    @Originalshy 4 місяці тому

    I keep having this problem
    print("Item id:" + str(i) + " Item Name:" + ItemTypes[i].ItemName)
    I keep getting these error messages
    Expected closing ")" after grouping expression.
    Expected ":" after "if" condition.

  • @ΔΑΝΙΗΛΚΑΤΡΑΝΤΖΗΣ-ι3υ
    @ΔΑΝΙΗΛΚΑΤΡΑΝΤΖΗΣ-ι3υ 4 місяці тому +1

    Invalid set Index 'visible' (on base: 'Nil') with value of type bool. At InteractableItem, ItemHighlightMesh. I followed your tutorial step by step i rewatched many times I searched and I can't fix it

    • @Bonkahe
      @Bonkahe  4 місяці тому +3

      In the TestCube Packed scene (Or whatever your item packed scene is) make sure that ItemHighlightMesh is assigned to a mesh, the way this error occurs means that field is null.
      This is done in the inspector, you can just click the field where it says "Assign" and select the outline mesh, I don't know any way that this could be breaking besides this.
      If your still not able to get this working, hit me up on discord, I can go over it with you in voice and see if I can figure it out.

  • @JamesTalbot-kr8ly
    @JamesTalbot-kr8ly 4 місяці тому +1

    Does this not work for godot 4.2?
    @export var ItemTypes : Array[ItemData] = []
    var NearbyBodies : Array[InteractableItem]
    With this I keep getting.
    Line 5:Could not find type "ItemData" in the current scope.
    Line 7:Could not find type "InteractableItem" in the current scope

    • @Bonkahe
      @Bonkahe  4 місяці тому +1

      Hmmm should be working just fine in 4.2
      Make sure you you have "class_name ItemData" and "class_name InteractableItem" at the top of both their classes just below the extends line, you may also have to restart Godot to see the update.
      This can also occur if there is an error in ItemData or InteractableItem scripts. If it's not any of those things I honestly am not sure what it could be, let me know if any of those help, if not I might have to see your code to know what's up.

    • @kissasa100
      @kissasa100 2 місяці тому

      @@Bonkahe I just place the class_name on top of both classes and Ctrl + S and just works now!

  • @jasonwilliams8730
    @jasonwilliams8730 5 місяців тому

    👍

  • @mikeg.5140
    @mikeg.5140 4 місяці тому

    This is a great tutorial. But for some reason, I keep getting an "Item not found" error.
    I used your code directly from Git. Tried like crazy to fix/debug but can't figure it out. And I'm using Godot 4.1.3

    • @Bonkahe
      @Bonkahe  4 місяці тому

      Hmmm, try this, delete the resource for the item template, make a new one following how I did it, where I assigned the packed scene for the item and gave it a name, then delete the items in the scene and drag in an all new one, if that doesn't work I might have to check this out, only thing I can think of is that the difference in Godot version between 4.2 and 4.1 is an issue, but I don't see how it would be.

    • @mikeg.5140
      @mikeg.5140 4 місяці тому +1

      ​@@Bonkahe bare with me I'm still green/new to Godot, but did you meant (A) delete the 'extends Resource' in the script?
      or (B) delete the ItemData.gd script entirely? I tried both, (A) breaks the PlayerInteractionHandler.gd and (B) tried to add -> @export var ItemModelPrefab : PackedScene = preload( my model scene here) to a new ItemData.gd script; neither worked.
      -sidenote: in your part 2 video when you connected the 'PickUpItem' signal
      from the PlayerHandler --> Inventory, in your video it shows up at PickUpItem(item : ItemData)
      but in my project it shows up at PickUpItem(item: Resource) ??

    • @Bonkahe
      @Bonkahe  4 місяці тому +1

      Ok, so I actually didn't mean any one of those things, I meant in the inspector on the interaction area just clearing out all the Item types and remaking them, sorry I was unclear xP
      As for everything else, honestly there's no way to know at this point what's been changed and what hasn't, why don't you message me on discord and we'll meet up in the godot cafe this evening and I can help you out. You can find me on there under the name Bonkahe.
      Also as far as the side note, the reason why it says item:resource is because of the previous issue with itemdata not having a class name, nothing that can't be sorted once the first problem is fixed though.

  • @SynfulWuulf
    @SynfulWuulf 5 місяців тому

    I know you're busy and already have videos planned and stuff, but I'd LOVE to see how to create something similar to a randomized planet. A reference to look at would be similar to the planets in No Man's Sky.

    • @Bonkahe
      @Bonkahe  5 місяців тому

      This is something I've wanted to do for a long time, but to be honest, I have so much other stuff going on it's going to be pretty hard to get to it any time soon xP
      But I will put it on my backlog and we'll see~