system
                
              
                
              
                  
                  
              1
              
             
            
              
|  |  |  | 
|  | Attention | Topic was automatically imported from the old Question2Answer platform. | 
|  | Asked By | Folivora | 
 when the godot4.0 update came along alot of the script changed
i have been trying to figure out how to write old code in gdscript2.0
i had no luck with trying to do this one:
“export(String, FILE, “*.json”) var dialog_file”.
             
            
              
              
              
            
           
          
            
              
                system
                
              
              
                  
                  
              2
              
             
            
              
|  |  |  | 
|  | Reply From: | spaceyjase | 
 Fortunately the documentation is up-to-date here: GDScript exports — Godot Engine (stable) documentation in English
Assuming you want a string to file:
@export_file("*.json") var dialog_file
sorry for the inconvenience just stumbled across another one
“func load_dialogue():
var file = File.new()
if file.file_exists(dialogue_file):
file.open(dialogue_file, file.read)
return parse_json(file.get_as_text())”
tried using the new “fileaccess” but i think i did it wrong
Folivora | 2023-03-31 15:15