Skip to content

Modifying Existing Content

Brandon edited this page Jun 10, 2026 · 4 revisions

Trainworks has select support for modifying existing content. The full list of content that can be modified directly with the framework:

  • Cards

  • CardUpgrades

  • Challenges

  • Characters

  • Clans

  • Relics (All types)

  • Scenarios

To override the content mentioned above you will need the internal ID of the item you want to modify. For instance back in Getting Started the base Mod Template comes with such a modification.

Example JSON Definition

The internal ID of Firestarter is StarterFireStarter.

{
    "$schema": "https://github.com/Monster-Train-2-Modding-Group/Trainworks-Reloaded/releases/latest/download/schema.json",
    "cards": [
        {
            "id": "StarterFireStarter",
            "override": "replace",
            "cost": 0,
            "names": {
                "english": "Gas Cannister",
                "chinese": "气罐",
                "french": "Le Starter of Fire"
            },
            "descriptions": {
                "english": "Deal [effect0.power] damage",
                "chinese": "造成 [effect0.power] 点伤害。",
                "french": "Inflige <nobr>[effect0.power] DGT</nobr>"
            },
            "card_art": "@Gasoline",
            "effects": ["@DealFiveDamage"],
            "traits": ["@Consume"]
        }
    ],
    "sprites": [
        {
            "id": "Gasoline",
            "path": "textures/card_art/gas.png"
        }
    ],
    "game_objects": [
        {
            "id": "Gasoline",
            "type": "card_art",
            "extensions": {
                "card_art": {
                    "sprite": "@Gasoline"
                }
            }
        }
    ],
    "effects": [
        {
            "id": "DealFiveDamage",
            "name": "CardEffectDamage",
            "target_mode": "drop_target_character",
            "target_team": "both",
            "param_int": 5
        }
    ]
}

Two additional properties are supported with modifying content

  • override - This parameter tells Trainworks how to handle overriding properties on the original item.

    Two override modes are supported

    • replace - Replace the original value with the value specified in the JSON.

    • append - For each property that is a list, the values specified will be appended to the list. Otherwise the value is replaced.

  • clone_id - This parameter instead of modifying an item makes a new clone of it override specfies what happens to properties that are specified.

So the above JSON makes the following changes to Firestarter

  • cost 1 -> 0

  • name Firestarter -> Gas Cannister

  • description "Deal [effect0.power] damage then apply [pyregel] [effect1.status0.power]." -> "Deal [effect0.power] damage"

  • traits Added Consume

  • effects Replaced with an single effect that deals 5 damage

  • card_art Changed to GameObject with sprite "textures/card_art/gas.png"

If override was append instead.

And we modified description to "Deal [effect0.power] damage then apply [pyregel] [effect1.status0.power] then Deal another [effect2.power] damage"

  • cost 1 -> 0

  • name Firestarter -> Gas Cannister

  • description "Deal [effect0.power] damage then apply [pyregel] [effect1.status0.power] then Deal another [effect2.power] damage"

  • traits Added Consume

  • effects Contains the two original effects of the card and the Deal5Damage one defined above.

  • card_art Changed to GameObject with sprite "textures/card_art/gas.png"

Note that any item not listed at the start of the page such as CardEffects, CardUpgradeMasks, RelicEffects, etc. can not be modified with the framework. We have no plans to support this. A workaround to this however is to look up the card in [MonsterTrain2GameData](https://github.com/brandonandzeus/MonsterTrain2GameData/tree/5864cd818295ef552d6ca8619a279bdd11c8b36c) which has the GameData exported in JSON files that you can easily copy/paste and modify.

Clone this wiki locally