shinyquagsire23 / OpenJKDF2

A cross-platform reimplementation of JKDF2 in C
Other
521 stars 46 forks source link

Question/Request: Any way to load MOTS from a subfolder in exe root? #269

Open StrikerMan780 opened 1 year ago

StrikerMan780 commented 1 year ago

Is there a way I can portably load MOTS from a single install of OpenJKDF2, by perhaps loading it from a subfolder? If not, could that feature be added, so I'm not forced to put it in appdata/openjkdf2/openjkmots or wherever it is?

shinyquagsire23 commented 1 year ago

sorry for the late reply but yes, sent this blurb to someone else but I've really got to document it better:

the basic gist is,

StrikerMan780 commented 1 year ago

Doesn't seem to work. It complains the resources are missing, even though they are installed. Can't find the UI stuff or anything, even though it seems to be searching in the right path. (It asks to install to the folder I set, and if I say yes, it'll install the right files, in the same way I had them, but it still doesn't go.)

I made a simple batch file that does the following:

set OPENJKMOTS_ROOT=%~dp0.\mysteries
openjkdf2-64.exe -motsCompat

Folder contents: image

shinyquagsire23 commented 1 year ago

what does the console log say? it ~should say which working paths it's using. Also what UI files is it failing on?

StrikerMan780 commented 1 year ago

image

Recreating SDL2 Window!

Running from current working directory.
(00007ff7ee2825e0 .\General\stdBitmap.c:147) Error: Invalid load filename 'ui\bm\statusLeft16.bm'.
FATAL ERROR: ERR_CANNOT_LOAD_FILE ui\bm\statusLeft16.bm
shinyquagsire23 commented 1 year ago

hmmmm, not a good sign that it says Running from current working directory, make sure you're not launching it from a folder where resource/jk_.cd exists because if that file exists it'll override everything else.

But also I'm not suuuure if the way you're setting the environment variable would work? I've only tested it as a user-global environment variable. Because the other possibility is that it doesn't seem OPENJKMOTS_ROOT as set, but even then it should fall back to the APPDATA folders instead of current working directory?

edit: not Episode/jk_.cd, resource/jk_.cd

StrikerMan780 commented 1 year ago

It definitely sees it as set, because it asks to install to the folder I set, and does.

set OPENJKMOTS_ROOT=%~dp0.\mysteries resolves to D:\JediKnight\OpenJKDF2\mysteries

shinyquagsire23 commented 1 year ago

Hmmm ok so, the only way it will fail to use OPENJKMOTS_ROOT if it worked for installation (which is a good sign), is if resource/jk_.cd does not exist, or if resource/jk_.cd exists in the current working directory (ie, where the batch script is located, I think). Because otherwise if it were using OPENJKMOTS_ROOT, it would print Using OPENJKDF2_ROOT, root directory: [your_path/whatever]

shinyquagsire23 commented 1 year ago

an alternative hack would be something like

set OPENJKMOTS_ROOT=%~dp0.\mysteries
pushd %OPENJKMOTS_ROOT%
..\openjkdf2-64.exe -motsCompat
popd

but also, probably good to verify that it's not seeing something in the current working directory (also I should probably double check that it doesn't just set the current working directory to wherever the EXE file is, because it might be doing that?)

chrism69 commented 8 months ago

I'm currently having the same problem. If I put all the MOTS files in /expansions/mots, the ingame menu picks up that folder but also has an entry to install MOTS (trying to run the mots folder just seems to relaunch the normal game). If I click to install it, the root dir is looking to AppData and not the Desktop folder I'm running it from.

If I make a .bat file like above, it looks in the correct root folder and installs the files, but then gives the same file loading error. If I remove -motsCompat from the .bat file, I can launch MOTS from the ingame menu, but then I still have the mots folder listed which again just relaunches the normal game.