# Percent stat_chart on startup cene or the other scene

I search it up and no result!

I’m currently writing my battle codes, and I want my battle scene to have the percent bar appear, not only on the Status Screen.

This is the example:

``````startup.txt
*create maxhp 200
*create currenthp 175
*create hp ((currenthp/maxhp) * 100)
*set hp round(hp)

(still in startup.txt)
Yourself:
HP: \${currenthp} / \${maxhp}
[ hp ] <- hp bar here
``````

Now, the calculation:
hp = 175 / 200 = 87.5 ≈ 88
So hp bar should be 88%

I’m just curious if there is a code to this. Or if there is, what should I type to have a percentage bar on a scene? If it’s not possible then it’s okay.

Thanks as always!

I’m pretty sure that a `percent bar` can never be over 100. So your 200 would just show as 200%.

And yes, you can put a `*stat_chart` on the main screen.

1 Like

That’s true; it can’t be over 200. But,The `currenthp` and `maxhp` won’t be the `percent bar`.

I’m using another var (`hp`) to a max of 100. As the calculation, `hp` is equal to `currenthp` over `maxhp` times 100, so the `percent bar` won’t exceed 100, and that’s where the bar is.

Do I only have to write `*stat_chart` and put the `text` or `percent` there?

That’s right, just put it there like you would in a stat screen.

3 Likes

It worked! Fact, I didn’t try it before, dumb me. Sorry for the stupid question, and thank you for your help!

@moderators, please close the topic! Thank you!

4 Likes

Np bud.

And the topic will automatically close in 24hour, but if you really want it closed now, just tag `@moderators`.

3 Likes