Tractor Mod

Tractor Mod

130k Downloads

[Content Patcher] overhaul token implementation

Pathoschild opened this issue ยท 1 comments

commented

Overhaul Content Patcher tokens to support nesting and more complex tokens.

Background

Content Patcher uses a TokenName concept, which consists of a unique token key (like Relationship) and optional literal subkey (like Abigail). For example, a condition like Relationship:Abigail gets parsed into Key=Relationship, Subkey=Abigail and Content Patcher just looks up the value for that pair.

That means Content Patcher can't support more complex cases like passing tokens into tokens. For example, it only supports HasFile:assets/{{season}}.png by adding token parsing directly in the HasFile token.

The goal is to support more complex condition keys:

"When": {
   "HasValue:{{spouse}}": "true",
   "HasFile:assets/{{HasValue:{{spouse}}}}.png": "true"
}

And fully support tokens in more fields:

"When": {
   "Season": "{{enableInSeason}}"
}
commented

Done in the upcoming Content Patcher 1.7.