Content Patcher

Content Patcher

378k Downloads

[Content Patcher] Add characters global token

Warilized opened this issue · 5 comments

commented

This would be useful if modders want to replace all of character files like dialogues. Saving times for checking the spelling of character names.

so this

{
    "Action": "Load",
    "Target": "Characters/Dialogue/Abigail, Characters/Dialogue/Penny, ...  Characters/Dialogue/Wizards",
    "FromFile": "Content/{{target}}.xnb",
    "When": {
        "HasFile:Content/{{target}}.xnb": "true"
    }
}

Simplified to

{
    "Action": "Load",
    "Target": "Characters/Dialogue/{{Characters}}",
    "FromFile": "Content/{{target}}.xnb",
    "When": {
        "HasFile:Content/{{target}}.xnb": "true"
    }
}
commented

This wouldn't work as proposed, since it'd get expanded to this:

"Target": "Characters/Dialogue/Abigail, Alex, Caroline, Clint, ...",

I've considered support for a wildcard syntax like "Target": "Characters/Dialogue/*", though it might be confusing due to unexpected matches (e.g. Characters/Dialogue/*Characters/Dialogue/MarriageDialogue or Characters/*Characters/schedules/Abigail).

commented

That's true, the mod would be confused which file to be patched if it's a wildcard.

Making the character player interacted with as flag like "Target": "Characters/Dialogue/{{InteractedWith}}" ->"Target": "Characters/Dialogue/Abigail" (if player interacted with Abigail), seems like out of question also. It'll take time to load when player interacted with character, or even fail to be loaded, because the timeframe for the mod to load and apply is short.

I only seeks shortcut to write character names in the code because checking them is somewhat a chore and takes a lot of time haha.

btw, thanks for the fast responds

commented

Unfortunately dialogue needs to be loaded at the start of the day, it's harder to change NPC dialogue later. I think the wildcard approach is the only way Content Patcher itself could support this; it replaces/edits content at the asset level, so it has no concept of characters.

commented

oh thanks, will wait for the next updates that'll include wildcards.

In the meantime i'll develop a mod the same way :D

commented

It hasn't been planned out yet so there's no timeline, but it's something I'm considering for a future update. I'll close this ticket in the meantime though, since we can't use the token approach as discussed above. :)