Content Patcher

Content Patcher

378k Downloads

[Content Patcher] add map property edits

Pathoschild opened this issue ยท 2 comments

commented

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

commented

Split from #409:

  • 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

Done in develop for the upcoming Content Patcher 1.10.

The {{PreviousValue}} token proposed above isn't currently supported, since it doesn't work with the current Content Patcher design (because the value can't be evaluated ahead of time).