How To Design A SAVE SYSTEM In Godot 4

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

КОМЕНТАРІ • 32

  • @randompirate774
    @randompirate774  Рік тому +7

    Correction: I coded the wipe function at the end incorrectly. Instead of what I did, what you want to do is set all of your NORMAL variables (so not those in your dictionary) to your "default" values, and THEN call the save function.

    • @Assem_DEV
      @Assem_DEV 10 місяців тому

      The method did not work Godot 4.2

  • @iamgamestar
    @iamgamestar 9 місяців тому +1

    love you brother i've been searching for this since 2 days almost tried 30-40 methods but you are the savior 😘😘❤❤❤❤❤❤❤❤❤

  • @awsmeanthony
    @awsmeanthony 11 місяців тому +3

    Thank you 4th tutorial that I watched first one that worked.

  • @Bloom_HD
    @Bloom_HD Рік тому +4

    Helpful and easy to follow. Ty!

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

    Thanks, my friend

  • @RexieRacer
    @RexieRacer 6 місяців тому

    THANK YOU SO MUCH!!!! you saved my game! (get it cause its a tutorial on designing a save system? [only good joke i can think of])

  • @hogan4621
    @hogan4621 Рік тому +2

    thanks i really tried to make a save system in godot 4 but failed until i found this video

  • @F_Du_Sea
    @F_Du_Sea 7 місяців тому +3

    3:35, so what if you want multiple save files?

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

      you can create a dictionary with multiple paths and leave them already established. as:
      var save_path = {
      "slot_01": "user://save_slot_01.dat",
      "slot_02": "user://save_slot_02.dat",
      "slot_03": "user://save_slot_03.dat",
      "slot_04": "user://save_slot_04.dat",
      "autosave_01" : "user://autosave_slot_01.dat",
      "autosave_02" : "user://autosave_slot_02.dat",
      "autosave_03" : "user://autosave_slot_03.dat",
      "autosave_04" : "user://autosave_slot_04.dat",
      }
      So, you make the save and load function need to receive a string argument
      func save(selected_slot):
      and when writing or reading the file, you will use this variable with the path
      var file = FileAccess.open(save_path[selected_slot], FileAccess.WRITE)
      so, in every script you want to call the function, you will call it with the slot you want to save, for exemple
      Global.save(slot_01)
      hope it helps

  • @magmaking5673
    @magmaking5673 9 місяців тому +1

    My wipe function is not working
    The game saves and when i load the game it continues from where i saved it but when i click on new game button where i called the wipe function and then get_tree change scene to ..... It takes me to the earlier saved position but when i restart the game again and this time before clicking on continue button in which i called load func if i click the new game button the player position resets to the position i assigned in the wipe function
    Please help brother 🥺❤️

    • @randompirate774
      @randompirate774  9 місяців тому +1

      yes i coded the wipe function incorrectly. you need to reset the variables, then save, then load and it should be correct

    • @magmaking5673
      @magmaking5673 9 місяців тому

      @@randompirate774 if you don't mind can you please elaborate
      I didn't actually understand what to do as this is my first game project everything is done only the continue(load) and new game(wipe) is left the loading is working but please explain me what changes I have to do in the wipe function i really need your help because I got many videos but yours worked for me now only wipe is left to work and the game is good to go for launch
      Please help

    • @randompirate774
      @randompirate774  9 місяців тому +1

      @@magmaking5673 when the new game button is pressed, first you need to assign the "default" values to all the variables that are saved (these are the values that you want the player to have at the start of the game. then you want to call the save function, after which you'd want to call the load function, so the game can begin with the correct values assigned to the correct valuables.

    • @magmaking5673
      @magmaking5673 9 місяців тому

      @@randompirate774
      Func on new pressed():
      Global. Xpos = 250
      Global. Ypos = 100
      Global. Save_data()
      Global. Load_data()
      get tree change scene.......
      Is it correct?

    • @magmaking5673
      @magmaking5673 9 місяців тому +1

      @@randompirate774 thankyou very much brother it's working now 🥺🥺🥺
      I don't know how good I am feeling now ❤️❤️❤️

  • @No-Naame
    @No-Naame Рік тому +3

    Can you create a video for how to save in game with main menu and more than one scene♥💖

    • @randompirate774
      @randompirate774  Рік тому +2

      Sure! I have a different tutotoal planned next but I'll get on it as soon as I can!

  • @jikkermanccini
    @jikkermanccini 9 місяців тому

    It seems that the function "get_var" is not in the Godot 4.2 dictionary, so the code does not work with my project.

    • @randompirate774
      @randompirate774  9 місяців тому

      looking at the documentation, get_var should still be in godot 4.2. What exavtly is your error message?

    • @jikkermanccini
      @jikkermanccini 9 місяців тому

      @@randompirate774 I've since deleted the code that brought up the error, so I don't recall it exactly. So sorry. It was along the lines of "get_var function not within defined dictionary".

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

    this doesn't work

  • @kardrasa
    @kardrasa Рік тому +5

    but how do I get a girlfriend? Aaaaaaa

  • @Assem_DEV
    @Assem_DEV 10 місяців тому

    The method did not work Godot 4.2

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

    Got annoyed in 3 minutes watching this because of the "uuuh"s.

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

      yeah, sorry. I'm trying to work on that.

    • @TechBoi1115
      @TechBoi1115 10 місяців тому

      How does it affect you?

    • @novac1
      @novac1 9 місяців тому +1

      same

  • @novac1
    @novac1 9 місяців тому

    very bad tutorial, too much "aaaaaaahhhhh" and you didn't explain properly at all.