• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

SpiritWolf448

Private
43 Badges
May 12, 2016
12
0
  • Warlock 2: The Exiled
  • Crusader Kings II: Reapers Due
  • Magicka
  • Stellaris: Humanoids Species Pack
  • BATTLETECH: Season pass
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • BATTLETECH
  • Age of Wonders III
  • Crusader Kings II: Jade Dragon
  • BATTLETECH - Initiate of the Order
  • Crusader Kings II: Holy Fury
  • BATTLETECH: Heavy Metal
  • Stellaris: Apocalypse
  • Stellaris: Ancient Relics
  • BATTLETECH - Beta Backer
  • BATTLETECH - Backer
  • Stellaris: Distant Stars
  • Shadowrun Returns
  • Stellaris: Megacorp
  • Stellaris: Galaxy Edition
  • Warlock: Master of the Arcane
  • Cities: Skylines
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Synthetic Dawn
  • Cities: Skylines Deluxe Edition
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • BATTLETECH: Flashpoint
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Charlemagne
  • Crusader Kings II
Howdy, folks.

Say, is there any place that has a one-shot primer on how to mod Battletech nowadays?

Sorry if I sound ancient, but last I played and modded BT was back during its original release, before any DLCs or fancy modtek stuff. You know, back when you still edited the actual game jsons, added entries in the VersionManifest.csv and used SQLite Browser to add entries to the MetadataDatabase.db so the stuff was available in the campaign.

I picked BT up again now and wanted to get with the times and use this mod loader setup that is all the rage today, but I will be honest, from the stuff I read on github/modTek, it seems to be a bit beyond me. ^_^"

What my mod does (or better, used to do back in the day), was plentifold. It added custom ammo boxes, heatsinks, cockpit upgrades, weapons and mechs, plus modified abilities, traits, backgrounds, milestones, shops and simgameconstants. It also added new pilots and their portraits.


And that is the point my brain basically shuts off now. Writing the mod.json for the modtek loader.

I mean, I think I understand that using the Manifest entry, you can get it to add completeley new files, like mechs and weapons. (Although I am unsure what entries are valid for the "Type" field.)
But how do I tell the thing to add my custom portraits under SteamingAssets\sprites\portraits? How do I merge my changes to existing gamefiles, like simgameconstants.json? And how do I tell it to make the necessary entries in the MetadataDatabase.db?

Yes, a lot of questions. Which have likely been answered before somehwere and sometime. But is there a one-stop primer/tutorial that walks you through all of it?

Guess I am really getting too old for this stuff. ^_^"

---------------

Just in case, here's two lists.

List of all existing game files modified by me (mostly just changed some numbers, but some are more heavily modified):
StreamingAssets\data\abilities\AbilityDefT8A.json

StreamingAssets\data\abilities\Traits\TraitDefHealthAddThree.json
StreamingAssets\data\abilities\Traits\TraitDefIndirectReduceThree.json
StreamingAssets\data\abilities\Traits\TraitDefMinRangeReduce90.json
StreamingAssets\data\abilities\Traits\TraitDefOverheatAddThirty.json
StreamingAssets\data\abilities\Traits\TraitDefRefireReduceTwo.json

StreamingAssets\data\backgrounds\background_ancestry_DeepPeriphery.json
StreamingAssets\data\backgrounds\background_ancestry_Magistracy.json
StreamingAssets\data\backgrounds\background_ancestry_Marik.json
StreamingAssets\data\backgrounds\background_career_freelancer.json
StreamingAssets\data\backgrounds\background_career_mercenary.json
StreamingAssets\data\backgrounds\background_career_merchant_guard.json
StreamingAssets\data\backgrounds\background_youth_betrayed.json

StreamingAssets\data\milestones\milestone_105_talk_eightHoursLater.json
StreamingAssets\data\milestones\milestone_114_sim_leopard_start.json
StreamingAssets\data\milestones\milestone_305_sim_argo_start.json
StreamingAssets\data\milestones\milestone_700_notify_complete.json

StreamingAssets\data\pilot\pilot_story_kamea.json
StreamingAssets\data\pilot\pilot_story_kamea_end.json
StreamingAssets\data\pilot\pilot_story_kamea_mid.json
StreamingAssets\data\pilot\pilot_story_KameaGuard1.json
StreamingAssets\data\pilot\pilot_story_KameaGuard2.json
StreamingAssets\data\pilot\pilot_story_KameaGuard3.json

StreamingAssets\data\shipUpgrades\argoUpgrade_drive2.json
StreamingAssets\data\shipUpgrades\argoUpgrade_mechBay_automation2.json
StreamingAssets\data\shipUpgrades\argoUpgrade_mechBay3.json
StreamingAssets\data\shipUpgrades\argoUpgrade_medBay3.json

StreamingAssets\data\shops\shopdef_Ammo_special.json
StreamingAssets\data\shops\shopdef_Components_base_0.json
StreamingAssets\data\shops\shopdef_Mech_0.json
StreamingAssets\data\shops\shopdef_Weapons_base_0.json

