Ghost Posted February 22, 2023 Share Posted February 22, 2023 local file1 = io.open(self.text_en, "r") for line in file1:lines() do table.insert (self.monolog_en, line); end file1:close() During the test, everything works as it should, but after compilation, the map simply does not open and the game closes without any errors. Why is this happening, does anyone know? Quote Link to comment Share on other sites More sharing options...
Josh Posted February 22, 2023 Share Posted February 22, 2023 You must disable Lua sandboxing, from C++, in order to use the Lua IO commands. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Ghost Posted February 22, 2023 Author Share Posted February 22, 2023 1 minute ago, Josh said: Вы должны отключить Lua sandboxing из C ++, чтобы использовать команды ввода-вывода Lua. It's disabled Quote Link to comment Share on other sites More sharing options...
Ghost Posted February 22, 2023 Author Share Posted February 22, 2023 4 minutes ago, Josh said: You must disable Lua sandboxing, from C++, in order to use the Lua IO commands. Maybe there is some kind of analog, how to do the same thing, but without Lua IO? Quote Link to comment Share on other sites More sharing options...
Josh Posted February 22, 2023 Share Posted February 22, 2023 No, the Lua sandboxing makes it so Lua cannot read or write files. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted February 22, 2023 Share Posted February 22, 2023 You can disable sandboxing by creating a shortcut to the game executable with "+sandbox 0" added to the command line. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Ghost Posted February 22, 2023 Author Share Posted February 22, 2023 11 minutes ago, Josh said: No, the Lua sandboxing makes it so Lua cannot read or write files. Hmm, it's strange, but then why does the script of notes in the style of Amnesia work without problems? Quote Link to comment Share on other sites More sharing options...
Josh Posted February 22, 2023 Share Posted February 22, 2023 Actually, it can read files, it just can't write files. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted February 22, 2023 Share Posted February 22, 2023 There's also the issue that if the files you are loading are packaged in an encrypted zip file, the engine won't be able to read the files. File reading is not supported because it would break the protection. You would need to keep those files in the game's folder, not in a zip file. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Ghost Posted February 22, 2023 Author Share Posted February 22, 2023 22 minutes ago, Josh said: There's also the issue that if the files you are loading are packaged in an encrypted zip file, the engine won't be able to read the files. File reading is not supported because it would break the protection. You would need to keep those files in the game's folder, not in a zip file. What should I do if I just want to read the files and not change them? Quote Link to comment Share on other sites More sharing options...
Josh Posted February 22, 2023 Share Posted February 22, 2023 Place a copy of those files in the game's folder, or whatever subfolder they are supposed to be in. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.