Resource Based Inventory (P2 Item Stacking) - Godot 3.2 Intermediate Tutorial

Поділитися
Вставка
  • Опубліковано 28 вер 2020
  • Thanks for watching my video!
    Here is the source code (MIT License, download the images here): 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!
  • Навчання та стиль

КОМЕНТАРІ • 125

  • @uheartbeast
    @uheartbeast  3 роки тому +30

    Here is the updated source code (MIT License, download the images here): github.com/uheartbeast/inventory-tutorial
    I had a long long weekend (made 2 12 hour trips in the car with 3 kids under 6 years old haha) but I really wanted to make this followup video to my last one. I hope you find it useful as an addition.
    The Fall Sale for my Godot course is ending soon (the end of this month). Here is the link to grab that if you are interested: www.heartgamedev.com/1-bit-godot-course-fall-sale
    My Godot course is pretty much what funds my free UA-cam content so I want to give a big thanks to everyone who has supported me there. It has made it possible for me to continue making UA-cam tutorials, last year around this time I wasn't so sure I was going to be able to keep doing that so I really appreciate it.
    - Ben

    • @sixiangyang
      @sixiangyang 3 роки тому

      Hi,Ben, I 'm interested on your Indiegame EndHall, Would you possible make it to be a series course . whether paid or not ,I will support that .

    • @pierrenagonio
      @pierrenagonio 2 роки тому

      That will be great to see how to make Endhall tutorial :)

    • @jordanlis85
      @jordanlis85 2 роки тому

      Hello HeartBeast ! That's a great tutorial, thank you for that. Do you think that you could do a follow up tutorial with how to make a persistent inventory with a singleton or saving ressources + having items taking multiple slot (for example a sword takes 2 slots, a potion only 1, etc.) ?

  • @shwetanksingh2156
    @shwetanksingh2156 3 роки тому +50

    You are great. Many people can't afford paid courses

    • @ericspeak6110
      @ericspeak6110 Рік тому

      If you can find scratch his one bit Godot course is great also and you get xtras he is very helpful in his discord and there are many others there who are more than happy to help

  • @Lion4de
    @Lion4de 7 місяців тому +2

    For anyone following along in 2023 in Godot 4.1.3, I found that the TextureRect in the InventoryContainer had the mouse filter set to 'Stop', which was blocking the mouse input from getting through to the _unhandled_input function. Set it to Pass or Ignore (similar to what you did for the CenterRect) and it should work.

  • @anicepineapple9067
    @anicepineapple9067 3 роки тому +14

    I once followed this inventory tutorial that took me a week to get though, it had like 30 episodes, each an hour long, and admittedly was very different... But the fact that I was able to get a functioning inventory that I actually understood up an running in a afternoon with the help of these really blows my mind! Thank you!

  • @96enad
    @96enad 3 роки тому +1

    Your tutorials helped me take part in the Ludum Dare jam, thanks!

  • @asztrik
    @asztrik 3 роки тому +8

    Wow, I just did the first one like two hours ago. Great timing!

  • @jlizzle85
    @jlizzle85 2 роки тому

    Thanks for taking the time to make these tutorials. I have enjoyed following along and feel like it is a great start to making my own games in Gadot.

  • @wyanido
    @wyanido 3 роки тому +4

    super heartwarming to see you’re still at it, i got started with gamemaker back in 2016 by watching one of your rpg tutorials, even bought the in-depth gml guide which i still have with me today. couldn’t have advanced this far without you, i’m forever grateful

  • @AjitKumar-qj7pm
    @AjitKumar-qj7pm 3 роки тому +5

    U r really an amazing game developer. Ur pixel art is what to say,cool, amazing and a lot more

  • @drbuni
    @drbuni 3 роки тому

    Thank you for the incredible tutorials once again, Mr. Heartbeast!

  • @asdfkeyboard9807
    @asdfkeyboard9807 3 роки тому +1

    Thank you so much for putting this time and effort into these tutorials,
    Love your channel btw and I really do hope you are making good profit out of this

  • @emiel549
    @emiel549 3 роки тому

    I haven't watched a video of yours for like 5 years and hearing your intro just made me really nostalgic and happy

  • @skepsys_d
    @skepsys_d Рік тому

    These two videos were great! I can also confirm that I was able to follow using Godot 3.5.2 keep up the great work and stay safe out there.

  • @alexline4131
    @alexline4131 3 роки тому +1

    I would love one more tutorial going deeper into menus and IU best practices.
    Thank you for these videos :)

  • @ColtLaCh
    @ColtLaCh 3 роки тому +2

    Hey Benjamin, I had just found the GM book you had wrote years ago, and I decided to check on your channel to see what you've been up to.
    I started watching you around the time you gave out that Udemy course for free on Chirstmas. You were the first programming teacher I've ever had, and, after almost 5 years, I'm now enrolled in an advanced college course for Mobile App Development.
    Just wanted to say thank you. I'm not sure I'd be this proficient with OOP if I had begun with a different language and tutorial channel.
    I wish you the best in your future endeavors, your content is truly exceptional. :)

  • @mio-xh1ln
    @mio-xh1ln 10 місяців тому +1

    great tutorial, as expected! I'm using Godot 4.0.3 and just had to add to the code once so an error doesn't occur! amazing, amazing, amazing :)

  • @adriantome278
    @adriantome278 3 роки тому +7

    Small update to set a non stackable item:
    - Add a BOOL variable in Item class (in my case is_stackable)
    - In the item slot display when u check if the names are equal just add the condition: and my_item.is_stackable
    i´ll try to make a limit on stack size and i will update this, for those who wanna make that thing.

    • @60b1in
      @60b1in 3 роки тому +4

      Or, if you want to have limited stack sizes, have the item resource have a max_stack_size : int. Items that have value 1 will be unstackable, so you don't need the boolean?

    • @agriasoaks6721
      @agriasoaks6721 2 роки тому +1

      So, if we want to make an if statement whether it's stackable or not how do we do that?

  • @GamerReborn1979
    @GamerReborn1979 3 роки тому +1

    you are one of the best instructors out there. don't stop teaching other developer please.

  • @horhorou-8819
    @horhorou-8819 3 роки тому

    Thanks you a lot for this amazing tutorial !
    I was wondering how to make an inventory and you made it so simple !

  • @presauced
    @presauced 3 роки тому

    Thank you, please never stop making videos

  • @watercreator
    @watercreator 2 роки тому

    You sir are a helpful human! Thanks so much for this information!

  • @FrVle
    @FrVle 3 роки тому +1

    Amazing quality, well explained, good pace and straight forward... Thank you!

  • @nubunto
    @nubunto 3 роки тому +13

    Awesome tutorial as always, thanks HeartBeast!
    One small detail that stand out to me, IMO the logic of stacking items should be delegated to the Inventory class. It seems fishy to emit signals from the InventoryItemDisplay instead of the Inventory class. It creates coupling; it only works if I also bring the InventoryItemDisplay scene.
    Great video, you're awesome, can't wait for the hack n' slash tutorial!

    • @uheartbeast
      @uheartbeast  3 роки тому +8

      Good point! I agree.

    • @crashannburnFPV
      @crashannburnFPV 3 роки тому

      @@uheartbeast Will this logic be addressed in some form? Like in the source code or an update video?

  • @badunius_code
    @badunius_code 3 роки тому +18

    Things not covered yet:
    - multiple inventories (inventory/equipped/treasure chest/trader)
    - stack limit (that's the easiest)
    - save/load (very context dependant)
    - using/consuming items
    - stack splitting

    • @Zurasuta
      @Zurasuta 2 роки тому

      I might be wrong, but if you create a new Inventory-type Resource (His "Inventory.tres") you should be able to have a new distinct inventory in which case you'll probably want to have its own Control structure, although I think it wouldn't let you move items between them unless you create a function for the InventoryDisplay that handles a situation when you drag around an item from another Control group.

    • @insidedevelopment5282
      @insidedevelopment5282 Рік тому +1

      @@Zurasuta I agree, would you happpen to know how to go about that, i've been stuck on this for a while.

    • @lordhuebi
      @lordhuebi Рік тому

      Has anyone found solutions to these things? I'm trying to figure out how to put items into the world and then pick them up.

    • @agriasoaks6721
      @agriasoaks6721 Рік тому

      ​@@Zurasuta The problem arises when you want to move items between those containers.

  • @jordanmason4024
    @jordanmason4024 3 роки тому +2

    I would love a tutorial on making items actually *do* something and have properties that can be retrieved and used in various situations.

  • @60b1in
    @60b1in 3 роки тому

    Thanks for the tutorial. I learned a lot about resources from it and will definitely use them a ton from now on! My projects are practically begging for it. :)
    What I would propose would be an extra resource for InventorySlot. That way: 1) You can have different slots accepting only certain types of items (for equipping), which is currently not supported and would be perhaps complicated to implement. 2) You can carry a big chunk of dropping/swapping logic into the resource itself, making the code more readable (and considerably lightweight on the side of UI). 3) With drag and dropping slot reference instead of item directly, the problem with dropping it on wrong place could be effectively avoided, perhaps?

  • @jacksondenis9052
    @jacksondenis9052 3 роки тому +1

    Hope to see some more updates on DemonLocke too. But, loved this tutorial overall

  • @takoyaki_1i
    @takoyaki_1i 3 роки тому

    great video as always. would you consider making a tutorial on how to implement stairs and bridges in a topdown game? thank you!

  • @ValeriusWraith
    @ValeriusWraith 3 роки тому +1

    Got me by surprise. Oh, well, a few extra minutes awake at night won' t hurt

  • @moardub
    @moardub 3 роки тому +1

    Awesome videos as always! Since you're using open source with godot have u thought about uploading to LBRY? I consume most of my content on there these days since youtube is being sketchy with content creators. It wouldnt hurt to have a backup channel on LBRY and I would appreciate it :D. (Also LBRY makes it dead simple to sync your UA-cam and LBRY uploads so it pulls all ur content over for you). Other game creators are uploading there too like GDQuest. Keep up the amazing content!

  • @coolbarryo1852
    @coolbarryo1852 3 роки тому +2

    Stacking items is awesome! but how could I go about UNstacking the items? say right-click and drag to half the stack and ctrl+click to single remove?

  • @totallyjustmagic
    @totallyjustmagic 3 роки тому +4

    Is there going to be a 3 part for unstacking items? And making unstackable items?

  • @francescofaralli8915
    @francescofaralli8915 3 роки тому

    Thanks for the tutorial.
    How do I put the found items in the inventory? Thanks in advance

  • @Adam-gd7ic
    @Adam-gd7ic 3 роки тому

    For anyone it might help, I managed to fix the label from going under other slot textures by wrapping the Label node in a Node2D, then set it's z-index to 1 (or higher if you need), then adjust the itemAmountLabel var path accordingly to match this in the InventorySlotDisplay script and then should work good! Not sure if it's good practice to use a Node2D like this, but apparently it's the only way to set the z-index like this.

  • @Gomace
    @Gomace 3 роки тому

    "Mouse Button, Left Mouse Button" was the frenchest "Button" I've ever heard.
    6:17

  • @carbunky6098
    @carbunky6098 Рік тому +1

    How would you go about creating a database for the items? Would you create another resource type (e.g. ItemDatabase) that contains a list/dict of Item resources? Iterate over all Item resource files and instantiate them in a list/dict at startup? Some other data structure?

  • @lory6330
    @lory6330 3 роки тому +2

    Heyy
    Could you pls make an tutorial about making a game menu for the rpg game?
    I would really apreciate that!

  • @lucas1minuto
    @lucas1minuto 3 роки тому

    Hi, thank you for your videos. Can you teach us how to fix the jitter and stuttering in Godot?

  • @jftremblay1986
    @jftremblay1986 3 роки тому

    Hi i really love your video !! could you make tutorial to reset game ... like when you died you return du main menu and when you press new game it start a brain new game to 0 ??? thnx and again your pretty good !

  • @spooki-2451
    @spooki-2451 3 роки тому

    ooo , i hope that the hack'n slash will have combos (like unique multi input attacks), i never see tutorials implement those.

  • @pixenimated
    @pixenimated 3 роки тому

    Hey, I'd like to do my own Settler II (that kind of thing). Would you recommend Godot for this, or would you prefer unity or something completely different? It's supposed to be pixel style too.

  • @hanzofactory
    @hanzofactory 3 роки тому

    Will you make a quest system tutorial sometime? I am trying to implement one into my RPG game and honestly I'm struggling...

  • @Kaz1kz
    @Kaz1kz 3 роки тому

    Eae cara! Lembrei do seu vídeo falando português, ja aprendeu? Hahaha, seu canal me ajuda muito

  • @EidoEndy
    @EidoEndy 3 роки тому +1

    So the _unhandled_input(event): is a built in function?
    For a second I couldn't get my items to not disappear when dragging outside. Turned out I forgot the underscore _

  • @Leo-kc2kp
    @Leo-kc2kp 2 роки тому

    if anybody want to make the sword and shield non stackable and make their numbers dissepear like i did here u go:
    so in the display_item function, after displaying the texture u can add this line:
    if not item . name in ["Sword", "Shield"]:
    and then display the amount
    u can also use the same line before stacking the numbers
    it's probably pretty easy for anybody coming on this video but it wasn't for me so here u go

  • @pixelmud9505
    @pixelmud9505 3 роки тому +1

    Hey Ben, thank you for making such great videos. Really enjoy your teaching style. Question: when dragging the items in the inventory, is there a way to change how the texture is located relative to the mouse pointer? As it is working now, when I click on an object - say the sword - i click in the middle of the sword. My mouse pointer is in the middle of the sword. But as soon as I start moving the sword it jumps to have the top left (0, 0) position of the texture located at the mouse pointer. If it was a sprite, I could set the transform or locate the center of the sprite at (0,0) - but with the resources, I don't think we can. Maybe add a script to the resource? I don't know - love your tutorials man. Thank you for all your awesome content!

    • @uheartbeast
      @uheartbeast  3 роки тому

      Hey! Great question. So you'll want to set the offset for the drag preview (TextureRect) node we create when getting the drag data.

  • @vaskebjorn_
    @vaskebjorn_ Рік тому

    Hello! I have followed the tutorial successfully and implemented this into my game nicely, but I had one small question.
    If I wanted to add something to the inventory while the game is running, for example the player picking up the item, or so on, how would I do that?
    I've used this and It works well as I can add strings, but I'm not sure how to add the items saved as resources.
    item.append()
    I'm not sure what to put in between the parentheses for the item to actually be added to the array.
    "res://items/tres Items/example"
    adding it like this just makes it into a string.
    Thanks for the awesome tutorial!

  • @Sasakisdr
    @Sasakisdr 2 роки тому +3

    How do I apply this inventory to a game?

  • @S3R43o3
    @S3R43o3 Рік тому

    Hey my dude i know this tutorial is made a time ago but it is possible to get a instruction how to make equipslots ?

  • @mattahrens5338
    @mattahrens5338 3 роки тому

    I added this to your other tutorial I watched, the action adventure one, and now the items are far away from the cursor while dragging. Does anyone have any idea how to fix this?

  • @RedPenguin777
    @RedPenguin777 2 роки тому

    hey, can you also make a tutorial for custom characters as an addon for your Action RPG tutorial please?

  • @raildogameart
    @raildogameart 3 роки тому

    Nice, can you make a craft system using this inventory??

  • @johnbenjaminvistan6013
    @johnbenjaminvistan6013 3 роки тому

    Hello, Heartbeast. Can you suggest where I can learn gdscript for beginners with a very little programming knowledge?

  • @johnzhang4469
    @johnzhang4469 3 роки тому

    Help, please:
    In the "InventoryDisplay.gd", there is line of code in the "func _unhandled_input(event: InputEvent) -> void":
    inventory.set_item(inventory.drag_data.item_index, inventory.drag_data.item)
    my question is: where the "item_index" came from?
    I know the "item_index" is a child of the "drag_data", but there seems no global value called "item_index" in the "Inventory.gd",
    so could someone tell me where the "item_index" came from, please?

  • @crashannburnFPV
    @crashannburnFPV 3 роки тому

    Really good tutorial! Thank you very much!
    I'm planning on getting one of your courses, but I would like to see that as much of the money I pay reaches you rather than the hosting platforms. Where would it be best to get one of your courses in this case?
    Also, will there be a follow up where one can move items from this inventory into a hotbar?

    • @MeowDot
      @MeowDot 3 роки тому +1

      For a hot bar just remake the inventory but resize and rearrange it :)

    • @crashannburnFPV
      @crashannburnFPV 3 роки тому

      @@MeowDot Thank you, and yeah, I was thinking about it. And it seems like it's just that easy. :D
      I have yet to reproduce what's in this tutorial. I guess I'll figure it out. :)

  • @alessandrovarisco9162
    @alessandrovarisco9162 3 роки тому +6

    I love your tutorials, but how do you pick up items and add them in the inventory now? I am new on godot, and this stuff is confusing for me

    • @theravenpirate4744
      @theravenpirate4744 2 роки тому +1

      that's my main question too

    • @Zital1992
      @Zital1992 2 роки тому

      thats easy just like the scrip he show to add to inventory, you need a item node something like potion with sprite and add this to youre inventory and just delete the item than from the screen. so you have just the item in the inventory and not on the screen anymore

  • @leitto5681
    @leitto5681 3 роки тому

    Hello HeartBeast!
    What is the best resolution for pixel game?
    320x180 or 320x240 and sprites 24x24
    --or--
    640x480 and sprites 32x32 and 64x64?

  • @Day13May
    @Day13May 3 роки тому

    Haven't watched it yet, but I love the tutorial already

  • @YinC4
    @YinC4 Рік тому

    Help, I'm making a game for phones, when adding the Left Mouse Button to the Input Map, dropping the item outside the Inventory returns the item to its slot, but when I test it on the phone it doesn't work. I tried to add the touch to the Input Map but I can't find the option, what could I do?

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

    Can you please do guide how to include inventory to the game?

  • @davisisnando3114
    @davisisnando3114 3 роки тому +1

    Sorry for the unrelated comment, I'm trying to add a box to make kind of a puzzle in the "action rpg" and i'm having a hard time. I wanted the box to be moved in one of the four directions only and only stop when colliding. Any tips? :(

    • @coolbarryo1852
      @coolbarryo1852 3 роки тому

      actually this wouldnt be too hard if you made the box and enemy you could "hit" to move around. duplicate the node containing the knockback in the enemy and then change it so that it only moves in either -x, +x, -y, or +y.

  • @plugincraft
    @plugincraft 2 роки тому

    This was one of the best tutorials ive ever seen but I have one question and I'm sorry if it was asked already but how would I add items to the inventory.tres via gdscript? and make it rerender?
    Edit: using set item it was pretty easy.... should've thought of that :D

    • @insidedevelopment5282
      @insidedevelopment5282 Рік тому

      Hey man! I was trying to do the same, would you mind showing my what you did? I've been stuck on it for a while. Thanks! :)

  • @ab-ci6hf
    @ab-ci6hf 3 роки тому

    can you make a a updated dialog system tutorial, i really need it

  • @bbluedev3873
    @bbluedev3873 3 роки тому

    Please How can I make shooting in Godot and attack system????

  • @devynkaylor-owens3577
    @devynkaylor-owens3577 3 роки тому

    How would I go about saving the inventory into a json save file? With how they do it in the Godot Docs?

    • @KrystofKlestil1337
      @KrystofKlestil1337 3 роки тому

      Perhaps saving the inventory resource could work? Or rather jst save all the reosurces to the user folder. Just a thought though, haven't tried.

  • @surajsalian583
    @surajsalian583 3 роки тому

    i want to move in 8 direction can u make a video tutorial for it in godot

  • @oliver5086
    @oliver5086 3 роки тому +1

    can you make a tutorial to use this in a game ?

  • @TheSlimHim
    @TheSlimHim 2 роки тому

    As someone new to Godot and was new to unity's Scriptable objects before switching, I'd like a more experienced opinion on something. Ben duplicated the resources to make the count unique but what I would have done is create an inventory slot class that has two props, the item (before he added amount) and amount. What do you all think?

  • @HeraldOD
    @HeraldOD 3 роки тому

    Is there a way to change the minimum distance to start dragging? I'm making a pretty low res game, and the radius seems to be pixel-based since the items won't start dragging until I've moved the mouse more than a slot away. (I'm using 10x10 pixel slots)

    • @ShawnMcCourtB
      @ShawnMcCourtB 3 роки тому +1

      Did you find an answer to this? I'm having the same issue with 8x8 sprites.

    • @HeraldOD
      @HeraldOD 3 роки тому

      @@ShawnMcCourtB Sadly, nope. I've looked online several places and haven't found anything. :/

  • @spiritblue5139
    @spiritblue5139 3 роки тому

    Hey, I'd like to purchase the gamemaker turn based course you had for offer but it was taken down... Will it come back someday?

    • @uheartbeast
      @uheartbeast  3 роки тому

      Hey! Technically it is still live (I just removed the public link because the course is out dated and uses GMS 1.4) you just need a special link and password. The price is similar to my godot course as well. If you are still interested you can email me: heartbeast.studios@gmail.com.

  • @oliver5086
    @oliver5086 3 роки тому

    how to add and remove things in the game?

  • @XavierEmeralds
    @XavierEmeralds 3 роки тому +1

    How would you go about adding items that the player picks up to the inventory?

    • @devynkaylor-owens3577
      @devynkaylor-owens3577 3 роки тому +8

      This is how I did it.
      func _process(delta):
      if playerDetected:
      if Input.is_action_just_pressed("pickup"):
      # Check if you have an Empty Slot
      var emptySlot = inventory.items.find(null , 1)
      if emptySlot != -1:
      # Set item to the first empty slot
      inventory.set_item(emptySlot, item)

    • @mynameisnotegg5731
      @mynameisnotegg5731 3 роки тому +1

      @@devynkaylor-owens3577 thank you :)

  • @user-em6sg2vv2o
    @user-em6sg2vv2o 7 місяців тому +3

    I'm using Godot 4.2 and it seems that the _unhandled_event func cannot capture the release of left_mouse while dragging(in 7:22). It was regarded as a handled event instead. In case anyone meets with the same issue as mine, here's how I finally get that right:
    func _notification(what: int) -> void:
    if what == NOTIFICATION_DRAG_END:
    if not is_drag_successful():
    if inventory.drag_data is Dictionary:
    inventory.set_item(inventory.drag_data.item_index, inventory.drag_data.item)
    When the user releases the left_mouse while dragging, all nodes get a NOTIFICATION_DRAG_END, and we can check if the drag is successful by the is_drag_successful() function.

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

      God bless you brother. God bless you

    • @MicahT
      @MicahT 3 місяці тому

      Thanks, I was able to get it to work by just making it _event vs. _unhandled (and it still only triggers if drag_data is a Dictionary), but I still didn't like it triggering anytime the mouse was unclicked. Yours feels better.

  • @buterbrodxd7259
    @buterbrodxd7259 3 роки тому

    How to make add item function?

  • @Dragon20C
    @Dragon20C 3 роки тому

    now I gotta figure out how to half amount

  • @rabrant1
    @rabrant1 Рік тому +1

    I tried putting two inventories on the same scene. Like to move items from one inventory to another. However, the inventories are a direct mirror of each other. I tried checking the box "Local to Scene" on, with no luck. But both inventories are in the same scene so it makes sense that it didn't work to do that. Has anyone else used this tutorial as a base-start of making inventories? And have you had any success with moving from one inventory to another?

    • @MicahT
      @MicahT 3 місяці тому

      I would think it's because they're both pulling the same Resource inventory.tres? You'd need a different Resource or else it's going to mirror. There may be a hundred other issues and this was a year ago, so this is more for someone else who sees this comment and might be struggling the same way.

  • @liokillergaming7327
    @liokillergaming7327 3 роки тому

    anyone else have this error?
    "ERROR: Couldn't save project.godot - C:/Users/Usuario/Documents/MEGA/SAi/Project Godot/Project M/project.godot.
    At: core/project_settings.cpp:755""

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

    Help please make my font, I tried but I can't get it

  • @wilsonlepcha3204
    @wilsonlepcha3204 3 роки тому

    Umm i actually watch your videos a lot...and i actually made a game looking at a tutorial so could u make a level based update in your action rpg series.
    It would be great if u can make a video inserting your inventory there also...would be of great help
    Thank you.

  • @lizardguy9485
    @lizardguy9485 3 роки тому

    I have a question kind of unrelated to the video, but: How do you make a node (In this case, a KinematicBody2D) be teleported to a specific set of X and Y coordinates? I need this for checkpoints for my platformer game. I cannot find much info on the topic, and I am not even sure if this is possible in Godot.

    • @veselinborisov369
      @veselinborisov369 3 роки тому +1

      Just change its global position to the desired coordinates. Something like that:
      kinematic_body.global_position = Vector2(x_coordinate, y_coordinate)

  • @surajsalian583
    @surajsalian583 3 роки тому

    Make a Godot hack and slash game tutorial

  • @walterbarnes8524
    @walterbarnes8524 3 роки тому

    Actually, you should be able to set "Local To Scene" to true for the item resources to make them unique without adding any extra code.

    • @uheartbeast
      @uheartbeast  3 роки тому

      I've tried this but had issues with it working on custom resources in this context. Not sure why, honestly. Let me know if you are able to get it to work.

    • @uheartbeast
      @uheartbeast  3 роки тому

      To be fair I haven't tried in 3.2.3 yet, just 3.2.2.

    • @walterbarnes8524
      @walterbarnes8524 3 роки тому +1

      @@uheartbeast Yes, I see what you mean. I tried it in 3.2.3 and even with Local To Scene true they're still not unique. My best guess is the item resources are being added to another resource in the editor and not (pre)loaded in a node during runtime so Godot treats them differently and ignores the local to scene setting. Probably a feature not a bug.
      One thing that occurred to me as I was playing around with this is that it seems odd to track the item count in the item itself. Logically, it would make more sense to track the quantity in the inventory instead. So for example, instead of an array of items you could have an array of arrays with each sub-array containing the item and quantity for that slot. I think something like this would work much better and it shouldn't matter if the resources are unique or not.
      You could even add some extra parameters to control stacking. The items could have a "stackable" boolean that if false will prevent the inventory from stacking those items in a single slot. Each slot could also have a "max_count" integer that controls the maximum quantity for that slot.
      This is getting fun but I have to go to work soon. I'll continue working on this over the weekend.
      Edit:
      Actually, replacing the array with a dictionary would probably be more appropriate. The item itself would be the key and the quantity for the slot would be the value.

    • @jordanlis85
      @jordanlis85 2 роки тому

      @@walterbarnes8524 and @HeartBeast making local to scene is not enough, you have to make the ressource unique too in some way. If not possible in the editor, maybe doing it by code is the best solution.

  • @AsasinoManik
    @AsasinoManik 3 роки тому

    Not verified , why bruhh??

  • @NgaeGameStudio
    @NgaeGameStudio 3 роки тому

    Where's the loading bay? I think the tuto is good. your source data can be loaded up, and for the sake of her memory, there's no reason why they're so slow!

    • @NgaeGameStudio
      @NgaeGameStudio 3 роки тому

      how did i comment here? who the hell did this? and even i couldnt understand what i comment for, is someone hacking me?

  • @surajsalian583
    @surajsalian583 3 роки тому

    how to make 8 direction pixel art character

  • @starlingrad411
    @starlingrad411 3 роки тому

    your videos are like crack

  • @mrfergader4261
    @mrfergader4261 3 роки тому

    hablas español ??

  • @nonenone9002
    @nonenone9002 3 роки тому

    close the github issue someone made since its already fixed

  • @GrumpyIdiot
    @GrumpyIdiot Рік тому

    I really love how simple your code is but unfortunately I'm not going to use it. I'm new I know shit
    I can't make it stack limit and I can't split the stackable items I just wish you have made more videos about it
    I can't even add it to my player, I can't remove or add items in it but it taught me some stuff so thanks for that

  • @uraniummmm1
    @uraniummmm1 3 роки тому

    B) Early af