Basically what the example is trying to tell you is this:
The stat you display on the stats page doesn’t have to be the same stat you use to keep track of things in-game. Instead, you can use your in-game stat to change the value of a new, different stat. Then you can display that new stat on your stats page.
In that example, there are two variables. The one used in-game is called
wounds, and is a simple numeric stat. That is to say, it only records numbers. The other stat (called
wound_text) holds the string of letters that will be displayed on the stats page. So it’s a string variable. Because it holds a string of letters. And potentially mixed letters and numbers, though in this example it’s letters only.
Because the stat being displayed is only used on the stats page, because it’s not being used anywhere else, it doesn’t matter whether it’s a normal (a.k.a. “permanent”) variable, or whether it’s a temporary variable. This example is using a temporary variable to keep the code for the game a little cleaner and tidier.
So the example starts by declaring the temporary variable it will use. It does that like this:
*temp wound_text " "
Or maybe the example omitted the quotation marks? I think you should include them, but whatever. Moving on!
After declaring the temp variable, the example code then gives the temp variable a value based on what the main variable is. That’s the whole section of:
*if wounds = 0
*set wound_test "Uninjured"
…and so on, and so forth. That section ends with the
Because this example is not using implicit control flow, after each section of the
*else code, it includes a
*goto command. You don’t need those if you’re using implicit control flow, but you will need them if you aren’t using it.
*goto commands point to a single label:
This label is right above the stat chart, so the start chart displays next. And what does it display? It displays the temporary variable! That’s this bit here:
text wound_text Wounds
Not carefully: This code sample is putting the
wound_text variable’s value in the stat chart, and then displaying that… with a different name. It’s displaying with the name
Wounds, even though it’s the
Now, looking at your stat chart, I see some issues:
- You need do your
*if code before the
*stat_chart, not in the middle of it
- Unless you have a variable named Relations something really weird is going to happen in that part of the stat chart
- Unless Anemos is the only character the player can have a relationship with, you’ll need some way to keep all the characters’ relationships separate
That said, this is how I would handle your code (My example will use implicit control flow; make sure you adjust it if you’re not using it!):
*temp display_relation " "
*if relationship < 30
*set display_relation "He is completely against having you here"
*if (relationship >= 30) and (relationship < 65)
*set display_relation "He would prefer you over a group of strangers"
*if (relationship >= 65) and (relationship < 75)
*set display_relation "He considers you a friend"
*if (relationship >= 75) and (relationship < 90)
*set display_relation "Your are his one and only he would do anything for you"
*if relationship >= 90
*set display_relation "He has a crush on you confession is possible"
text display_relation Anemos