FANDOM


    The *stat_chart command is able to display variables easily and in several different ways. This command is usually used in your choicescript_stats.txt file, which governs the display of the Stats Screen and may be found in the "scenes" (..mygame\scenes) folder, but it can also be used in any ordinary scenes if required. There are no limits to how many times this command can be used in a single file.

Displaying stats Edit

Let's say you have three variables: the "name" string variable containing the name of the player-character; the "intelligence" numeric variable containing a number from 0 to 100; and the "wisdom" numeric variable, also a value between 0 and 100. This is how they might be used within a *stat_chart for display purposes:

*stat_chart
    text name
    percent intelligence
    percent wisdom

Which will display as:

Stats

But what if you wanted your stat names to be capitalized in different ways? Simply type those variable names exactly as you want them to appear, so that you might end up with something like this:

*stat_chart
    text NAME
    percent Intelligence
    percent wIsDoM

Which will display as:

Stats2

But let's say you wanted "Intelligence" to be called "Cleverness", but don't want to change the actual variable's name. Anything added to the line after the variable itself becomes the new wording for the chart, so you can type:

*stat_chart
    text name
    percent intelligence Cleverness
    percent wisdom

Which will display as:

Stats3

Note that this works with multiple words too.

Displaying opposed pairs Edit

But let's say you wanted to write something at the end of a stat bar. For example, if you wanted to make an opposed pair out of intelligence and stupidity. Simply change the percent line to opposed_pair and add another line, indented one more level, and the text intended to be displayed opposite the variable. So something like this:

*stat_chart
    text name
    opposed_pair intelligence
        stupidity
    percent wisdom

Which will display as:

Stats5

Note that there is no actual "stupidity" variable; that is just text being displayed at the end of that stat bar.

In opposed pairs you can also make the variable "intelligence" display as "Cleverness" instead, for example:

*stat_chart
    text name
    opposed_pair intelligence
        Cleverness
        Stupidity
    percent wisdom

Displays as:

Stats7

Note Edit

Any numeric variable used for displaying a percentile bar within a *stat_chart should not be allowed -- as a result of scripting elsewhere -- to fall outside the 0-100 range, otherwise, it will have an adverse effect on the appearance of a percentile bar.

For example, if "intelligence" is set to 150, the bar will look like this: StatBar150percent

There are two ways to make sure this never happens. The easiest is to use the Fairmath system, which makes it harder to increase high stats and decrease low stats. Using fairmath ensures the stats will always stay between 0 and 100.

If you do not wish to use fairmath, it is possible to make sure the stats are capped at 100 by calling a subroutine with the *gosub command every time a stat is modified in the game. This technique is easy to set up for each scene, and is described on the *gosub page.


More commands
Choice *choice, *fake_choice, *disable_reuse, *hide_reuse, *allow_reuse, *selectable_if
Variable *create, *temp, *set, Arithmetic operators, *delete, *input_number, *input_text, *print, *rand
Conditional *if, *elseif, *else
Goto *label, *goto, *goto_scene, *goto_random_scene, *gosub, *gosub_scene, *finish
Formatting Bold text, Italic text, *image, *line_break, *page_break, *link, *stat_chart
Miscellaneous *comment, *scene_list, *title, *author, *achieve, *achievement, *check_achievements, *bug, *ending, *more_games, *share_this_game, *show_password, *script

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.