Content Patcher

Content Patcher

378k Downloads

[Content Patcher] Add a way to parse tokens in Targets field before splitting them lexically.

drbirbdev opened this issue ยท 1 comments

commented

The following allows patching to two character dialogues at once:

"Changes": [{
    "Action": "EditData",
    "Target": "Character/Dialogue/Jas, Character/Dialogue/Vincent",
    "Entries": {...}
}]

But this doesn't work

"DynamicTokens": [{
    "Name": "AllChildren",
    "Value": "Character/Dialogue/Jas, Character/Dialogue/Vincent"
}],

"Changes": [{
    "Action": "EditData",
    "Target": "{{AllChildren}}",
    "Entries": {...}
}]

I think because Target gets split on commas (excluding commas in tokens) before evaluating tokens.

I think it'd be useful to have some way to evaluate tokens in the Target field before splitting. That seems like a more reasonable default even. I'm not sure what use-case there is for doing it in the current order.

commented

Unfortunately that isn't really feasible with Content Patcher's current design. Patch targets are parsed when loading the content pack and don't allow tokens containing multiple values, which is needed for some of Content Patcher's optimizations (e.g. tracking which patches need to be reapplied).

We'd need a significant refactor to some of the core parts of Content Patcher to support this, which probably isn't worth it since content packs very rarely need to do this. Thanks for the suggestion though!