Stat screen problem

Okay so my stats screen was starting to get really cluttered so I thought it would be helpful to divide the stats up into specific categories with a choice command in the choicescript_stats file but the problem is that when I try to view it there is the error that says a choice command cannot end without a finish or goto command.

So I went ahead and added the finish command but then I received another error that said the finish command was illegal because any line has to start with “text” or “percent”. The stat screen is still functional but the error message keeps popping up so I’m not sure what to do to fix the issue.

@Polygon123 From the sound of it I’d say it’s an indentation problem, though I’d have to see the code to be sure. Also, when using choice in the stats screen, it’d be better to use *label and *goto.

Post the code, that should help.

@Polygon123 The *finish command essentially tells CS to use the *scene_list in startup.txt to determine the next scene to load, based on the current scene name. Since the current ‘scene’ in this case would be ‘choicescript_stats’ - not a proper ‘scene’ at all - *finish cannot do that.

The error message could be clearer in this instance, but it sounds to me like it’s basically telling you that you cannot use *finish in choicescript_stats.txt. You’ll probably have to work around it using *goto (even if that just uses a *label to repeat the *choice).

Try something like this


*label menu
*choice
  #Personal
    *goto person
  #Professional
    *goto business

*label person
*stat_chart
  text Name
  text Age
  text Gender

*goto menu

*label business
*stat_chart
  text Company
  text Job
  percent staffing_levels

*goto menu

1 Like

If your stat screen has a ton of code/text, you could also use *gosub_scene to break it up.


*label Top_of_page
*choice
  #Personal
    *gosub_scene personal_stats
    *goto Top_of_page

Then just put;


*page_break
*return

Somewhere in the personal_stats scene. The only thing to remember, is that so far, you cannot update variables from the stats screen. It only becomes a temporary change, that will return to its original value when you exit the stat screen.

That did it, thanks for the help guys!