Godot Version
4.5.1.stable
Question
I’m working on some text logging for a turn-based combat system, and in my ideal setup, for each of my skills, I produce a choice_<skillname> string that I translate, then format with some additional context, including the name of the user and the name of the target. Then, some amount of outcome_<hit/miss/heal/absorb/etc.> log strings are produced, that are also passed some arbitrary context details.
This is roughly how I’m doing this:
var context = skill.metadata.merged({
"user": user.name,
"target": target.name,
"skill": skill.name,
})
var log_string = String.format(tr("choice_%s" % skill.id), context)
The problem with this approach is that any unused arguments within the format call results in a raised error. It’s a bit frustrating I can’t disable these errors, as they cause things like unnecessary unit test failures.
Am I taking the wrong approach?