Hiding variables on the stat page, until or if used

Say a story branch introduces the MC to karate. Is there a way to leave the skill bar out of the stats menu until it’s revealed in-game? Or to never reveal it if that path isn’t chosen.

Well what I did was put a variable after the stat like ${karate} or something then made that equal “???” until it’s revealed then set it to “karate”. The bar will still be there but the player won’t know what it’s for until then.

I want to do for it for character relations. Right now I track stats for three factions behind-scenes. I only want the details visible when you meet them. I guess I could do *if metname, elseif not (metname), etc, but that’d be a novel of code

That’s what I’m using it for too. I don’t know how to post code but it would go like this
*create Bobrep 0
*create bob “???”
Percent Bobrep ${bob}
It will look like ???: *skill bar here*
Then when they meet bob
“hi my name’s bob!”
*set bob “Bob”
Now it would look like Bob: *skill bar here*

That should work, unless that’s not what you want. I don’t think you can use *if in the stats menu, when I tried I got an error (granted, it is very possible that I was doing it wrong)

You could try something like…
*if (stat_show)
----percent stat stat

For each stat. No need for elseifs or elses; if the variable isn’t true then the stat simply won’t display.

I just pulled this out of a hat though, so I’m not sure if it works. Also, caveat: you’d have to create a separate stat_chart for each stat, which might not be visually appealing if two or more stats are on display.

I did two variables.

Every time a NPC was met I’d
*set met_bob true
*set rel_bob 50

and then in the stat screen I’d do an

*if met_bob 
        percent rel_bob

Use < per> and < /per> without the spaces to place code on here.

@Katgirl64 and @Slyde, < pre > and < /pre > tags will allow you to type out code. Without spaces, of course.


Enter ‘adnox’ as the password, choose ‘meetnox’ and click next a few times, then check the stat window. Is that clear?

Thanks, by the way, for the answers, especially Fairy.

Checking your stats file, I’m pretty sure it’ll work; there’s nothing wrong with it as far I can tell.

I’m thinking that it could be possible to do this with just one variable. I use the two because it’s easier for me, and I’d planned for it to hold more info than just having met. I wanted relationship text, in the stat chart, that changes depending on your actions, and possibly how you met.

However back to the doing it with just one variable, the rel_bob one.

I think you could do it if you set the default relationship value to 0 for instance, and then do *if “rel_bob > 0” instead of *if met_bob But you’d need to make sure that the relationships will only be at 0 if you’ve never met the character and you’d need to be careful that any negatives to the relationship stat don’t take things down to 0.

For me it’s more convenient to have separate relationship and met variables.

Through the entire dialogue with Nox, your choices are affecting his view of you by varying, usually small, percentages; they’re all %+ or %-. It leads to some weird percents, so I’ll probably split any relation-decided results into 20% brackets.

I have metnox just because there are two paths where you never encounter him, one where you do, and at points where they can converge, like the puzzle, I need to keep track of it. Other optional interactions can be passed over, or even die. I’ll have to add *if not (sisdead) to rehide her percent bars if she dies.

Why bother? Just setting the boolean to false when she dies should rehide the stats easily enough.

EDIT: Maybe I’m skipping over something and not fully comprehending, but when you meet her, *set’ing the boolean true will allow you to see her stats, and if she dies, *set’ing it false will hide those stats. There’s no need to do *if not()'s to hide something, they’re hidden by default if the *if condition isn’t met.

If I reference her as dead, I can use the dead variable with later choices. I’ll probably end up having a lot of variables tracking stuff that’s never used again, but it saves me the headache of back-editing if I eventually need them, no?

I suppose. I guess I just hate one-trick variables.

The puzzle operates entirely off true-false; four variables total. They only perform one function and are useless after, but critical.

A quick question – I’ve been reading this thread to snag some help for myself with regards to hiding and showing stats! I’m just wondering: how do the *labels in your stats file work? Do you have options throughout the game to only show a chunk of them? Or do they somehow only show one part of the stats file at a time? (I’m curious because I have enough stats that I think I’d like to separate them into different pages, but I don’t want someone to have to view all of them before going back to the game itself!)

The *label command doesn’t prevent anything after it from showing. Your code will continue on as if it weren’t there.

If you want to use the “Next” button at the bottom of the stats screen to show another page of text, you can use *page_break. Alternatively, you can use a *choice to offer multiple other pages of stats. With either method, the player can simply hit the button at the top of the page at any screen of your stats in order to return to the game.

Ah, right. Thanks, @CS_Closet. I am slowly getting better acquainted with all of the little bits and bobs that one doesn’t always utilize while reading!