Changing Pov stats menu

I read some Choice games and I noticed the stats menu changed anytime the character being used changed, like in Champion of the gods. Can someone explain to me how that works

1 Like

You make a variable that indicates pov.

Example: pov = true

Then you use *if statements on the stats page to determine which set of stats are shown.

Example:

*if pov = true
     stats set one
*else
     stats set two

You’ll need to correct the spacing, but this is the basics.

3 Likes

There’s a tonne of this in my story TDUP.

I do it like this:

*if (new_character_pov = true)
  *goto new_character_stats
...
*label new_character_stats

Stats

*goto end_stats
5 Likes

In my scenario I don’t necessarily want to switch between characters. I want a specific set of stats to take over the screen so to speak. cAN i STILL APPLY THIS SAME LOGIC?

Can you explain your use case more clearly? Yes, that should work though, since all you’d have to do is set character_1 true.

One small note though, is that rather than make it a boolean I’d probably do it as a string. *create pov 1 and then set it in your scene. Then on the stats screen

*if pov=1
  Stats. 
*elseif pov=2 
  Stats
Else 
  stats

This will work better in cases where you only want one pov stats to be active at a time. If you potentially want multiple stat sections active at once, go with the boolean methods outlined in the above comments. I could potentially see a situation where multiple povs were set as true that weren’t meant to be, which might be a little harder to track down than only having 1 active stat block at any given time.

2 Likes

Yes.

The variable names and labels are irrelevant; the structure of that code is one simple way of doing it.

At the end of each section, put

*goto end_stats

and then make the last line of choicescript_stats be

*label end_stats

and you won’t have any overlap. It’ll go to the first boolean that’s true and skip the others. You can also put in

*if (variable_that_is_not_supposed_to_be_true = true)
  *bug Variable that is not supposed to be true is true.

You should generally have bug reports like this throughout your code anyway, or at least be extremely confident in how you’ve set out your variables.

3 Likes

Is anything going to be under the label

1 Like

No, the point is that it’s right at the end. If you’ve got something else you want at the end, you can stick it there I guess.

Thanks

Thanks a lot guys @Eiwynn @will @tangerine_skies. You’ve been a big help :raised_hands:t6: :smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.