Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Setting a max for a variable (harlowe)

I'm trying to set a max number for some variables I have, so they never go over a certain number.

I could paste this on every passage, but it would be tiring to have to modify them all if I ever decided to change that max.
(if: $stat > 10)[(set: $stat to 10)](if: $stat2 > 10)[(set: $stat2 to 10)]

Is there an easier way to write this just once so it applies to all passages?

Comments

  • I would think that you could put all of those in a passage (e.g. ConstrainStats) and then use the (display:) macro whenever you need to run them (e.g. (display: "ConstrainStats")). You'll probably have to elide some whitespace, but other than that it should work.
  • I just use the "if" and "set" conditions one after the other, and pasted a "display" before the first word of each passage. It did not cause problems with spaces. Thanks. I'm starting to love this community.
Sign In or Register to comment.