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

XTRMNTR2K

is hard to kill
85 Badges
Jul 6, 2010
306
13
  • Europa Universalis IV
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Stellaris: Federations
  • Age of Wonders: Planetfall - Revelations
  • BATTLETECH: Heavy Metal
  • Age of Wonders: Planetfall Deluxe edition
  • Age of Wonders: Planetfall
  • Imperator: Rome
  • Imperator: Rome Deluxe Edition
  • BATTLETECH: Season pass
  • BATTLETECH: Flashpoint
  • BATTLETECH
  • BATTLETECH - Beta Backer
  • BATTLETECH - Backer
  • 500k Club
  • Stellaris: Distant Stars Pre-Order
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Cities: Skylines - Green Cities
  • Surviving Mars
  • Cities: Skylines - Mass Transit
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Age of Wonders III
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • Surviving Mars: First Colony Edition
  • Cities: Skylines Industries
  • Stellaris: Megacorp
  • Surviving Mars: First Colony Edition
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris
  • Cities: Skylines - After Dark
  • Stellaris: Synthetic Dawn
  • Cities: Skylines Deluxe Edition
  • Shadowrun: Hong Kong
  • Cities: Skylines
  • Stellaris - Path to Destruction bundle
  • Age of Wonders: Planetfall Sign Up
  • Surviving Mars: Digital Deluxe Edition
Hello everyone,

the recently released ModTek 0.7.0 has a few nifty new functions. One of these is the possibility to more easily merge and add to .csv and .txt files like itemCollections.

My mod XLRP has several optional submods that require and built upon some of the community-made mech mods, like the new Warhammer and Marauder mods, or the Raven, Archer and Nightstar to name just a few. For the next release of XLRP I wanted to change these submods so they add the respective mech variants to the store system using this new function.

My question is this: How is this actually done? I haven't used any advanced json merges yet, is it done that way? And how and where is the "ShouldAppendText" actually to be used?

Take bloodydoves' Marauder for example. This is what the manifest in the mod.json for my submod looks like:

Code:
    "Manifest": [
        { "Type": "MechDef", "Path": "XLRPMarauder\\" },
        { "Type": "ChassisDef", "Path": "MarauderChassis\\" },
        { "Type": "ItemCollectionDef", "Path": "ItemCollections\\", "ShouldAppendText": true }
    ]

Then I have the corresponding itemCollections (all vanilla ones so far) with the entries in them.

At first I tried keeping the first line (i.e. itemCollection_Mechs_rare,,,) in there, followed by the actual mech/part entries. However, all this achieved was destroying store functionality and black market access. I then removed the first line, but still no luck.


Can anyone help me out with this and point me in the right direction? Any help is appreciated. Many thanks in advance!
 
You can see the resulting file in the .modtek/Cache/ folder from the merge, this is the file that the game will use, if the file is borked, then something went wrong with the merge. If the file isn't present, check the .modtek/ModTek.log - I've tried to be as explicit in the log file as I can. If something looks like it's wrong on my end, file a bug report on GitHub issues for ModTek.

For appending files, you should only include new lines that you want added to the original file and you should include a single empty line at the bottom of the file.

Unrelated, but you should not be using '\\' as a path separator, that's Windows-only -- use '/', it's multi-platform. Also, for folders, you do not need an ending path-separator at all.
 
@Mpstark Thanks a lot for the quick and helpful response! So the general method is correct?

Think I figured it out - having a look at the merged files the issue seems to be a missing empty line at the end of my main files. I'll fix it tomorrow, along with your suggestions. Thanks again.
 
when loading the game it was loading my mods then i got a message saying modtek had died

You'll have to report that issue separately -- Discord or GitHub.

@Mpstark Thanks a lot for the quick and helpful response! So the general method is correct?

Think I figured it out - having a look at the merged files the issue seems to be a missing empty line at the end of my main files. I'll fix it tomorrow, along with your suggestions. Thanks again.

Good that you've figured it out -- I'll see what I can do to detect and fix those kinds of issues in ModTek so that files don't need specific line endings