Content Patcher

Content Patcher

378k Downloads

[Content Patcher] add map patches

Pathoschild opened this issue ยท 2 comments

commented

Let content packs replace map areas and change map properties, so you don't need specialised (and sometimes infrequently maintained) map frameworks for basic changes.

commented
  • Proposed usage for a map edit:
    {
       "Action": "EditMap",
       "Target": "Maps/Town",
       "FromFile": "assets/town_edits.tbin",
       "FromArea": { "X": 0, "Y": 0, "Width": 15, "Height": 15 }, // optional, defaults to whole file
       "ToArea": { "X": 0, "Y": 0, "Width": 15, "Height": 15 }, // optional, defaults to patch size from top-left corner
       "AddTilesheets": {
          "tilesheet ID": "assets/tilesheet.png"
       }
    }
  • Proposed usage to change a map property:
    {
       "Action": "EditLocation",
       "Target": "Town",
       "MapProperties": {
          "Warp": "10 10 Farm 0 0"
       }
    }
    Replacing a map property entirely isn't ideal in some cases (e.g. multiple mods may need to add warps to a location). This should also support appending/prepending using a special 'previousValue' token (trimmed if needed):
    {
       "Action": "EditLocation",
       "Target": "Town",
       "MapProperties": {
          "Warp": "{{previousValue}} 10 10 Farm 0 0"
       }
    }
    And possibly search/replace logic:
    {
       "Action": "EditLocation",
       "Target": "Town",
       "MapProperties": {
          "Warp": {
            "Search": "10 10 Farm 45 30",
            "Replace": "10 10 Farm 0 0" 
          }
       }
    }
  • This could maybe support other location fields in future versions, like...
    {
       "Action": "EditLocation",
       "Target": "Town",
       "Fields": {
          "IsGreenhouse": true
       }
    }
commented

Map patching done in the upcoming Content Patcher 1.8; map property changes moved to #421.