Search the Community
Showing results for tags 'filesystem'.
-
Hi Leadwerks fellows, I run into some trouble creating an save system. I noticed that when I saved I couldnt immediatly reload my save, to load it I had to restart the "game". I will make it simple. To exclude other errors, I wrote this short line of code: if window:KeyHit(Key.F1) then self.test = FileSystem:WriteFile("test.lua") self.test:WriteLine("Test") System:Print("executing") end And again I noticed that while I am executing the programm and hit F1 (put a print function there to double check) and alt+tab the game and check the file, its empty. I use notepad++ to watch the file, and if I hit F1 it detectes a change and after reloading the file still nothing. Even if I close the application now, still empty. I need to close the whole file and open it again then I can see the text, but its not only a matter of visibility, I also tried to read the written text after saving it in the same session, doesnt work. So I guess the stream:WriteLine() operation gets executed on exit? Is there any way of how to work around this or am I missing something. Maybe its possible to refresh the scene/word/app etc? I dont know, but I remember loading and saving in the same session was possible once... However I would be very glad if someone would help me out P.S.: Lua sandbox is DISABLED!
- 2 replies
-
- Stream
- FileSystem
-
(and 2 more)
Tagged with: