Save and Load Settings in Godot 4 with ConfigFile | Let's Godot

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

КОМЕНТАРІ • 59

  • @DashNothing
    @DashNothing  8 місяців тому +8

    Thanks so much for watching! Join the community:
    discord.gg/wtfeeQaQVx
    Hope to see you there!

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

      The only question is why you didn't use resources for that? I'm new in Godot that's why I'm asking, please explain

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

      @@Mika43344 Resources are useful to define a data type that will be used multiple times. We aren't saving multiple configurations, but only one. Using a resource is redundant here.

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

      ​@@DashNothingok, what about if I want to create key binds for keyboard+mouse and xbox controller and ps controller?

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

      @Mika43344 That could be a use case for a custom resource, but ultimately up to you

  • @jjab7996
    @jjab7996 3 дні тому +1

    After looking for hours all over the internet and finding millions of videos that either were too complicated for a beginner, or didn't solve what i wanted, this one is the one I needed to finalize my game, it was literally the only thing left, so thank you very much!

  • @yourstruly2728
    @yourstruly2728 8 місяців тому +7

    I always look forward to your videos dude.

  • @Swinkly_
    @Swinkly_ 4 місяці тому +5

    I can't even say how grateful I am for a tutorial that was this concise and clear for adding remappable controls. I've been working on a high-speed platformer, and almost everyone who's playtested it wished they could configure the controls differently - so I watched two of your tutorials and the entire system is taken care of. Thank you SO much for this!

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

    In case anyone is wondering how to do a drop down options menu, use the item_selected signal in the OptionsButton node, this threw me off, you can save and load the selected integer.
    Edit: Hadn't realised this answer had been buried in the comments section but I think it's worth repeating lol means you can do proper resolution options among other things.

  • @meatyred1611
    @meatyred1611 8 місяців тому +2

    Do gravity, Boids, and object orbiting next I love to see a video like that :)

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

    This saved my life, thank you so muchhh

  • @redswrath4813
    @redswrath4813 6 місяців тому +1

    I hope you can make a video on camera smooth positioning and hit effects ( anyway, keep up the good work ! )

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

      I got a video on a dynamic twin stick shooter camera such as in Enter the Gungeon. I also have videos for a hit flash and hit stop effects. Check them out if it sounds interesting.

  • @meowtube91
    @meowtube91 8 місяців тому

    your tutorials Are very helpful. ^^ can you make a shaking screen when the enemy is damaging you or vice versa ^^

  • @CescosGames
    @CescosGames 9 днів тому

    thank you for the tutorial, this helped me understand CONFIG files. Question for anyone on MacOS - are you able to locate the "user://" file in your system? I can't find it following the Godot documentation path for MacOS

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

    thanks!

  • @N-.-A
    @N-.-A 4 місяці тому +1

    Great tutorial really appreciate it. I was thinking, why make 2 functions(save/load) for each section. Would it not be smarter to implement a SECTION parameter for each the functions instead. That way only 2 functions needed. Then make a const for each section.

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

      @@N-.-A Yes, that does make sense, but since the keybindings saving / loading is so different from the others I decided to just make a seperate function for each.

    • @N-.-A
      @N-.-A 4 місяці тому

      @@DashNothing Got ya. Ty for the reply

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

    Another point, this may just be because of my node/code execution order but I found I would get out of bounds error messages for my dictionary when I tried setting the options, putting a timer in solved this problem so it may have simply been the dictionary not loading up fast enough.

  • @L-D-O-E-S
    @L-D-O-E-S 8 місяців тому

    Nice videoo ❤❤

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

    Could someone help me. I followed the tutorial for both input remapping and this one. I have checked three times for mistakes in my code but I found nothing wrong. Though I still get this weird issue when running the game. All mouse inputs shows up as (Unset) except for when pressing the reset button. I am using Godot Version 4.2.2. But still, thanks for the amazing tutorials.

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

    an thought. When i get into the SETTINGS_PATH part, to save the cfg file or load it... if i write any other things in the path like i meant to create folders, will it create the folders? Or, if instead of user://, i write /storage/0/..., will it get that i want to make the file in the android system and create it?

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

      @@darkproductions65 You should still use user:// as that is the default save path Godot defines, regardless of the OS. Not sure what that is on android, but it is specified in the documentation.
      As for adding directories to the path - yes that should work.

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

      @@DashNothing can you do an tutorial or overview about DirAccess? it is specified in the Godot Documentation and is updated to 4.0, but i don't see anybody talk about it. And as it says it is used mainly to create folders and subfolders, maybe combined with FileAccess it should make a "Writing Dir and Files System"?

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

    14:16 lipo da ima još neki naš u Godotu :)

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

    Any idea what to do if the error „Cannot get keys form nonexistent section section „audio“ appears. A triple checked for Typos. And in the ini file itself I can see the settings. And Audio is typed correctly.

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

      i got it
      Soo in Project_Settings: Autoload:
      My C_FileManager was bellower then the setting_Menu_Autoload. So i trys first to read the Settting.ini before is load and opened in the C_File Manager

  • @stevedexa
    @stevedexa 8 місяців тому +3

    what is your keyboard?

    • @DashNothing
      @DashNothing  8 місяців тому +4

      I use a program called MechaKeys to play sounds as I type in order to simulate the sound of a keyboard to spice up the videos. The preset is Blueberry MX, so I'm sure those keycaps sound similar irl.

    • @stevedexa
      @stevedexa 8 місяців тому +3

      @@DashNothing I didn't even know programs like this existed, thanks

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

    Thank you so much for this tutorial. i had struggle to understand what "video" and "fullscreen" do in the code. it took me couple replays of your video for me to finally get it. yea your code is works but i wanted to understand WHY? why it's works yk? im beginner . its been 2 week i learning coding but i still dont understand what " {} " for ? in this code var music_settings = {} . what's that bracket thing {} means?

    • @DashNothing
      @DashNothing  6 місяців тому +3

      《》 means we created a dictionary (docs.godotengine.org/en/stable/classes/class_dictionary.html). I understand it's difficult, especially with no prior coding knowledge. Many beginners don't really care why something works, they just copy it and don't learn anything. You're doing great trying to understand it.

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

    with the check box, it saves and loads wither or not it was toggled just fine, but if it was toggled and then i switch to a new scene or close and reopen the game, it doesn't read as if it's been pressed, and turns off whatever the check box toggles, even though the check box shows as being on, so i have to click it to get rid of the check mark, and then check it again. Any idea what could be causing this?

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

      on ready you have to emit signal, so when start the game emit this signal

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

    👍

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

    can you do a version with an options button, i have resolution implemented in my game and i just cant figure it out

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

      @@ChillySmalls2910 You should save the index of the selected option. You get it in the OptionButton's selected signal callback

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

      @@DashNothing thanks

  • @Ruder08
    @Ruder08 28 днів тому

    how to save gamepad buttons?

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

    Was this bit in the input settings changed from the input video, or did I miss it?
    for action in input_actions:
    if InputMap.action_has_event(action, event):
    InputMap.action_erase_event(action, event)
    var buttons_with_action = action_list.get_children().filter(func(button):
    return button.find_child("LabelAction").text == input_actions[action]
    )
    for button in buttons_with_action:
    button.find_child("LabelInput").text = ""

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

      No, it wasn't there in the first video. That part was added when a viewer ask how to limit one key per action so that multiple actions can't share the same key. It deletes the input events from the actions in InputMap and clears the text of the corresponding buttons.

    • @DannyArchive
      @DannyArchive 7 місяців тому

      @@DashNothing oh okay it was just I don't think you showed adding it and said that it was the same as the keybindings video, so I got confused, xD maybe add comment of timestamp and code that was added if anyone else has the same issue. Your channel is great, keep it up

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

    Anyone know how to save a config with an android app, as opposed to a PC application?

  • @inkshiftofficial
    @inkshiftofficial 8 місяців тому

    Can you make video on gun recoil, so that every gun sprite don't have to be animated for shoot animation instead we can add recoil using code

  • @Frandibujacosas
    @Frandibujacosas 7 місяців тому

    how can you save the translations of tre language selected? Thank you!

    • @DashNothing
      @DashNothing  7 місяців тому +1

      You wouldn't save the translations in the same file you save your settings, but you can save the id of the OptionButton option you selected. Then you could load a language based on that.

  • @sorsx
    @sorsx 23 дні тому

    hello mr.dash your work is perfect and it saved my settings files but it cant load it in the game , yes its saving it but i dont know if the reason is your code or my version since i use 4.3 and most of the codes changed , can you please help me? i will really wait for your replay.

    • @DashNothing
      @DashNothing  23 дні тому +1

      @@sorsx Thanks. This was made on 4.2 so none of the code needs to change for this to work. It's more than likely that you missed or mistyped a part of the loading code. Your best bet is going through that part again and double check you have everything setup correctly.

    • @sorsx
      @sorsx 22 дні тому

      @DashNothing Thank you so much mister! Could you please... Share the code? It would be so helpful for us! We really need it, Thank you!

  • @connorjade5460
    @connorjade5460 7 місяців тому

    How can I use this with option button (enum one) in godot 4 UI??

    • @DashNothing
      @DashNothing  7 місяців тому

      I answered on your post in discord

    • @connorjade5460
      @connorjade5460 7 місяців тому

      @@DashNothing I've checked by running the code. Though it is saving the id in correctly, but when you restart the game, the game reverts back to the default language settings

  • @Tamim_hariri
    @Tamim_hariri 8 місяців тому

    can you make video about wave system

    • @DashNothing
      @DashNothing  8 місяців тому +1

      Good idea, I'll see what I can do

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

    Do you upload the source code anywhere?

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

      @@coffeecatrailway No, not currently