LuaBackend icon indicating copy to clipboard operation
LuaBackend copied to clipboard

Portable

Open shinra358 opened this issue 1 year ago • 8 comments

Requesting to allow the ability to load scripts from inside the game folder instead of my documents

shinra358 avatar Jun 26 '24 00:06 shinra358

Should be possible by specifying the path of your script folder. Just put the folder inside the game directory and define the path in your LuaBackend.toml with "relative = false". Should work like this. You can find an example in the last part of the install documentation.

HydroSulphide avatar Jun 26 '24 01:06 HydroSulphide

im confused at the game_docs part. what do i change that to since it seems like that's the name of the save folder in my documents?

shinra358 avatar Jun 26 '24 14:06 shinra358

I'm not sure but I think game_docs is only used as a base for a relative path to your scripts folder. By setting relative = false you can put an absolute path to your scripts folder ignoring the game_docs. Maybe it's important for something else, but I just point it to the save file path, but use an absolute address for my script files folder. I think this should be portable by putting your scripts folder inside the directory, where your game files are. I did not notice that anything lua related where actually saved or used inside the game_docs folder, but maybe someone else knows about special cases, where some mods or luabackend itself needs something from there.

HydroSulphide avatar Jun 26 '24 14:06 HydroSulphide

so if i omit game_docs altogether, what happens?

shinra358 avatar Jun 26 '24 14:06 shinra358

I didn't test it, but you could just do it. Delete the lines in the LuaBackend.toml and see if you can still launch the game, open the console by pressing F2 and your mods are still working. The best test would be to check the portability by trying if everything works on another system. If this is what you want to achieve with the portability. Maybe you could describe your actual goal, because in my opinion it is portable enough, because I would just install the game on another system and copy my LuaBackend files and scripts folder.

HydroSulphide avatar Jun 27 '24 15:06 HydroSulphide

I would agree to having the question of what "more portable" means here, you can already put the script files where ever you want them you just have to configure the .toml file correctly (ie what has been described here with setting an absolute path).

cahudson94 avatar Aug 10 '24 07:08 cahudson94

I would agree to having the question of what "more portable" means here, you can already put the script files where ever you want them you just have to configure the .toml file correctly (ie what has been described here with setting an absolute path).

HydroSulphide has already answered the question bro. And all the details of the confusion of how it works are already described.

shinra358 avatar Aug 10 '24 09:08 shinra358

I guess it is fair that the details are a bit sparse, on this front. The game_docs variable is used for relative path discovery as a prefix to scripts - path variable. If relative is set to false this ignores using the game_docs variable for checking the path variable.

cahudson94 avatar Aug 10 '24 21:08 cahudson94

Yup this is already possible. If relative is true then it will indeed load from path within the path to your Documents folder + game_docs. The below config (taken from the default config) will load from %userprofile%/Documents/KINGDOM HEARTS HD 1.5+2.5 ReMIX/scripts/kh2.

[kh2]
scripts = [{ path = "scripts/kh2/", relative = true }]
exe = "KINGDOM HEARTS II FINAL MIX.exe"
game_docs = "KINGDOM HEARTS HD 1.5+2.5 ReMIX"
# For Steam Version replace with below line
# game_docs = "My Games/KINGDOM HEARTS HD 1.5+2.5 ReMIX"

Since you want to load from the game folder you may just want to add a path to scripts pointing to your game directory with relative = false. Feel free to re-open if this isn't satisfactory.

Sirius902 avatar Jan 17 '25 22:01 Sirius902