Skip to content

Bootstrap file for supporting loading mods from diferent libraries locations - #8086

Draft
Shivansps wants to merge 1 commit into
scp-fs2open:masterfrom
Shivansps:mod-bootstrap
Draft

Shivansps wants to merge 1 commit into
scp-fs2open:masterfrom
Shivansps:mod-bootstrap

Conversation

@Shivansps

Copy link
Copy Markdown
Contributor

This is still a WIP.

Not in yet:
-loading if the bootstrap file from its expected location. Right now only passing -bootstrap "{path}" works
-support in fred and qtfred
-knossos work

Good to have as a follow up, but not included here:
-removing the 256 character lenght limit on cfile paths

This is a work that in conjunction with KnossosNET aims to support loading mods from more than one mod library, potentially located on diferent disks.

The design objectives for FSO are:

-Looks for bootstrap.json in the same PATH as the one used to look for fso_open.ini
-cmdline param to pass bootstrap.json absolute path
-cmdline param to disable loading of bootstrap.json
-when bootstrap.json is present, the -mod cmdline is ignored
-roots folders loading order (what -mod does really) comes from the bootstrap.json "roots" path order in they string array, FIFO.
-roots paths can be absolute paths or relative to the workfolder. Depending of were the mod in question is located.
-workfolder could be optionally be set on the bootstrap.json, if it is set in the json, use it over whatever the process is set to normally.

bootstrap.json example

{
"version": 1,
"mod_id": "blueplanetcomplete",
"workfolder": "H:/testlib",
"roots": [
"D:/testlib/blueplanetcomplete-3.3.3",
"G:/testlib/MVPS-4.6.8MVPS-4.6.8",
"D:/testlib/MjnMHs-1.7.3",
"NTF_Ship_Textures-2.1.2"
]
}

"version" is just an indicator in case future versions need a diferent way to parse it.

"mod_id" contains the main mod ID, used for the settings file by FSO

"workfolder" is optional, it can be set to null or leave empty, But if it set, it will override the workfolder set by OS when starting the process.

"roots" acts like the "-mod" cmdline.

In that test setup i had 3 test libraries one on D, G and H.

-"D:/testlib" had blueplanetcomplete-3.3.3 and MjnMHs-1.7.3 folders, they are being pass as absolute paths
-"G:/testlib" had MVPS-4.6.8 folder, passed as absolute path
-"H:/testlib" had the FS2 retail files and the "NTF_Ship_Textures-2.1.2" folder, being passed as a relative path to the workfolder.

When the bootstrap is loaded the -mod cmdline is ignored if set.

Details on the design of the system was created in the KnossosNET repo.
KnossosNET/Knossos.NET#480

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant