Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a proper Steam Workshop mounting system to the game. Currently, Steam Workshop addons are mounted directly by searching for a relative file path to the main workshop directory in
gameinfo.txt
. This method contains several weaknesses, including the inability to include VPKs, the inability to dedicate addons to specific episodes (a hypothetical problem), and the fact the game continues to search paths even when addons are no longer subscribed to, causing the game to slow down.This new system solves all of those problems. It uses the Steam API to get the directory for each subscribed workshop addon, and then manually mounts them. If there are any VPKs in the directory, then it will mount the VPKs instead.
The system will also search for an
addoninfo.txt
file at the root of each addon directory. This file is currently only used to allow addon authors to specify which game/mod/episode the addon is for.For example:
When a
game
keyvalue is specified, the mounting system compares its value to the name of the mod's folder. For example, if an addon is specified to be foraxonpariah
, but the currently loaded mod isentropyzero2
(the main game), then the addon will not load.This parameter supports multiple mod names separated with the
+
character (e.g.axonpariah+progenitors
) and negation operators (e.g.!axonpariah
). This parameter also supports the following two "special" commands:#episodes
- Equivalent toaxonpariah+progenitors
. Would automatically cover all potential future episodes.#all
- Allows any game. Can be used in conjunction with+
to negate specific games (e.g.#all+!progenitors
for all exceptprogenitors
).Addons which do not have this file or its
game
parameter will be mounted in any game.Weaknesses of this system
gameinfo.txt
, the SDK tools cannot mount addons in the same way. Addons can still be mounted through thecustom
folder or through localgameinfo.txt
changes if a developer prefers.Things I still plan on doing
GetItemInstallInfo
params.Potentially add a new field to the Workshop Publish GUI which allows you to specify which game you're making the addon for.Considering this out of scope for now.