Choicescript stats

Is there anyway to add if statements to choice script stats.

For example, let’s say the character had a weapon…

Weapon: Machine Gun
Ammo: 30

Then he switched to a sword

Weapon: Sword
Ammo: 30

Obviously the sword doesn’t have ammo…I tried using an if statement, but it gave an error saying this line should start with percent, text, or opposed pair.

I mean that may be a bad example, like what if the character developed some kind of ability Laser Eyes, Telekinetic strength…essentially is there no way to change what appears on the stats page during the game?

Turns out you can. You just have to place it in the right spot.

You’ve just put the *if on the wrong indentation. I’m assuming your code looks something like:

*stat_chart
  text Weapon
  *if has_ammo
    text Ammo

It should look something like this:

*stat_chart
  text Weapon
*if has_ammo
  *stat_chart
    text Ammo
2 Likes

Oh that is an even better way of doing it. Thank you!