Yue Posted June 22 Author Share Posted June 22 I have discovered something that may have something to do with the problem, if a zip file is in the root directory of the directory, when I try to launch the map editor it does not open, if I remove the zip file, it loads the editor without problems, maybe this can give a clue. 1 Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted June 22 Share Posted June 22 42 minutes ago, Josh said: You should check to make sure LoadPackage is returning a value. Right now we don't know what command is causing the problem: local p = LoadPackage("Maps.zip") if p == nil then Print("Failed to load package") else p:SetPassword("1500") end I have done this in my project that Yue is running. It doesn't print anything it just crashes. LoadPackage() itself is crashing shortly after it prints "Loading package". Quote Link to comment Share on other sites More sharing options...
Josh Posted June 22 Share Posted June 22 18 minutes ago, Yue said: I have discovered something that may have something to do with the problem, if a zip file is in the root directory of the directory, when I try to launch the map editor it does not open, if I remove the zip file, it loads the editor without problems, maybe this can give a clue. Please upload the zip file that causes this problem. 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...
SpiderPig Posted June 22 Share Posted June 22 This isn't a problem with a specific zip file. It is Yue's PC. 1 Quote Link to comment Share on other sites More sharing options...
Yue Posted June 22 Author Share Posted June 22 I'm going to make a video. One Moment. Quote Link to comment Share on other sites More sharing options...
Yue Posted June 22 Author Share Posted June 22 Dos.zipFile Zipe here. Quote Link to comment Share on other sites More sharing options...
Yue Posted June 22 Author Share Posted June 22 Doble Post, sorry. Quote Link to comment Share on other sites More sharing options...
Josh Posted June 22 Share Posted June 22 I asked before what your user name on Windows is, and you said it is "Yue" but I can see in your video the user folder is called "este equipo" or something like that? 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...
Yue Posted June 22 Author Share Posted June 22 The route is simplified on my computer. But when I put the mouse on the address bar it shows this look. Quote Link to comment Share on other sites More sharing options...
Yue Posted June 22 Author Share Posted June 22 Este equipo is PC. Quote Link to comment Share on other sites More sharing options...
Yue Posted June 22 Author Share Posted June 22 Quote Link to comment Share on other sites More sharing options...
Yue Posted June 22 Author Share Posted June 22 I am encountering a connection where if I try to run the game with either executable, it shuts down unexpectedly. And if I try to launch the map editor, unexpected shutdown, but if I remove the zip, everything works fine. Quote Link to comment Share on other sites More sharing options...
Josh Posted June 22 Share Posted June 22 I uploaded a new build of the editor on Steam that might fix this. I can't tell, since I can't produce any error, but I have a suspicion. 2 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...
Yue Posted June 22 Author Share Posted June 22 I have updated, but it doesn't work. If any zip file is in the project directory, the editor will not start. Quote Link to comment Share on other sites More sharing options...
Josh Posted June 22 Share Posted June 22 I think the problem is in libzip, here. I think it has something to do with your locale and it not converting the path correctly to a wide string: zip_source_file_create(const char *fname, zip_uint64_t start, zip_int64_t length, zip_error_t *error) { int size; wchar_t *wfname; zip_source_t *source; if (fname == NULL || length < ZIP_LENGTH_UNCHECKED) { zip_error_set(error, ZIP_ER_INVAL, 0); return NULL; } /* Convert fname from UTF-8 to Windows-friendly UTF-16. */ size = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, fname, -1, NULL, 0); if (size == 0) { zip_error_set(error, ZIP_ER_INVAL, 0); return NULL; } if ((wfname = (wchar_t *)malloc(sizeof(wchar_t) * size)) == NULL) { zip_error_set(error, ZIP_ER_MEMORY, 0); return NULL; } MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, fname, -1, wfname, size); source = zip_source_win32w_create(wfname, start, length, error); free(wfname); return source; } In zip_source_file_win32_utf8.c 1 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...
Yue Posted June 22 Author Share Posted June 22 I have removed all the files from the project, when I try to launch the editor it doesn't work, only the Zip file is inside the directory. Quote Link to comment Share on other sites More sharing options...
Yue Posted June 22 Author Share Posted June 22 If the zip is empty, the editor starts, but you see the message on the console that the zip has failed to load. If the zip has any files inside it, the editor will not start. Quote Link to comment Share on other sites More sharing options...
Josh Posted June 22 Share Posted June 22 Probably the best thing for me to do is modify this lib so it accepts a wide string for the path. It will take some time. 1 1 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 June 22 Share Posted June 22 That was easier than I thought it would be. Build 1185 is up on Steam now. 1 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...
Yue Posted June 22 Author Share Posted June 22 It is still totally the same, what I was saying to the spider pig, for me this is very confusing. Even if there is a zip inside the game directory, it does not load the map editor. And when trying to load the zip from Lua script, it closes in the zip loading and does not give depuation messages. Quote Link to comment Share on other sites More sharing options...
Josh Posted June 22 Share Posted June 22 27 minutes ago, Yue said: Even if there is a zip inside the game directory, it does not load the map editor. And when trying to load the zip from Lua script, it closes in the zip loading and does not give depuation messages. I did not update the Lua binary yet, just the editor. 1 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...
Yue Posted June 26 Author Share Posted June 26 I confirm that in previous versions of leadwerks it is possible to load a zip file, current version backwards 0.9.1. The zip file does not interfere with the loading of the editor if it is in the root directory of the game. From the Lua script it does load the file without problems and does not close abruptly. 1 Quote Link to comment Share on other sites More sharing options...
Yue Posted July 20 Author Share Posted July 20 Visual studio 2022. C++ 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted July 20 Share Posted July 20 That is interesting. Now we know the problem is definitely in the libzip library, in the zip_source_make_command_bitmap function, which means I can compile it as a DLL that you can run in the debugger to see what is going on... 1 1 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 August 14 Share Posted August 14 @Yue I found I did not dig deep enough to the deepest level of the file read system in the zip library. The updated editor that's on 0.9.7 beta now will actually use the wide string path to load zip files now. I tried renaming a project folder to "здоровье" and the editor was able to load files from a zip in this project. 1 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.