Custom stat system in ChoiceScript game - Emmanuel Katto

Hello everyone, My name is Emmanuel Katto. I’m trying to implement a custom stat system in my ChoiceScript game, but I’m having trouble with the syntax. Can someone provide a simple example of how to create and modify stats throughout the story?

Looking forward to your assistance!

Thanks,
Emmanuel Katto

4 Likes

I don’t know what you mean by a custom stat system, but for creating and modifying stats try looking for beginner guides.

1 Like

In addition to loudbeat’s suggestion, here are some specific pages within the beginner guides that will help you:

variable types
data types
displaying variables
stats screen

It would be useful to know what exactly you mean by custom stats, but your stats are pretty much always going to be variables that you *create in the startup file and *set during the game.

*create name " " (string)
*create clues 0 (numeric)
*create honest 50 (numeric, typically for opposed pairs)
*create strength 0 (numeric)
*create has_map false (bool)

Then, during the game, maybe the character tells a lie, finds a clue, and invests a point in strength.
*set name “Ben”
*set clues + 1
*set honest - 10 (or %- 10, if you decide to go with fairmath)
*set strength + 1
*set has_map true

Then, on your stats screen, you display your variables:

Name: ${name}
Clues: ${clues}

*stat_chart 
    text Integrity
    opposed_pair honest
    Honest
    Liar

or

*stat_chart 
    text Integrity
    percent honest

*if (has_map)
    You have a map!
1 Like