Let’s start with what I try to do. When a variable reaches a certain number I would like it to lock in. So, let’s assume this:
$stat1 is “3”
$stat2 is “1”
Upon a variable reaching number 3 I would like the other one to stop going up. Do I change the variable type from a numer to a boolean, so $stat1 becomes “true” making it locked in? It seemed like a good idea but then again the choices to level up the variable are still present so how do I tell Twine to stop counting them?
I was thinking about a way of keeping track of which stat goes up to 3 first and kind of keep the other one down to 0 but without knowing which one gets there first makes it tricky. I just have no idea how to do it? Would appreciate a clue.
I’m using:
Twine Version: 2.3.14
Story Format: Sugarcube 2.34.1
Without your code we can only guess what you’re really trying.
However my best idea is every time you modify $stat1 or $stat2, you can add an <<if>> <</if>> clause.
Example: some action may allow an increase of $stat2, only if $stat1 isn’t already at 3.
I don’t have much of a code around the idea yet, just a couple of variables representing opposite stats:
$irritable and $patient for exaple, so I want one to lock when the reader reaches numer 3 on either of those two stats. In a link it goes like one would expect:
So I imagine as certain point (when I will know it’s possible for the reader to actually reach those 3 points in a certain variable) I’ll have to hide links between:
Of course $irritable and $patient need to be and stay integers and to increase by only 1 at a time. If you plan either to allow fractions or to increase by more than one you would need to manually set a maximum to 3. It can be addressed with little more circonvoluted conditions. Example below.