StreamingAssets\data\simGameConstants\SimGameConstants.json

StreamingAssets\data\VersionManifest.csv

StreamingAssets\MDD\MetadataDatabase.db

List of new files added by me:
StreamingAssets\data\abilities\AbilityDefT10.json

StreamingAssets\data\ammunitionBox\Ammo_AmmunitionBox_448_LRM.json
StreamingAssets\data\ammunitionBox\Ammo_AmmunitionBox_448_SRM.json

StreamingAssets\data\chassis\chassisdef_blackjack_BJ-448.json
StreamingAssets\data\chassis\chassisdef_catapult_CPLT-448.json
StreamingAssets\data\chassis\chassisdef_grasshopper_GHR-448.json
StreamingAssets\data\chassis\chassisdef_highlander_HGN-448.json
StreamingAssets\data\chassis\chassisdef_kintaro_KTO-448.json

StreamingAssets\data\heatsinks\Gear_HeatSink_448.json

StreamingAssets\data\mech\mechdef_blackjack_BJ-448.json
StreamingAssets\data\mech\mechdef_catapult_CPLT-448.json
StreamingAssets\data\mech\mechdef_grasshopper_GHR-448.json
StreamingAssets\data\mech\mechdef_highlander_HGN-448.json
StreamingAssets\data\mech\mechdef_kintaro_KTO-448.json

StreamingAssets\data\movement\movedef_blackjack_BJ-448.json
StreamingAssets\data\movement\movedef_catapult_CPLT-448.json
StreamingAssets\data\movement\movedef_grasshopper_GHR-448.json
StreamingAssets\data\movement\movedef_highlander_HGN-448.json
StreamingAssets\data\movement\movedef_kintaro_KTO-448.json

StreamingAssets\data\pilot\pilot_448_Harlequin.json
StreamingAssets\data\pilot\pilot_448_Juggers.json
StreamingAssets\data\pilot\pilot_448_Kattana.json
StreamingAssets\data\pilot\pilot_448_Milkrun.json
StreamingAssets\data\pilot\pilot_448_TwinChoc.json

StreamingAssets\data\upgrades\cockpitMods\Gear_Cockpit_448_DeusOculus.json

StreamingAssets\data\weapon\Weapon_448_AC4.json
StreamingAssets\data\weapon\Weapon_448_AC7.json
StreamingAssets\data\weapon\Weapon_448_Flamer.json
StreamingAssets\data\weapon\Weapon_448_LRM4.json
StreamingAssets\data\weapon\Weapon_448_LRM8.json
StreamingAssets\data\weapon\Weapon_448_LRM16.json
StreamingAssets\data\weapon\Weapon_448_LRM32.json
StreamingAssets\data\weapon\Weapon_448_SRM12.json

StreamingAssets\sprites\Portraits\pilot_448_Harlequin.png
StreamingAssets\sprites\Portraits\pilot_448_Juggers.png
StreamingAssets\sprites\Portraits\pilot_448_Kattana.png
StreamingAssets\sprites\Portraits\pilot_448_Milkrun.png
StreamingAssets\sprites\Portraits\pilot_448_TwinChoc.png

StreamingAssets\MDD\data\448_MetadataDatabase_Additions.sql

------------------

Thanks to all who read this far. :-D
 
The ModTek readme is probably the best documentation out there that I know of, and yeah... it's not particularly easy to follow at first.

Try downloading the cFixes mod and looking at how it works... that one changes so many different types of things that you can probably find an example in there that's similar to just about anything you want.
 
I can only address a few items, but let's go bit by bit.

ModTek and ModLoader are two related items but not 100% the same. Modloader is HBS's current implementation of Modtek, which has some issues. Modtek is currently being community supported to continue support of mods while HBS sort out those issues.

mod.json documentation is here: https://github.com/BattletechModders/ModTek/wiki/The-mod.json-Format

Now, to more practical matters. I presume you are trying to use the official Modloader.

  • If the definition file you are trying to add is new, and your ID is unique, just putting them into the mod.json Manifest section is sufficient. The Modloader will automatically load those, either by directory or by file.

  • If the definition file you are trying to add is a duplicate of an existing file (ID is the same as something else), in the Manifest section you can either use ShouldMergeJSON (where the later declared copy's parameter will likely be utilised) or ShouldAppendText (where the text of your file will be added to the existing loaded definitions, with possible clashes). I'm much more familiar with merge than append.

  • If you are trying to get things to show up in Campaign or Career, in the Manifest section you'd need to use AddToDB; otherwise the cool stuff shows up in Skirmish only. (Not 100% sure about portraits.)

  • If you need some previously defined file just not be present in the memory space, you need to use the RemoveManifestEntries section.
As for resource definition Type, Battletech has a LOT of them. I don't have a full list on this PC, but here's a partial (at least to start off; I'd update this later)
  • AmmunitionDef
  • AmmunitionBoxDef
  • ChassisDef
  • HardpointDataDef
  • HeatSinkDef
  • MechDef
  • MovementCapabilitiesDef
  • UpgradeDef
  • WeaponDef
For some addition on-forum reference, an old, old thread on modding:
https://forum.paradoxplaza.com/forum/index.php?threads/mod-talk-mod-discussion-thread.1091249/

But... that one is a bit much to wade through.
 
Thank you to both of you for your input. I appreciate it. :)



@Lynx7725

Thank you for the partial list of the "Type" resource definititions. I got most of what I needed. Only ones I am now missing are the resource "Types" for Pilots, Abilities, Traits and Portraits. So if you manage to find out, by all means, please do share. ;)



