+1 vote

how to encrypted ResourceSaver save file?

var new_save = save_data.new()
new_save.save_1 = global_object.player_current_data 
ResourceSaver.save("res://save_1.tres", new_save)

this how i do with json

var file = File.new()
var error =file.open_encrypted_with_pass(save_path2,File.WRITE,"123")
if error == OK:
    file.store_line(to_json(new_data))
    file.close()
in Engine by (377 points)

1 Answer

+1 vote
Best answer
var new_save = save_data.new()
new_save.save_1 = global_object.player_current_data 

var file = File.new()
var error =file.open_encrypted_with_pass("res://save_1.tres", File.WRITE, "123")
if error == OK:
    file.store_var(new_save, true)
    file.close()
by (4,168 points)
selected by

use file.get_var(true) to load whole sceneTrees can be saved and loaded this way

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.