You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I used the saving system suggested for Dialogic 2, but after I load any save, the images present at the save moment remain stuck until the scene changes. Everything else work fine.
To Reproduce
I save wih this:
func save_global_state(slot_name: String):
if slot_name.strip_edges() == "":
print("Nome del file di salvataggio non valido!")
return
global.caricamento_attivo = true
# Salva i dati globali
var lista_quest_dict = []
for oggetto_quest in lista_quest:
lista_quest_dict.append(quest_to_dict(oggetto_quest))
var global_data = {} ###all datas are here
Save global data using Dialogic's global save method
for key in global_data.keys():
Dialogic.Save.set_global_info(key, global_data[key])
var nome = "user://%s.save" % slot_name
var file = FileAccess.open(nome, FileAccess.WRITE)
var json_string = JSON.stringify(global_data)
file.store_line(json_string)
file.close()
var dialogic_extra_info = {
"slot_name": slot_name,
"timestamp": Time.get_datetime_string_from_system()
}
Dialogic.Save.save(slot_name, false, Dialogic.Save.ThumbnailMode.STORE_ONLY, dialogic_extra_info)
var save_file_path = "user://%d.save" % slot_name
var save_file = FileAccess.open(save_file_path, FileAccess.WRITE)
# Save the slot name
save_file.store_line(slot_name)
#
var save_nodes = get_tree().get_nodes_in_group("Persist")
for node in save_nodes:
if node.scene_file_path.is_empty():
print("Persistent node '%s' is not an instanced scene, skipped" % node.name)
continue
if !node.has_method("save"):
print("Persistent node '%s' is missing a save() function, skipped" % node.name)
continue
var node_data = node.call("save")
node_data["slot_name"] = slot_name # Save the slot name in the data
var node_json_string = JSON.stringify(node_data)
print("Saving node data for '%s': %s" % [node.name, json_string]) # Print node data being saved
save_file.store_line(node_json_string)
save_file.close()
print("Game saved to slot %d!" % slot_name)
global.caricamento_attivo = false
For loading:
func load_global_state(slot_name: String):
if slot_name.strip_edges() == "":
print("Nome del file di caricamento non valido!")
return
# Percorso del file di salvataggio
#var file_path = "user://saves" + slot_name + ".save"
var file_path = "user://" + slot_name + ".save"
if not FileAccess.file_exists(file_path):
print("Save file non trovato per slot %s" % slot_name)
return
# Apri il file per lettura
var file = FileAccess.open(file_path, FileAccess.READ)
var json_string = file.get_line()
var json = JSON.new()
var parse_result = json.parse(json_string)
if parse_result != OK:
print("JSON Parse Error: ", json.get_error_message(), " in ", json_string, " at line ", json.get_error_line())
return
var global_data = json.get_data()
# Carica la lista di quest
global.lista_quest.clear()
for quest_dict in global_data.get("lista_quest", []):
var oggetto_quest = dict_to_quest(quest_dict)
global.lista_quest.append(oggetto_quest)
###many loading files that are repetitive like global.delo_5_days = global_data["delo_5_days"]
# Load global data using Dialogic's global load method
for key in global_data.keys():
if Dialogic.Save.get_global_info(key, global_data[key]):
global_data[key] = Dialogic.Save.get_global_info(key, global_data[key])
else:
print("Global data not found for key: ", key)
if Dialogic.Save.has_slot(slot_name):
Dialogic.Save.load(slot_name)
file.close()
Expected behavior
I expected the game to work normally, but the image remained stuck there.
System (please complete the following information):
OS: Mac
Godot Version: 4.2.1
Dialogic Version: 2.0 Alpha 14
The text was updated successfully, but these errors were encountered:
Hmm.. I'm not sure how to help with this. I'm not even sure what exactly you mean by Images remain Stuck. Backgrounds? Characters? The whole dialog?
Unfortunately we don't really do stuff for older versions. I'd recommend trying alpha 16 or the main branch if possible. If you still need help then, feel free to let us know and provide some more information on what isn't working and what you expect to happen, not just a wall of code.
Ok, I will try. I am sorry, I meant that the character images after the save, when I reload remain stuck over the background, and they do not disappear up until the game change scene. I also think the game keep showing the same characters if they appear again in the same scene with the same background (but it is hard to tell as they perfectly overlap).
The problem
Describe the bug
I used the saving system suggested for Dialogic 2, but after I load any save, the images present at the save moment remain stuck until the scene changes. Everything else work fine.
To Reproduce
I save wih this:
func save_global_state(slot_name: String):
if slot_name.strip_edges() == "":
print("Nome del file di salvataggio non valido!")
return
Save global data using Dialogic's global save method
For loading:
func load_global_state(slot_name: String):
if slot_name.strip_edges() == "":
print("Nome del file di caricamento non valido!")
return
###many loading files that are repetitive like global.delo_5_days = global_data["delo_5_days"]
Expected behavior
I expected the game to work normally, but the image remained stuck there.
System (please complete the following information):
The text was updated successfully, but these errors were encountered: