• 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.

Stridercal

Sergeant
14 Badges
Dec 13, 2018
98
0
  • Pillars of Eternity
  • Stellaris
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • BATTLETECH
  • Stellaris: Synthetic Dawn
  • Stellaris: Apocalypse
  • Shadowrun Returns
  • BATTLETECH: Flashpoint
  • Stellaris: Megacorp
  • Stellaris: Ancient Relics
  • BATTLETECH: Season pass
  • BATTLETECH: Heavy Metal
So i've got a small mod that is simply a few tweaks and some new variants.

I'd like to add a new weapon to a few stores, and place my new variants in a few others. I've tried adding new line-items to various itemcollection files, but this crashed my game irrevocably during system jumps.

So after getting some advice, I tried subbing in my variants for existing lines ONLY in the same itemcollection files, and got the same result: game-breaking crash.

I've treid searching these boards and haven't found a simple answer - help pretty please?

(my version of the related itemcollection files are attached. If you see what i'm doing wrong, please let me know?)
 

Attachments

  • itemCollection_MechParts_SLDF.csv
    229 bytes · Views: 11
  • itemCollection_shopItems_blackmarket.csv
    2,4 KB · Views: 12
  • itemCollection_shopItems_research.csv
    616 bytes · Views: 8
  • itemCollection_shopItems_starleague.csv
    427 bytes · Views: 9
  • itemCollection_shopItems_starleagueProgression.csv
    810 bytes · Views: 7
  • itemCollection_systemStores_MechParts_BlackMarket_Assault.csv
    1,1 KB · Views: 10
Do you have a mod.json file that adds your new weapon variant to the database?

And the other likely issue is that your weapon's json file is messed up. Give it a good look over, maybe drop it into a validator, or stick it on a stock mech and see if that loads up in skirmish mode (or its mech bay).
 
Last edited:
No, all the individual 'Mech variants, upgrades and weapons test fine in Mechlab and Skimirsh. And nothing is being added to the database.

It appears to be centered on the edits i've made to the BlackMarket Assault 'Mech list. Is there some corresponding list elsewhere that needs to be updated to match?
 
No, all the individual 'Mech variants, upgrades and weapons test fine in Mechlab and Skimirsh. And nothing is being added to the database.
This does not compute. If something new like your granddragon_DRG-5k shows up in the mech lab and skirmish, then it is being added to the database. You've got lines like:
{ "Type": "ChassisDef", "Path": "chassis", "AddToDB": true }
{ "Type": "MechDef", "Path": "MyMechDefs" },
in your mod.json, right?

Anyway, I'd suggest reverting to the base item collection files. Then add your changes in one line at a time, and test with an appropriate store. Don't need to replace existing lines. You can keep them unless you don't want 'em. If the very first item you try blows up, then undo that change and try a different item/type of item instead. But if some do work, then you know you've got a problem with the ones that don't work when you add them.
 
Nope, not using a mod format at all. Everything is being done by hand at the individual file and folder level.

So my mechs appear in skirmish mechlab for testing, and then they show up in the game when i've hand-placed them only. Is that the problem here - am i breaking the game by adding items to stores without placing them in the database first?
 
Probably. I'm actually surprised that just dropping them into the StreamingAssets subfolders (assuming that's what you're doing) works at all. Didn't use to.

Plus placing them in the proper location for mods helps in terms of organization, so that's another good reason to do that.
 
StreamingAssets FTW.

My package overwrites the SLDF mechs, adds a bunch of variants, adds a missile system and a few upgrades and works fine. It's just the stores that break.

So... try a proper mod package instead, eh?
 
Yeah, that's what I'd suggest trying. A basic one (just adding/tweaking files) is no big deal to set up. The time consuming part is making the new json/csv files, and you've done that already.

Also, inside your mods folder, you can put a StreamingAssets/data folder. And in there put in subfolders for mech, chassis, itemCollections, etc. Same layout/names as what's in the Steam/BATTLETECH folder, basically. And then put the appropriate files in there. And by appropriate files, I mean the files that aren't new ones, just ones you're tweaking, that are found in those steam/BATTLETECH folders (not the expansion ones, in other words). No need for those lines I mentioned to refer to those.

The new ones you're adding, for those, you'll want a folder for each type at the root of your mod, and one of those lines to load it. So a folder called something like "MyMechDefs" that contains your new mechDef files (those are the ones in the "mech" folder). And then { "Type": "MechDef", "Path": "MyMechDefs" }, line in your mod.json to go with that.

the "def" types you might need:
"ChassisDefs" - chassis
"VehicleChassisDefs" - vehicleChassis
"UpgradeDefs" - upgrades
"WeaponDefs" - weapons
"MechDefs" - mech
"VehicleDefs" - vehicle
"MovementDefs" - movement
 
Last edited:
So i think i mostly understand the mod.json format, but i can't seem to get it to work beyond simply adding new variants into the game. These seem to include the upgrades and weapons, too.

I'm still having trouble making the other changes "stick" for my edits to simgameconstants, constants, contracts, and itemcollections. I think i'm not using the correct file type for these assets?

Tonight I'll try packaging my changes again as a mod and see if i have any luck...
 
Ohhhhh-weeeeee, i think i might have a lead to try tonight!

I'm thinking the game crash is coming from the fact the blackmarket mech list is actually TWO matched lists? And that i need to have the mech list match perfectly up to the mechparts list.

That sound right to anyone?

Going to try tonight all the same...
 
Nope, that doesn't matter. They can be different.

Confirmed, list matching doesn't help. Problem persists.

So back to beginning: I've got a bunch of variants, two weapons, and a few upgrades. These have all been tested and they all work in game. However, as soon as i modify the black market itemcollection files, the game crashes and corrupts the save when i try to jump to a related system.

So how the heck do i get my new things into stores? It used to be so easy!
 
Okay, here's what I found works:
If you want to replace an itemcollection, or add a new one, create a folder for them in your mod directory and add it to your mod.json manifest like so:
"Manifest": [
{ "Type": "ItemCollectionDef", "Path": "itemcollections" }
]
If you just want to add to an existing itemcollection, I highly recommand that you just create a merge file. It would look like this in mod.json:
"Manifest": [
{ "Type": "ItemCollectionDef", "Path": "itemcollectionsMerge", "ShouldAppendText": true },
]
"ShouldAppendText" tells ModTek to add the contents of the files in that directory to the existing itemcollections of the same names. So rather than replicating the entire itemcollection.csv plus your items, you just need a file with the correct name and your items in it. This can be handy if the itemcollection changes in a new update.

Weapon_LRM_LRM5_3-Artemis,Weapon,1,1
Weapon_LRM_LRM10_3-Artemis,Weapon,1,1
Weapon_LRM_LRM15_3-Artemis,Weapon,1,1
Weapon_LRM_LRM20_3-Artemis,Weapon,1,1
Weapon_SRM_SRM2_3-Artemis,Weapon,1,1
Weapon_SRM_SRM4_3-Artemis,Weapon,1,1
Weapon_SRM_SRM6_3-Artemis,Weapon,1,1
Weapon_SRM_SRM2_3-Streak,Weapon,1,1

Three things to note here:
1. File name must match the file name of the itemcollection to which they should be added (capitalization seems to matter)
2. Do NOT include the first line like "itemCollection_shopItems_starleague,,,", just the items themselves
3. It must end with a blank line (not sure if this is still a thing, but the ModTek doc said it was needed, and it works; I've not tried without it)

Good luck!
 
So it appears the suspect is centered on the black market itemcollection files. All the variants i'm adding the black market lists are tested and verified in game. All the formatting for the itemcollection file is good.

Something breaks the game every time i try to jump to a black amrekt system, though.

Do i need to add my new stuff to the game database? Does it simply not accept drag-and-drop file edits anymore, so i need to package as a mod? This seems so damn simple, and i can't figure out why the game breaks because of this change to the itemcollection files.

Please help!
 
All the new stuff I've added, I've packaged as mods and added to the database. Like Axterix13, I'm surpised that they work in mechlab and skirmish without doing that.
 
Okay @Dogfisc, here's what i've got, let me know if it doesn't look right to you?

So I've got several tweaks to stock assets (the four SLDF 'Mechs, combatgameconstants, simgameconstants and a handful of contracts). These go into a streamingassets/data folder in my mod directory, but do not need a mod.json manifest line, correct?

Next, I've got a range of new variants (that do not need to show up dynamically in OpFor). These get a folder in my mod directory for the chassis/mech/movement folders, and the mod.json needs a line for each type. Example:
"Manifest": [
{ "Type": "ChassisDef", "Path": "chassis3050", "AddToDB": false}
]

I've got three new upgrades. These get a folder in the mod directory and another line on the manifest array in the mod.json. Example:
{ "Type": "UpgradeDef", "Path": "upgrades3050", "AddToDB": true},

I've got two new missile systems. These get a folder in the mod directory and another line on the manifest array in the mod.json. Example:
{ "Type": "WeaponDef", "Path": "weapon3050", "AddToDB": true},

So far, so good. Everything above tests good and works fine in both Skirmish and Campaign modes. Huzzah. Where it all falls down is when i try to add these new variants and weapons to the shops. As far as i can tell, the itemCollection_MechParts_SLDF doesn't break anything, nor do changes to files like itemCollection_shopItems_starleague or itemCollection_shopItems_research.

But when i touch the itemCollection_systemStores_MechParts_BlackMarket_Assault or itemCollection_systemStores_Mechs_BlackMarket_Assault, the game chokes during jumpship jump into the next system.

So what you're saying is I need a folder in my mod directory for itemCollections3050, which has my new variants list (in .CSV) named the same as the target list (so, itemCollection_systemStores_MechParts_BlackMarket_Assault for example), and then i add the following to my mod.json:
{ "Type": "ItemCollectionDef", "Path": "itemcollections3050", "ShouldAppendText": true },

Does that all look legit?

Sorry for the long writeup, but i really appreciate your help with this. I'm totally stuck!

THANK YOU!
 
So I've got several tweaks to stock assets (the four SLDF 'Mechs, combatgameconstants, simgameconstants and a handful of contracts). These go into a streamingassets/data folder in my mod directory, but do not need a mod.json manifest line, correct?
Correct.
Next, I've got a range of new variants (that do not need to show up dynamically in OpFor). These get a folder in my mod directory for the chassis/mech/movement folders, and the mod.json needs a line for each type. Example:
"Manifest": [
{ "Type": "ChassisDef", "Path": "chassis3050", "AddToDB": false}
]
You'll want that false to be true. If you don't want them to be part of the OpFor, then you'll need to set the blacklist flag in the mech itself. Like this (from the Atlas II):
"MechTags": {
"items": [
"unit_indirectFire",
"unit_mech",
"unit_assault",
"unit_ready",
"unit_lance_tank",
"unit_role_brawler",
"BLACKLISTED"
],

But when i touch the itemCollection_systemStores_MechParts_BlackMarket_Assault or itemCollection_systemStores_Mechs_BlackMarket_Assault, the game chokes during jumpship jump into the next system.
This is probably because you're not adding the chassis3050 (and its mechdef partner) to the DB.