Narrnika Posted September 10, 2020 Share Posted September 10, 2020 When using functions getFileReader, getFileWriter, getModFileReader, getModFileWriter in lua, national (no-ascii) characters are lost (more precisely, they turn into question marks when writing and into an unprintable character when reading). In the original game (without mods) this is manifested when saving/loading character settings or sandbox settings: Try to read a corrected file: It is not very critical in this particular place, but sometimes creates problems in mods (both when writing and when using). In this regard, the suggestion: if the files are badly read from lua, then read them in java, and transfer a table of strings to lua. And vice versa - transfer to functions a table with strings, which will be written to the file in Java. That is, add something like this: // in addition to getFileReader() @LuaMethod(name = "ReadFileToTable", global = true) public static KahluaTable ReadFileToTable(String param1String, boolean param1Boolean) { ... } // in addition to getModFileReader() @LuaMethod(name = "ReadModFileToTable", global = true) public static KahluaTable ReadModFileToTable(String param1String1, String param1String2, boolean param1Boolean) { ... } // in addition to getFileWriter() @LuaMethod(name = "WriteTableToFile", global = true) public static void WriteTableToFile(KahluaTable param1KahluaTable, String param1String, boolean param1Boolean1, boolean param1Boolean2) { ... } // in addition to getModFileWriter() @LuaMethod(name = "WriteTableToModFile", global = true) public static void WriteTableToModFile(KahluaTable param1KahluaTable, String param1String1, String param1String2, boolean param1Boolean1, boolean param1Boolean2) { ... } Faalagorn, Atsumori and Maris 1 1 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now