I recall that someone else posted a similar question once, but I can't seem to find it. I want to read and write data to a file so that it can be loaded the next time the person plays, but I believe I read somewhere that those functions are disabled. I tried this:
Code: Select all
file = io.open("test.txt", "w")
file:write("Hello World")
file:flush()
file:close()
and it gives me this error:
Code: Select all
Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call field `open' (a nil value)
stack traceback:
(none): in function `ScriptPostLoad'
Does anyone know of a way I can read and write simple values to a text file from lua? I know that it's possible in GC but I don't really want to go there.