I’ve followed the directions on the choicescript home page dedicated to customising the stats screen, and it only partially works. I’m trying to figure out what I did wrong for the parts that don’t work since I haven’t changed anything.
So it should look like this at the beginning (which it does):
However, when the conditions become true, only the first one, Liz or Sam, displays correctly.
The other two stat bars don’t show the name change if the correct conditions are met. I have checked the code multiple times to make sure the condition actually does become true and is spelled correctly, but to no avail. Does it not work with boolean variables or do I have it set up wrong?
I’m not sure what is causing the difference? I don’t want to hide it completely, I simply want the name to change from “???” to the relevant character’s name.
Your problem is that you have a *goto set up after each *if statement. Because of this, the code automatically skips anything after the first true statement, resulting in those other variables not being changed appropriately.
You should be able to make do with just removing the *goto codes.
Wow okay, thank you very much. I don’t know why I couldn’t figure it out.
I previously had *else and *elseif in the statements which forced me to *finish or *goto before they ended, but I forgot that’s not required if you’re using only *if statements.
Title. I’d like a stat to be invisible when a player enters the choicescript_stats menu unless a certain condition is met. Say, for example…
*if (encounter_bob = “true”)
(here is a code unbeknownst to me that would be entered to display a stat, maybe like “bob_relationship” if the condition “encounter_bob” is set to “true”)
*else
(code entered here to hide “bob_relationship” if “encounter_bob” is anything other than “true”)
Any idea of how I may accomplish this? Thank you so much!
You’re most of the way there already! It is as simple as putting the bob_relationship stat in an *if command. For instance:
*if encounter_bob
*stat_chart
percent bob_relationship Bob
You don’t even need the *else if you don’t have anything else to display in the meantime. The above code will make Bob’s relationship stat invisible until encounter_bob is set to ‘true’.
I created a temp variable on the stat screen that I called “hiddenstat” aptly, lol, and used that to keep some stuff hidden. It seems to work fine for my purposes.
So *temp hiddenstat false
and then I made an *if statement over the stats I wanted hidden, for example:
*if hiddenstat = true
-> *stat_chart
–> text charm
–> text bold
The arrows are indents.
This is only if you want the stats hidden while you have a demo or are playtesting. If you want the stats hidden temporarily, you’ll want to make a real variable on your startup and use that instead of a temp
@Nostalgiafan The *temp hiddenstat should work for the whole game then! Or you can just not add them to the stat page at all. As long as you have the stat in the startup, you don’t actually have to have it appear in the stats screen.