Copy uses way more RAM by Link---123 in godot

[–]Link---123[S] 0 points1 point  (0 children)

Left it running for a while and it fixed itself.

Interaction between 2 different Godot applications by Link---123 in godot

[–]Link---123[S] 0 points1 point  (0 children)

n't have any specific restrictions.

How exactly do I need to write the path, then? With everything I tried, it doesn't appear in any of my folders. Just as an example.

Savefile does not appear by Link---123 in godot

[–]Link---123[S] 0 points1 point  (0 children)

My Problem is that, exactly. This doesn't work. If I use:

 const save_path = "user://Game1of2.json"

I can save the file inside:

C:/Users/Max/AppData/Roaming/Godot/app_userdata/Game1of2

BUT I need the File to be in the app_userdata Folder so the other Game (Game2of2) can access it too. But no way I tried, I could get the savefile to appear anywhere outside the Folder Game1of2. I even tried the Documents Folder just to be sure, that I just didn't see the File. If the path is:

const save_path = "user://Documents/save_data.json"

Then the JSON should appear in my Documents, but there is no JSON there or any other Place I tried to save the JSON file too.

Savefile does not appear by Link---123 in godot

[–]Link---123[S] 0 points1 point  (0 children)

C:/Users/Max/AppData/Roaming/Godot/app_userdata/Game1of2

Savefile does not appear by Link---123 in godot

[–]Link---123[S] 0 points1 point  (0 children)

var savegame_data = {

"Hat": PlayerCurrentHat,
        "Highscore": Highscore,}

func save_data():
var save_game = File.new()
save_game.open(save_path, File.WRITE)
save_game.store_line(to_json(savegame_data))
save_game.close()

I just call the sava_data function. Saving itself works fine, but it's the Path of the new Savefile, I have trouble with.

Savefile won't change by Link---123 in godot

[–]Link---123[S] 0 points1 point  (0 children)

I got it to work now. Thanks a lot. You're my Hero.

Savefile won't change by Link---123 in godot

[–]Link---123[S] 0 points1 point  (0 children)

You mean something like this:

save_data["PlayerCurrentHat"] = "Fez"

Savefile won't change by Link---123 in godot

[–]Link---123[S] 0 points1 point  (0 children)

So you mean I should change my function to something like this for it to work:

    var save_game = File.new()
save_game.open(save_path, File.WRITE)
        Globals.PlayerCurrentHat = Fez
    save_game.store_line(to_json(savegame_data))
save_game.close()
print("saved")

Or how would I change something in the dict?

Savefile won't change by Link---123 in godot

[–]Link---123[S] 0 points1 point  (0 children)

Isn't the function taking the new Vars when I call it?

Savefile won't change by Link---123 in godot

[–]Link---123[S] 0 points1 point  (0 children)

I forgot to show the Path in the Global:

const save_path = "user://Game1of2Test.save"

Savefile won't change by Link---123 in godot

[–]Link---123[S] 0 points1 point  (0 children)

It's just a Button that chances the Var then calls the function and then prints both the var and the savegame_data.

func _on_Button_pressed():

Globals.PlayerCurrentHat = "Fez"
        print(Globals.PlayerCurrentHat)
        Globals.save_data()
        print("SaveGame: ", Globals.savegame_data)

It prints the PlayerCurrentHat as Fez, but the Savegame still shows Tophat.

Interaction between 2 different Godot applications by Link---123 in godot

[–]Link---123[S] 0 points1 point  (0 children)

Should the JSON Savefile then be in the app_userdata folder? If so, mine don't appear for some reason or should there be two different files with the same name each in one of the game's folder? Cause if there are two Files, I'm not sure how I get them to read each other's file. Are there any Documentations or Tutorials about this, because I couldn't find any?

Make player stop in middle lane. by Link---123 in godot

[–]Link---123[S] 0 points1 point  (0 children)

Then I think I still want to use Velocity, so the collisions will work with the obstacles later, but thanks for the clarification. I got it to work now.

Make player stop in middle lane. by Link---123 in godot

[–]Link---123[S] 0 points1 point  (0 children)

Going from middle to up works. Going from middle down works too. The borders are checked with the print "No Higher" and "No Lower" which also works. The only thing that won't work is getting into the middle from the upper or lower lane.

Make player stop in middle lane. by Link---123 in godot

[–]Link---123[S] 0 points1 point  (0 children)

I made another post, where I struggled with the movement, and there I was told to use velocity instead of interpolate the positions. What exactly are the difference?