On changing the color of the percentage bars

Instead of just red, is it possible to have it be green, yellow, blue, and so on?

It would add functionality for displaying stats such as health, magic, xp, stamina, etc. Plus, a little bit more color shouldn’t hurt.

1 Like

You could change the colour of all of them in style. css, but changing them individually isn’t currently possible.

1 Like

You can see here how to customize your percentage bar colors. But as @CJW said, customizing each is indeed not possible yet.

I’m very new to ChoiceScript but I’ve decided to just get hands-on with testing code so that I can get familiar with it. I’ve found a lot of very handy resources on the forum thankfully which has helped me get the gist of scenes and some variable coding, but I was wondering if there is a way to customise the colour of the statscreen bars rather than the pink/purple combo that is the default?

If it helps, the code at the moment for the stats is like so:

*label stats
[b]Stats[/b]

*stat_chart
opposed_pair muscle
Strong
Weak
opposed_pair stealth
Cautious
Reckless
opposed_pair will
Brave
Frightful
opposed_pair soul
Heart
Mind
percent humanity

I also don’t know how much I should be using labels at the moment, I’m kind of slapping them above every new kind of code (eye and hair colour, hair style, gender, etc).

Much appreciated! :slight_smile:

1 Like

I think this has been answered already.

In the “Style.css”

Stat bar background color
By default, the background color of the stat bar is gray when there is no opposing pair to a displayed stat. To change this, find the line:

.statBar { background-color: #949291; […] }
If we change #949291 to #00b359, which is a green color, this is how the bar will look:
StatDisplay2

On another note. Did you know that you can also change it on the fly using the <script></script> tag

Edit: Ninja’d by @Loudbeat

1 Like

How do you do it with <script> tag? O oh, does this means it’s possible to have, say, 3 stat-bars of different color on a single page?

2 Likes

Last time I checked they said we can create a JavaScript function who mess with the CSS and call it midgame using the <script> tag.

Although I never tried. So I may have miss interpreted something along the way…

Oh nice! Thank you! :slight_smile:

Would you also happen to know how (or if it’s possible?) to make that work for ChoiceScript IDE? That’s the broswer program thing I’m using rn to learn.

Ah thank you! I’m still getting used to the search function on the forums here so I hadn’t noticed that one, thank you for the link!

Find style.css file somewhere in your .../web/mygame/ directory. You can edit it with simple text editor such as Notepad (for Windows), or go fancy with Notepad++ like I do.

2 Likes

Afraid not, CSIDE doesn’t expose its internal copy of ChoiceScript to the user, by design. CoG doesn’t support most of these kinds of modifications, thus neither does CSIDE (lest it encourage creation of games that aren’t likely to be published).

2 Likes

@CJW Because I was looking to play with “Buttons and Backgrounds” [in a good way!] does "CoG doesn’t support … " mean that nothing on this page is a good idea?

Thanks for any advice.

Oh and @Nahim_Kerman and FAI that *script tag

1 Like

It’s more like CoG encourages you to not modify any parts that already there in the CS package. If you really have to do some changes, you have to give them a good reason for them to let you do that.

I had style.css modifications for Fallen Hero, never had any questions as to why.

8 Likes

Hey all, just wondering if changing the percentage bar is still only do-able with changes to the style file? I need to change the bar colour for game immersion, and can do it this way (and I’m thinking that’s the only option), but thinking COG would prefer the internal folders not to be changed about if there’s another alternative? Wasn’t there a game released that had multiple coloured stat bars? (Or am I daydreaming) Thanks :slight_smile:

Fallen Hero had changed colors in the bars! It is a very simple fix, I just provided CoG with the color code and where it should be applied in the CSS and they arranged it for me.

6 Likes

Choice of Magics did that. Gold just custom-coded the colors using *script commands.

1 Like

Cool, cool :slight_smile: I’m not sure I know what I’m doing there so I might just stick to the one stat bar colour change with is mostly sufficient anyway. Was hoping there might be a with around without having to fiddle with the source code, but will do that.