Open michael-buschbeck opened 3 years ago
Tentative syntax:
Line | Command |
---|---|
1 | !mmm translate [UsedAmmo] using variants |
2 | !mmm variant if $[NumAmmo] == 0: Shot an arrow. All empty now – this one has to count. |
3 | !mmm variant if $[NumAmmo] == 1: Shot an arrow, and there's still one more to come! |
4 | !mmm variant otherwise: Shot an arrow, and still $[NumAmmo] more to come! |
5 | !mmm end translate |
I really have to support a "safe" side-effect-free version of expression evaluation then – wouldn't want players to sneak in the odd setattr()
or chat()
function in their translation variant preconditions.
(To be fair, they don't have to "sneak" anything in anywhere as long as they could just do !mmm do on their own.)
More important than being side-effect-free is that variant preconditions are evaluated against the customize block's variable stash, not the executed script's.
Blocked by #117 because having an expression in front of a template requires a cleverer command parser.
The translate command (see #47) replaces a single chat output with a single translated message. Sometimes I'd be a lot nicer (or even a linguistic necessity) to be able to provide variants based on runtime criteria.
Consider this:
Even with translation, this can result in variously clunky messages:
It would be nice to be able to provide translation variants depending on the
$[NumAmmo]
value: