How Do You Hide Stats Until Needed?

#1

I think I saw this before a couple weeks ago, but I haven’t been able to find it since then.

Basically, I’ve created some stats, from relationships, to personal, powers, etc. but, I don’t want to have the stat screen crowded, unless they’re actually being used.

So, I was wondering, how would I hide or show them throughout the course of the story, I have them setup in the “mygame.js” file, but I haven’t put them in the stat screen.

The first scenario I come to, is that, “Player, has met Character A, and left a negative impression” and, I know how to change stats normally, I just don’t want the stat to show, until that first meeting, and say later, if Character A dies, I want the stat to disappear.

Hiding characters until they are introduced
Hiding stats picks
#2

Put them inside an if statement with a true/false variable:

*if relationshipX = true
… *stats…

Then if the variable is false it won’t show. You can have the variable switch on and off during the story

1 Like
#3

thank you, I’ll work on that.

#4

Hi, I want to do the same thing, could someone show me a piece of script so I can see how this looks in context?

#5

Here you go:

The stuff you need is the bottom bit.

2 Likes
#6

So I’m a bit confused and ive looked everywhere but cant find anything exactly. How do I hide a certain characters like/dislike bar until they are introduced?

#7

You need to create a variable for meeting the character in your startup (as well as a variable for the character’s relationship) and then use an if statement in your stats screen

Stats file:

*if (meet_character)
  *stat_chart
    percent character

Here are some resources you should check out in order to learn to use choicescript:

You can also use the search feature to search through old topics to see if someone else has already asked about the question you have

6 Likes
#8

Ok so i put that over the character name? And what kind of variable would I put in startup? Smething other than their names? And i looked through those a few times and just kept getting confused. Sorry if im causing ay trouble

#9

I’m not sure what you mean. The piece of code above goes in your stats file. The “character” following “percentage” refers to the variable you created to track the MC’s relationship with that character. You can name it anything

*if (meet_character)
  *stat_chart
    Percentage variable_for_character_relationship

If that doesn’t answer your question, you’re going to have to clarify what you want to know

The variable you create for the character’s relationship will be a numerical variable. The meet variable will be boolean

Startup:

*create character_name 0
*create meet_character false
#10

i keep getting an error saying non existant variable meet_character

#11

If you don’t create it, it won’t exist

#12

Ok I got that figured out. One more question. Now how do I make the stat show when they meet the character?

#13

As soon as you *set meet_character true, it will appear in the stat screen if you use the *if statement from before

#14

Awesome! Thanks so much that was really giving me issues!

1 Like