More fun
Want to support CHYOA?
Disable your Ad Blocker! Thanks :)

Chapter 2 by gene.sis gene.sis

Choose the next chapter:

Conditional Branches

You can use variables and conditions to change the outcome of the story, depending on the reader's choices.

  1. setting up Conditional Branches
    To use any of the following features, the story option "Chapters can have conditions" must be enabled. Only Story owner can manage story options. It is possible to check that option later ("Edit Story").
    If you want to know if a story supports Conditional Branches, take a look at the sidebar of any chapter of that story. If there is a "Score"-tab, Conditional Branches is enabled.

  2. possible Variable names
    You can use any combination of letters, numbers, and punctuation marks, except braces ("{" and "}").
    You should not use two or more consecutive "Spaces" because this can cause problems with Conditional Branches - If-Statements. You should not use the same Variable name for different Variable types.
    It is possible to use Immersion Variables as part of Conditional Branches Variables. Please do not use additional braces beyond the necessary braces of the Immersion Variable.
    e.g. Immersion Variable "{your wife}" can be used within Conditional Branches Variable "{your wife}'s Money"

  3. Score
    If a reader chooses "Start Game" from the "Score"-tab, the last savegame will be load or an empty savegame will be created. A savegame can consist of several variables - the "Score".
    The reader can see their actual Score Variables with their values at the "Score"-tab of the sidebar.
    Boolean type variables show a checkmark for "true" and times sign for "false".
    Numeric type variables show their numeric value.
    Progress type variables show their progress value and a blue progress bar.

  4. Variable types
    There are three types of variables available:
    A. Boolean variables (can contain the logical values "true" and "false")
    B. Numerical variables (can contain whole-number values from -100000 to 100000)
    C. Progress variables (can contain whole-number values from 0 to 100)

  5. Score Changes
    You can change the Score of a reader at each chapter.
    Check the chapter option "Changes to the score" to enable Score Changes for the chapter. If you do that the first time, a default variable of type Boolean appears below.

    • You can remove a Score Change by clicking on "-" at the end of the line.
    • You can add a Score Change by clicking on the symbols below the Score Change table. The "check"-sign adds a Boolean variable, "00" adds a Numerical variable and "%" adds a Progress variable.
      Enter the desired Variable name into the "Name"-field, set visibility (see 6. visibility) and adjust the Score Change in the Value column:
      A. Boolean Variable: The "check"-sign sets the variable to "true", the "times"-sign sets the variable to "false"
      B. Numerical Variable: Enter a value in the "Value"-field and choose, if the value should be added ("+") to the variable, subtracted ("-") from the variable or if the variable should be set ("=") to the value.
      C. Progress Variable: Enter a value in the "Value"-field and choose, if the value should be added ("+") to the variable, subtracted ("-") from the variable or if the variable should be set ("=") to the value.
    • You can identify the variable type by:
      A. Boolean: the "check"/"times"-signs
      B. Numerical: the "+"/"-"/"="-signs without a "%" behind the value
      C. Progress: the "+"/"-"/"="-signs with a "%" behind the value
    • If the field "Name" or "Value" (only Numerical and Progress Variables) is empty, the Score Change won't be stored.

    If you use "+" or "-" on a variable that doesn't exist in the reader's score, the value will be added to or subtracted from 0.
    Calculated values above the maximum will be set to the maximum. Calculated values below the minimum will be set to the minimum.

    Please note, that the Score Changes will be processed before sending the Chapter with the reader's Score. The reader will see the updated Score in the sidebar and Conditional Branches - If-Statements and Conditional Branches - Show Variable Values will use the updated Score.

  6. visibility
    You can set and the visibility of Conditional Branches Variables.
    You can find the button to adjust the visibility of a Variable directly behind the Variable name of the Score Change.
    There are three options:

    • No Change (sign with two squares on top of each other): The Variable inherits its own visibility from the previous Score Change. If it is the first time a Variable is set, the Variable will be visible.
    • Visible (eye): If you choose this option, the reader can see the Variable in the "Score"-section of the Sidebar.
    • Hidden (ban sign): If you choose this option, the reader can't see the Variable in the "Score"-section of the Sidebar.

    You can change the visibility of a Variable within each chapter. This way you can show a Variable if the reader should know the value and can hide it if the information is not needed anymore.
    After introducing a Variable with a certain visibility, it is usually enough to use "No Change" for the following chapters. This way you only have to change one chapter if you decide to change the visibility later.

    When an author/editor of a chapter browses the story, they can use the spoiler button behind "Hidden Variables" in the "Score"-section of the sidebar to show the Hidden Variables.

  7. Conditions
    You can use Conditions to determinate if a reader can access a chapter, depending on his Score.
    Check the chapter option "Conditions to view this chapter" to enable Conditions for the chapter. If you do that the first time, a default variable of type Boolean appears below.

    • You can remove a Condition by clicking on "-" at the end of the line.
    • You can add a Condition by clicking on the symbols below the Conditions table. The "check"-sign adds a Boolean variable, "00" adds a Numerical variable and "%" adds a Progress variable.
      Enter the desired Variable name into the "Name"-field and adjust the Conditions in the Value column:
      A. Boolean Variable: Choose the "check"-sign if the reader's Score has to be "true" or the "times"-sign if the reader's Score has to be false.
      B. Numerical Variable: Enter a value in the "Value"-field and choose, if the reader's Score has to be less than ("<"), greater than (">") or equal to ("=") the entered value.
      C. Progress Variable: Enter a value in the "Value"-field and choose, if the reader's Score has to be less than ("<"), greater than (">") or equal to ("=") the entered value.
    • You can identify the variable type by:
      A. Boolean: the "check"/"times"-signs
      B. Numerical: the "<"/">"/"="-signs without a "%" behind the value
      C. Progress: the "<"/">"/"="-signs with a "%" behind the value
    • If the field "Name" or "Value" (only Numerical and Progress Variables) is empty, the Condition won't be stored.

    If a variable used in a Condition isn't present in the reader's score, the chapter isn't accessible.

  8. If-Statements
    You can use If-Statements to manipulate the chapter text, depending on the reader's Score.
    See Conditional Branches - If-Statements for further information.

  9. Invisible Choices
    You can hide Chapters from the Chapter answers which are inaccessible due to the reader's Score.
    Uncheck the story option "Show inaccessible chapters" to hide inaccessible chapters when Game Mode is active.

_

Want to support CHYOA?
Disable your Ad Blocker! Thanks :)