Content Patcher

Content Patcher

463k Downloads

[Content Patcher] Add config/dynamic/global token placeholder as condition

Warilized opened this issue ยท 1 comments

commented

Add compatibility for token placeholder as condition so it can read another token as condition

{
"Format": "1.6",
"ConfigSchema": {
"Replace Farm Type": {
"AllowValues": "Standard, Riverland, Forest, Hilltop, Wilderness",
"default": "Wilderness",
}
},
"DynamicTokens": [
{
"Name": "Farm Style",
"Value": "default",
"When": {
"Replace Farm Type": "Standard"
}
},
{
"Name": "Farm Style",
"Value": "fishing",
"When": {
"Replace Farm Type": "Riverland"
}
},
{
"Name": "Farm Style",
"Value": "foraging",
"When": {
"Replace Farm Type": "Forest"
}
},
{
"Name": "Farm Style",
"Value": "mining",
"When": {
"Replace Farm Type": "Hilltop"
}
},
{
"Name": "Farm Style",
"Value": "combat",
"When": {
"Replace Farm Type": "Wilderness"
}
},
{
"Name": "Cave Type",
"Value": "default"
},
{
"Name": "Cave Type",
"Value": "custom",
"When": {
"Replace Farm Type": "{{FarmType}}"
}
}
],
"Changes": [
{
"Action": "Load",
"Target": "Maps/Farm",
"FromFile": "maps/FarmReplace.tbin",
"when": {
"Farm Style: default": "true",
},
},
{
"Action": "Load",
"Target": "Maps/Farm_{{Farm Style}}",
"FromFile": "maps/FarmReplace.tbin",
"when": {
"Farm Style: default": "false",
},
},
{
"Action": "Load",
"Target": "Maps/FarmCave",
"FromFile": "maps/CaveReplace.tbin",
"when": {
"Cave Style: Custom": "true",
},
}
]
}

I tried this for loading custom farm type and caves for my farm, but i want to only load FarmCave if my current farm is the same as config token. "HasFile" token could use token placeholder just fine, but somehow if it's dynamic or config token, it can't do it properly.

I've tried

FarmType: {{Replace Farm Type}}

So it can load only if my current FarmType matches my Config token, but to no avail.

Do you mind looking at it or it's just me who mistyped something?

commented

Support for tokens in When condition values may be added in an upcoming version, but you don't need it in this case. Since custom farm types are always Custom, "Replace Farm Type": "{{FarmType}}" is equivalent to "Replace Farm Type": "Custom".