Godot 3 Inventory Tutorial | Some Fix, Save/Load & Player Stats | Part 9

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 พ.ย. 2024

ความคิดเห็น • 10

  • @lunalienray
    @lunalienray 2 ปีที่แล้ว +2

    I found a bug with this save system. It is that you used .tres as default value instead of creating it via code which make godot sometimes mistakenly read from that file instead when load the game.
    I remade my save system to use resource directly and generate default tres file via code and it is working correctly now.
    This tutorial is still very useful to me on how I structure my overall save system.

  • @lunalienray
    @lunalienray 2 ปีที่แล้ว +1

    I have a problem that I can load inventory in current session of the game but when I quit and re-open it. Inventories are gone and become an empty dictionary {}. Not sure why.
    edit : it is just dumb me missing a line of code.

  • @neeshchiiking
    @neeshchiiking 2 ปีที่แล้ว +1

    If Input. Is action just pressed(“attack):
    If ItemManager.get_item(“axe”):
    state = AXE_ATTACK
    I know this is wrong but I can’t figure out how to Reference my axe item from the equipment slot. I tried from the GameEnum to the EquipmentSlot. I just need help. My code is longer and I have a state machine but if you can can give me a line to access the equipment slot I have the rest figured out.

    • @calame3218
      @calame3218  2 ปีที่แล้ว +1

      If you want to have different attack depending on the type of weapon, you could add a type to the item (weapon_class? or a component?). To access it, you can export a player_data variable, like for the player, then access the equipment inventory from there. If you have more questions about it, feel free to join the discord :P

  • @antimari22
    @antimari22 2 ปีที่แล้ว +1

    Thanks for tutorial
    Recently I watched some other tutorial about saving data with ResourceSaver class.
    and all i learn about that tutorial is Godot ResourceSaver is too buggy when they handle sub-resources .
    that's why i plan save manually serialize data in dictionary use singleton.
    Using Resource but not use ResourceSaver is looks like cool, working well, not buggy.
    but what's the point use resource? your data also ends up tied into dictionary and put in save file.
    why not just use dictionary directly?

    • @calame3218
      @calame3218  2 ปีที่แล้ว +1

      Very good question! In my game, Balls Invaders, I simply use a dictionary and emit a signal like "player_loaded( player_data )" etc, but with the resources, you can create a "rich_player_data.tres" resource file, set the inventory data in it and give that to the inventory_player.tscn, so you can test some scenarios quickly like buying everything in a store.
      You could have "mid_game_player_data.tres" (and end_game) and fill the inventory with items to test and balance your levels. Setting the data directly in the inspector is not really fast but once its done you can use it easily.

    • @antimari22
      @antimari22 2 ปีที่แล้ว

      ​@@calame3218 Wow Thanks! I totally understood.

  • @DR_GODOT_DEV
    @DR_GODOT_DEV 2 ปีที่แล้ว

    Great tutorial. learned alot with it. I am trying to save one chest to use it as a container for the player base or someting, but having a hard time on sucess.Can you explaine how? thanks alot for all

    • @calame3218
      @calame3218  2 ปีที่แล้ว +1

      I guess I would do something like I did for the player. A resource player_base, that you could save with other info about the base. I could add that to the future tutorial ideas :P

  • @rekiemr4501
    @rekiemr4501 2 ปีที่แล้ว

    bro make game like growtopia plssss