Stat_chart Text Issue: Text Display

Hi, Everyone!

I’m having trouble with my stat_chart text! I want to display specific sentences that coincide with each stat! So, for example, “You’re healthy!” is displayed when there is 100% Health, and “You’re unhealthy!” is displayed when there is 0% Health. However, I want multiple conditions on the same stat_chart. So, for example, “Health,” “Appearance,” and “Sobriety” are being tracked on the same stat_chart: “You’re healthy!,” (Heath 100%) “You’re sober!,” (Sobriety 100%), and “You’re decent!” (Appearance 100%), too. My percentage bars are working fine, so, that isn’t the issue.

The issue I’m getting is that only my Health text (“You’re healthy!”) is being displayed. I’m new to coding, so, I know I’m missing something obvious, but I just can’t see it. I’ve pasted my startup, stats, and scene code! I’d really appreciate any kind of help/advice!

My code looks like this:


*comment MC HEALTH
*create health ""
*create healthdisplay ""
*create health 100
*create appearance "" 
*create appearancedisplay ""
*create appearance 100
*create sobrietydisplay ""
*create sobriety 100
*create drinker ""


*comment DISPLAY
*if health>=100
    *set healthdisplay "You're healthy."
    *goto stats_start
*if appearance>=100 
    *set appearancedisplay "You're decent."
    *goto stats_start
*if soberiety>=100
    *set sobrietydisplay "You're sober."
    *goto stats_start

*label stats_start
*if ((neutral = false) and (drinker = true))
        text healthdisplay [b]Health[/b]
        percent Health 
        text appearancedisplay [b]Appearance[/b]
        percent Appearance
        text sobrietydisplay [b]Sobriety[/b]
        percent Sobriety


Are you a drinker?
        *set drinker true
        *goto drinker
        *set drinker false
        *goto next 

I’m sorry if I didn’t explain it clearly! If you have any questions, please let me know!


The issue is that you have a *goto stats_start in each of your *if blocks. That means you end up going straight from the “You’re healthy.” display to your percent bars, and you skip over the rest of the conditional checks.

1 Like
The solution to this
*comment DISPLAY
*if health>=100
	*set healthdisplay "You're healthy."
*if appearance>=100
	*set appearancedisplay "You're decent."
*if sobriety>=100
	*set sobrietydisplay "You're sober."
*goto stats_start

Thank you very much!!! See? I knew it was obvious.

Thanks, again!

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