EngineOfDarkness / Stalker-Anomaly-Ltx-Loader

A Lua Script based Solution to change Vanilla Stalker Anomaly LTX Files
GNU General Public License v3.0
4 stars 0 forks source link

Won't work if the game is not launched from the Launcher #8

Closed EngineOfDarkness closed 3 years ago

EngineOfDarkness commented 3 years ago

If you launch the game via the EXEs directly (instead of the Launcher), it won't find the file.

The Launcher resides in

And the EXE Files reside in

This causes the relative Paths to mismatch, for example with regards to .\gamedata\scripts\config\FileLoader.lua

and

So in the first case (using the Launcher) the file FileLoader.lua can be found (because that reflects the directory structure) but in the second case the file won't be found because the file is obviously not under ..\bin\\gamedata\scripts\config\FileLoader.lua

This results in the following error messages

! [LUA] ...nomaly-1.5.1.2/bin/..\gamedata\scripts\autoloader.script:15: module 'gamedata\scripts\config\FileLoader' not found:
    no field package.preload['gamedata\scripts\config\FileLoader']
    no file '.\gamedata\scripts\config\FileLoader.lua'
    no file 'N:\Anomaly-1.5.1.2\bin\lua\gamedata\scripts\config\FileLoader.lua'
    no file 'N:\Anomaly-1.5.1.2\bin\lua\gamedata\scripts\config\FileLoader\init.lua'
    no file '.\gamedata\scripts\config\FileLoader.dll'
    no file 'N:\Anomaly-1.5.1.2\bin\gamedata\scripts\config\FileLoader.dll'
    no file 'N:\Anomaly-1.5.1.2\bin\loadall.dll'

Perhaps I can fix this by introducing another path to "package.path". However I'd have to check if the package.path then works for 3rd Party authors aswell - else I either have to put that info in the readme or in the worst case I probably have to move the .lua files back into the script folder and rename them aswell as change some other things.