Using plus and minus in Twine sugarcube with the click function, is there a way to stop the variable from being adjusted if it hits a certain limit? For example, if you had the variable strength and the player could add/subtract points to it, is there a way that you could keep it from going below three or above eighteen (to use old D&D numbers)?
Basically I want to keep the variable limited to a certain range. I have a crude work around in place for my current project (if the player tries to continue with a number outside the available range instead of continuing the story it just pops up a message telling the player what is wrong and to go back and do it again) but I'm wondering if there is a clearer way to do it where clicking on the plus/minus doesn't yield anything if it would take the number outside the designated range.
Comments
For example:
Or you could wrap the entire <<click>> macro in the <<if>> statement, so it only appears if the player actually can use it.
note: TheMadExile has suggested replacing each of the <<run>> macro calls in my solution with script elements instead because they would be more efficient. (And he should know as he is the developer of SugarCube! lol)
Example of reformatting a <<run>> macro: from => to