What would you like to learn next?

Random Values in Chapter Changes

Chapter 4 by gene.sis gene.sis

Random values in chapter changes

A chapter can choose a random whole number automatically when a reader enters it, then use that number in later prose, conditions, and choices. Enter an R or D value in Changes to game state instead of a fixed amount. This requires an active game and does not show a roll button in the chapter.

For a reader-controlled button, use Dice Rolls. For a themed choice from authored outcomes, use Random Draws.

Choose an R or D value

R<n> includes zero. D<n> begins at one:

  • R6 chooses 0, 1, 2, 3, 4, 5, or 6.
  • D6 chooses 1, 2, 3, 4, 5, or 6.

In both forms, n is included. Uppercase and lowercase letters work, although uppercase R and D are easier to recognize in a chapter form.

Enter Possible result Variable types When setting an Age
R<n> Choose a whole number from 0 through n, including 0 and n. Number, Percent, Age Choose from 18 through n. Here, n must be from 18 through 150.
D<n> Choose a whole number from 1 through n, including 1 and n. Number, Percent, Age A D value cannot be used to set an Age.

For Number, n may be as high as 100000. For Percent, it may be as high as 100. D0 is unavailable because a D value always begins at 1.

Use random Age changes

Age keeps its usual range from 18 through 150:

  • Set Age to R50 chooses from 18 through 50.
  • Set Age to R18 always produces 18.
  • A D value cannot be used with Set Age, because it could choose a value below 18.
  • Increase Age and Decrease Age can use either R or D; the final age remains within the supported range.

Set, increase, or decrease a value

For a Number variable:

  • Set R3 produces 0, 1, 2, or 3.
  • Starting at 10, Increase R3 produces 10 through 13.
  • Starting at 10, Decrease R3 produces 7 through 10.

When a chapter contains several changes, they happen from top to bottom and each random value is chosen separately. For example:

  • Set D6, then Increase 2 produces 3 through 8.
  • Set D6, then Increase D6 chooses two separate six-sided results and produces 2 through 12. Results near 7 occur more often than 2 or 12.

Use Move Up and Move Down in the chapter form when the order needs to change.

What the reader experiences

The random value is chosen as part of entering the chapter. The reader sees its effect wherever the chapter displays that game value and in any conditions or later choices that use it. The random form itself is not printed in the prose.

Each successful chapter entry is part of the game's saved history. Going Back past the chapter restores the earlier value. Returning through the chapter chooses a new random result.

Limits and combinations

R and D values belong in the structured chapter-change fields. They are not values for reveal, lock, ordering-puzzle, or action syntax.

Use the exact game-variable name and a change allowed by its type. Number, Percent, and Age accept random numeric changes. Text, Dropdown, and Yes/No do not.

Before publishing

Test the chapter with a fresh game and check that:

  1. the smallest and largest possible results fit the intended story;
  2. the correct R or D range is used;
  3. several chapter changes run in the intended order;
  4. Age and Percent results remain in their supported ranges;
  5. going Back and entering the chapter again restores and then replaces the value as intended.
Start your own immersive adult AI roleplay story
Ad

You've reached the end of this Guide topic.

  • No further chapters
Back Start Over View Story Map

2 comments