@Topic

Does a log file exist somewhere that is actually helpful in debugging a mod until it is (hopefully) error free?
 
Does a log file exist somewhere that is actually helpful in debugging a mod until it is (hopefully) error free?
Not that I've found yet.

My guess would be that it's in the official main log file, but that some option needs to be turned on. Back in the day, we figured out many of the possible settings from files that were left around and I remember updating the Modding Wiki (also linked in the Mod Support Readme) with the details needed to get as much information as possible out of the logs. As far as I can tell, that entire Wiki is hopelessly out of date these days, but that part of it might be a start, at least.

Another thing you could try is to install the latest version of ModTek (now updated for 1.8). If you can get a mod working using it, you could then move the mod to the built-in system and see if it works there (easier to have wide distribution if people don't need ModTek to use it). ModTek logs go in [Mod folder]/.modtek/ModTek.log, IIRC.
 
@Lynx7725

Thank you for the partial list of the "Type" resource definititions. I got most of what I needed. Only ones I am now missing are the resource "Types" for Pilots, Abilities, Traits and Portraits. So if you manage to find out, by all means, please do share. ;)


@Topic

Does a log file exist somewhere that is actually helpful in debugging a mod until it is (hopefully) error free?
The full list of Defs/ resources should be as follows:
  • AbilityDef,
  • AmmunitionBoxDef,
  • AmmunitionDef,
  • ApplicationConstants,
  • AssetBundle,
  • AudioConstants,
  • AudioEventDef,
  • BackgroundDef,
  • BackgroundQuestionDef,
  • BaseDescriptionDef,
  • BehaviorVariableScope,
  • BuildingDef,
  • CastDef,
  • ChassisDef,
  • ColorSwatch,
  • CombatGameConstants,
  • ComputeShader,
  • ContentPackDef,
  • ContractOverride,
  • ContractTemplate,
  • ConversationContent,
  • CSV,
  • DesignMaskDef,
  • DialogBucketDef,
  • DropshipDef,
  • FactionDef,
  • FlashpointDef,
  • GenderedOptionsListDef,
  • HardpointDataDef,
  • HeatSinkDef,
  • HeraldryDef,
  • ItemCollectionDef,
  • JumpJetDef,
  • LanceDef,
  • LayerData,
  • LifepathNodeDef,
  • MapLogicConstants,
  • MechDef,
  • MechStatisticsConstants,
  • ModDef,
  • MoodSettings,
  • MovementCapabilitiesDef,
  • PathingCapabilitiesDef,
  • PilotDef,
  • PortraitSettings,
  • Prefab,
  • RegionDef,
  • Shader,
  • ShipModuleUpgrade,
  • ShopDef,
  • SimGameConstants,
  • SimGameConversations,
  • SimGameDifficultySettingList,
  • SimGameEventDef,
  • SimGameMilestoneDef,
  • SimGameMilestoneSet,
  • SimGameSpeakers,
  • SimGameStatDescDef,
  • SimGameStringList,
  • SimGameSubstitutionListDef,
  • SimpleText,
  • Sprite,
  • StarSystemDef,
  • SVGAsset,
  • TerrainData,
  • Texture2D,
  • TurretChassisDef,
  • TurretDef,
  • UIModulePrefabs,
  • UpgradeDef,
  • VehicleChassisDef,
  • VehicleDef,
  • WeaponDef
As for the log file, usually the first will be output.log. On a Windows system, they have shifted it into the user Appdata directory, under:

[OS Drive]:\Users\[User ID]\AppData\LocalLow\Harebrained Schemes\BattleTech
 
Does a log file exist somewhere that is actually helpful in debugging a mod until it is (hopefully) error free?

It's in: C:\Users\*user*\AppData\LocalLow\Harebrained Schemes\BATTLETECH
 
You should note - currently build-in ModLoader can't load correctly anything besides [*]Def.
And another feature was missed by others. Dynamic enums
Code:
  "DataAddendumEntries":[
    {
      "name": "BattleTech.FactionEnumeration",
      "path": "Faction.json"
    },
    {
      "name": "BattleTech.WeaponCategoryEnumeration",
      "path": "WeaponCategory.json"
    }
  ]
enum files examples in BattleTech_Data/StreamingAssets/data/enums
Supporting types by ModTek: BattleTech.FactionEnumeration, BattleTech.WeaponCategoryEnumeration, BattleTech.AmmoCategoryEnumeration, BattleTech.ContractTypeEnumeration
By modLoader: BattleTech.FactionEnumeration