-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for not finding BP mods and lua mods if there are unicode characters in game path #657
base: main
Are you sure you want to change the base?
Fix for not finding BP mods and lua mods if there are unicode characters in game path #657
Conversation
Unrelated to this PR, but it shows a problem elsewhere. steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive # Clone the submodule so we can query xmake on the entire project.
token: ${{ secrets.UEPSEUDO_PAT }} |
I tried something similar in the past and had issues with certain code in lua mods not loading correctly. Did you load all default mods without issue? I'm not a huge fan of changing base lua at all, because that means this code has to be migrated if we go to LuaJIT or any other lua variations. Not sure if there's an alternative. |
Not sure if there's anything in here that may be useful: https://github.com/Tencent/UnLua/tree/master |
Yes, all default mods were loaded correctly. Base lua had to be changed because: 1. it uses GetModuleNameA to get executable path, to correctly build path and cpath environment variables. Since this function returns an ascii string - path with unicode characters will be invalid in this case. 2 - it uses fopen to check and open lua files, which takes ascii string as path parameter, so any file with unicode character in pathname will not be found or open. |
No, it only needs to be migrated if you go to new lua variation which does not support unicode characters in pathnames. Anyway, base lua changes are pretty straightforward, nothing extraordinary there, amount of changes is very low and can be done in a 5-10 minutes at most. |
@Yangff Is this all compatible with Linux? |
The modifications to the Lua source in this PR includes using Windows API functions, so no this is not compatible with Linux in it's current state. |
Hmm.. for Linux compatible. Can use filesystem::path (maybe u8path) to convert the path string from lua.? |
Description
Fixes #495, #335
While it is possible to workaround those issues, by setting ModsFolderPath to directory without unicode characters, this doesn't solve a problem with loading BP mods from Content\Paks\LogicMods folder, which is still inside path with unicode character and does not have relevant settings to bypass this issue.
Also forcing users to make additional configuration makes using mods more diffucult.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Problem occured, while working on mod for "The Lord of the Rings Return to Moria™" game (note that unicode symbol at the end). After applying a fix - all mods load correctly, lua and BP.
Checklist
All changes are small and pretty self-explanatory. They are mostly one-liners and have no additional code.
The only real additions are:
Please delete options that are not relevant. Update the list as the PR progresses.
Screenshots (if appropriate)
Additional context
Add any other context about the pull request here.