*if command text

For your original example, you could also use multireplace: @{(Sanity > 60) You|Me}

But that won’t work if you want to test more than two levels of the Sanity stat. For that, *if/elseif/else is still best, and the key thing to remember there is that you need a *goto at the end of each indented bit. (Unless you turn on Implicit Control Flow, which removes the need for *gotos.)

Edit: And it’s worth noting that while @ChanceOfFire’s solution totally works (and I’ve used it myself at times) it’s very bug-vulnerable. It’s not hard to get a >= or <= wrong and end up with something that doesn’t work for various stat values. For example,

*if Sanity > 60
  You
*if Sanity < 60
  Me

will display nothing for players whose Sanity is 60, and

*if Sanity > 60
  You
*if Sanity >= 60
  Me

will display nothing for players whose Sanity is under 60. Both of those are relatively easy mistakes to make.

If you really don’t want to use *gotos in your *if/elseif/else blocks – if copying *goto next and hitting Ctrl-V a couple times just shatters your flow – then I’d suggest turning on ICF, rather than getting into the habit of hard-coding a bunch of *if criteria without using *elseif or *else.

2 Likes