Hello! I am having problems with the input/output files again.
local file1 = io.open(path, "w+") --> open text.txt in documents directory to write
for i=1,#scene_obj do
file1:close() --> close the file
And then I run this function :
And I get the following error:
mainFunctions.lua:303: attempt to index local 'file1' (a nil value)
mainFunctions.lua:303: in function 'save_file'
mainFunctions.lua:45: in function
If I change the path to : "|D|output.txt" or "|T|output.txt" it works, but I want to save in the current folder where the game is.
"output.txt" doesn't work either.
What am I doing wrong?
I tried creating a file with the same name in the folder, but it seems that the file does not have to exist in order to be written.