Monogame: Save And Load System

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

КОМЕНТАРІ • 12

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

    hell yeah this was helpful. I put the Load call in a try block and the Save call in a catch block in case there is no file present (but idk what i'm doing really so comments would be appreciated lol)

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

      The LoadContent function gets called once when instantiated, it won't handle loop logic, I'm not too sure what you're trying to do, I could help more if you send the source code of your file.

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

      @@dorllenius It's not in a loop, it's just a conditional in case there's no json file present. I'm using this for game settings, not save data, so someone might want to do something like delete the file to return to default.
      try {
      GameSettings = LoadSettings();
      } catch {
      SaveSettings(GameSettings);
      }

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

      @@ar_xiv I see, have you tried using break points to see if the condition Is running?

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

      @@dorllenius it works just from testing. But I guess it’s not really necessary because it will save when it needs to regardless……

  • @fontty5218
    @fontty5218 2 роки тому +2

    Great Video
    Thank you!

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

    Hey my solution explorer is compleatly empty what do i do'

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

    in 5:02, when I run the program, I get an error message that my access is denied. I tried everything and I think that the problem is that my directory is read-only, did you by some chance had this problem or do you know how to fix it? If not, you can just delete this comment

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

    Thank You!

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

    this would be so much easier if i knew json...
    could you introduce me to him?

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

    Tried Rider yet? It’s pretty nice to use compared to vs

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

      I try to stay away from IDE's whenever I can so I use vscode and compile from source, only reason I'm using VS is becasue of the Monogame support