BattletechModders / ModTek

Mod system for HBS's PC game BattleTech.
GNU Lesser General Public License v2.1
121 stars 34 forks source link

Full Support for DLC Content #90

Closed mpstark closed 3 years ago

mpstark commented 5 years ago
CptMoore commented 5 years ago

I really need this to fix the cyclops, it currently contains invalid hardpoint data

Error: AdvancedJSONMerge: "MechEngineer\advancedjsonmerge\hardpointdatadef_cyclops.json" could not resolve type for ID: hardpointdatadef_cyclops. Skipping this merge
mcb5637 commented 3 years ago

I did some testing with BT and Unitys AssetBundles. Turns out, they are not loaded while ModTek makes its merges, so in order to get something out of them, they would have to be loaded, then accessed and finally unloaded. Quick example:

            AssetBundle a = AssetBundle.LoadFromFile(path+"BattleTech_Data\\StreamingAssets\\data\\assetbundles\\heavymetal");
            FileLog.Log("found in " + a.name + " " + a.Contains("Gear_JumpJet_Vectored_Thrust_Kit"));
            FileLog.Log(a.LoadAsset<TextAsset>("Gear_JumpJet_Vectored_Thrust_Kit").text);
            a.Unload(true);

This was executed as a ModTek dll in FinishedLoading, so it should be relatively easy to adapt this to checks if some json is in one of the dlc assetbundles, and if the check is true, load the json as a string to perform the merge. I would like to test this out, but it is probably faster if someone that knows the code helps me out by pointing me to the correct code pieces. What i need is:

LadyAlekto commented 3 years ago

This is why its very suggested to make overrides and not merges

Even with HBS modloader

CptMoore commented 3 years ago

fixed in #191 (lost ability to merge custom resource though, since now the merges are delayed until datamanager tries to load it)