-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mod Compatibility: Only load files within "mod_interactions" if requi…
…site mod is loaded (#76632) * Add feature programatically * adjust existing folders to meet new styling * move interaction files to load after main mod loading * Force mod_interaction files to load after normal mod files * Refactor code to remove disgusting tuple logic * Add astyling and comments * Delete data/mods/Aftershock/mod_interactions/Defense_Mode directory uncapitalizing directories is difficult * Delete data/mods/Defense_Mode/mod_interactions/Aftershock directory * Delete data/mods/Defense_Mode/mod_interactions/Magiclysm directory * Delete data/mods/Defense_Mode/mod_interactions/Megafauna directory * Delete data/mods/Defense_Mode/mod_interactions/MindOverMatter directory * Delete data/mods/Defense_Mode/mod_interactions/Xedra_Evolved directory * Delete data/mods/Defense_Mode/mod_interactions/My_Sweet_Cataclysm directory * Delete data/mods/Magiclysm/mod_interactions/Defense_Mode directory * Delete data/mods/Megafauna/mod_interactions/Defense_Mode directory * Delete data/mods/Xedra_Evolved/mod_interactions/Defense_Mode directory * restart tests phase 1 * restart tests phase 2 * make for loop var const * extra fix for const for loop * add doc * Update doc/MOD_COMPATABILITY.md --------- Co-authored-by: Maleclypse <[email protected]>
- Loading branch information
1 parent
00c9ead
commit d30e8f3
Showing
65 changed files
with
249 additions
and
11 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Mod Compatability | ||
|
||
## Summary | ||
|
||
Mods are capable of dynamically loading directories based on if other mods are loaded in the world. This will prevent file contents within the mod_interactions folder from being read unless they are part of a folder named after a loaded mod's id. | ||
|
||
## Guide | ||
|
||
In order to dynamically load mod content, files must be placed within subdirectories named after other mod ids (capitalization is checked) within the mod_interactions folder. | ||
|
||
Example: | ||
Mod 1: Mind Over Matter (id:mindovermatter) | ||
Mod 2: Xedra Evolved (id:xedra_evolved) | ||
|
||
If Xedra wishes to load a file only when Mind Over Matter is active: mom_compat_data.json, it must be located as such: | ||
Xedra_Evolved/mod_interactions/mindovermatter/mom_compat_data.json | ||
|
||
Files located within the mod_interactions folders are always loaded after other mod content for every mod is loaded. | ||
|
||
## Limitations | ||
|
||
Currently, this functionality only loads / unloads files based on if other mods are active for the particular world. It does not suppress any other warnings beyond this function. | ||
|
||
In particular, when designing mod compatability content an author will likely want to redefine certain ids to have new definitions, flags, etc. If attempting to do this within the same overall mod folder, this will throw a duplicate definition error. To get around this, instead of a mod redefining its own content within its own mod_interactions folder, the author should redefine its own content using the other mods mod_interaction folder. | ||
|
||
Example: | ||
Mod 1: Mind Over Matter (id:mindovermatter) | ||
Mod 2: Xedra Evolved (id:xedra_evolved) | ||
|
||
If xedra wants an item to have extra damage while Mind Over Matter is loaded, the author should place the new definition in the following: | ||
MindOverMatter/mod_interactions/xedra_evolved/xedra_compat_data.json | ||
|
||
TODO: remove this limitation entirely by adjusting the check to take into account the mod_interaction id source as well |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters