Complex stat chart help

Hi all - new here.

Anyway, not sure if this is possible. I want to display a stat chart depending on seven booleans. Any of them can be true or false. This creates 127 permutations/states, which means 127 different possible charts.

Is there any way to use ifs within a stat chart or must they wrap around your stat chart creation? In other words, can you do something like this:

stat chart:
-if A = true
–A
-if B = true
–B

rather than…

if A = true and B = true
-stat chart
–A
–B
elseif A = true
-stat chart
–A
else
-stat chart
–B

Assuming it’s not possible to do this dynamically and if I decide to manually craft 127 stat charts from this, am I looking at any potential performance hit from having 700+ lines of code just to facilitate this one thing?

If you’re wanting to have them each appear separately, then yes you would need to separate them unfortunately, though I imagine you could create a template, paste it 127 times, and then use find and replace to change them to what you need them to be. As for performance, whatever hit you might experience would be at the beginning when the game is first loading, but I doubt it would be noticeable. It’s quite common for stat charts to be really long if you’re doing anything more complicated than a basic setup.

Also, I just thought of this, are you actually wanting to display all 127 stats to the player? That seems like entirely too much information to throw at the player. If you’re actually wanting to display all of that, I would recommend breaking it up into categories with *choice.

You can’t use conditionals in stat charts, but you can stack a bunch of one-row stat charts right up next to each other and it looks much the same.

Let’s suppose you want to show relationship variables for any number of people ranging from one to seven. Let’s say their names are: Alice, Bob, Carol, Dave, Eve, Frank, and Gina, and you have seven relationship stats: RelAlice, RelBob, etc. and they’re all FairMath percentages. Suppose that you only want to show them in a stat chart if you’ve met them, so you have seven boolean stats: MetAlice, MetBob, etc.

Then you could write the code like this:

*temp MetAlice true
*temp MetBob true
*temp MetCarol true
*temp MetDave true
*temp MetEve true
*temp MetFrank true
*temp MetGina true

*temp RelAlice 10
*temp RelBob 20
*temp RelCarol 30
*temp RelDave 40
*temp RelEve 50
*temp RelFrank 60
*temp RelGina 70

*if MetAlice
  *stat_chart
    percent RelAlice Alice
*if MetBob
  *stat_chart
    percent RelBob Bob
*if MetCarol
  *stat_chart
    percent RelCarol Carol
*if MetDave
  *stat_chart
    percent RelDave Dave
*if MetEve
  *stat_chart
    percent RelEve Eve
*if MetFrank
  *stat_chart
    percent RelFrank Frank
*if MetGina
  *stat_chart
    percent RelGina Gina

And that would look like this:

Is that what you’re looking for?

4 Likes

Yes! Elegant, perfect, and I’m ashamed I didn’t think of it myself. Intellectual laziness on my part.

Thanks so much!