First time modding, silly question: how to seperate lines in content.json for CP mods?

AtrophyTwink

Newcomer
Not sure if the title makes sense, sorry!
Basically, I'm trying to make a mod for content patcher that changes the new trees in SVE 1.15 to look a little nicer with recolor mods like DaisyNiko's Earthy recolor as they stand out just a touch too much for my liking. I've never modded before and have no real experience with code or anything else, so please excuse how stupid I am about this as my issue is a very silly one.

I've worked out how to replace the assets from SVE to my new ones and have tested it to make sure it works, however I've only tested it with one tree and I have no idea how to add the rest of the code in!
So far I have this:
1727969070210.png


But I don't know where to add the additional lines for the rest of the trees and their seasonal variants. I've tried pasting the code I know works for the fall variant on lines 8-10, just playing around to see what sticks, but my JSON validator is saying its wrong no matter how I enter it. Basically, I have no idea how to separate the lines so that they can be read properly. I know I need the action/target/fromfile code for each variant and have them written up, I just don't know how to get it all in one JSON correctly.

Sorry if none of this makes sense, I can not stress how wildly new this all is for me so I don't know the lingo, but I'd really like to learn and google has no idea what I'm asking of it. I've even tried looking through the content.jsons of various other mods I have to see how they do it, but I really just don't know what I'm doing and would appreciate some help. Thanks in advance!
 

Quirinea

Farmer
Have you tried it like this:
{
"Format": "2.3.0",
"Changes": [
{
"Action" : "EditImage",
"Target": "firsttarget",
"FromFile": "Birch"
},
{
"Action" : "EditImage",
"Target": "secondtarget",
"FromFile": "Othertree"
},
...
]
}

I.e. each tree in a separate entry

I suspect you tried to join the entries, as you said "lines 8 to 10" not "9 to 11".
 
I can help you with that
If you'd like to add more trees, you can simply add new brackets underneath and follow the same steps as above.
If you want seasonal variants, you can either change them individually or you can add {{season}} like this:
Code:
{
    "Format": "2.3.0",
    "Changes": [
        {
            "LogName": "Tree 1",
            "Action": "EditImage",
            "PatchMode": "Replace",
            "Target": "TerrainFeatures/tree1_{{season}}",
            "FromFile": "assets/tree1_{{season}}.png",
        },
        {
            "LogName": "Tree 2",
            "Action": "EditImage",
            "PatchMode": "Replace",
            "Target": "TerrainFeatures/tree2_{{season}}",
            "FromFile": "assets/tree2_{{season}}.png",
        },
    ]
}
You don't have to stress so much. If you are not sure if it works or not, you can just try to open the game with your mod and see if anything looks wrong or if there are any errors.
If you're still having problems, you can read author guide for Content Patcher and maybe you'll find an answer.
 
Top