Choice

Choices are an integral part of a paragraph. Quite important in a Choice-based game too!

Upon clicking on a choice, the player is lead to a the next predefined paragraph.

Interface

Bellow is the interface - the structure that all choices conform to.

interface Choices {
    id: number;
    choiceCont: string,
    nextid: number;
    precondition?: Precondition;
    style?: string; //next paragraph's appearance's style
    consequence?: Consequence;
}

Required fields

All choices must have:

  • an id that's unique within the scope of the array contain the choice,

  • content that describes the choice

  • and specify the paragraph id - nextid that the choice will lead to.

Optional fields

Choices can have:

  • style - determine update style of the next paragraph lead by the choice.

  • precondition - an array of conditions that must be met prior to the appearance of the choice.

  • consequence - players loose or gain items, increase or decrease a stat to proceed with a choice.

Optional fields are marked with an exclamation mark ? on the interface.

Gaining item through a Choice's Consequence vs picking items up on a Paragraph:

Consequence will lead the player to another paragraph, while picking up an item on a paragraph will not.

Behaviour

Default:

By default, clicking on a choice updates the paragraph to the one with id specifies in nextid field.

Precondition will be checked before the choice appears.

If precondition check fails, the choice will...

  • be greyed out,

  • prevented from performing its default behaviour

  • and reason as to why the check failed will be shown to the player.

If precondition check pass, the choice will perform its default behaviour.

Depends on the author's code, a choice with consequence will do one or all of the following:

  • player loose a specified number of item(s).

  • player gain a specified number of item(s).

  • player loose a specified number of stat points.

  • player gain a specified number of stat points.

  • player gain an entirely new stat and its points.

Consequence does not prevent a choice from performing its default behaviour.

Last updated

Was this helpful?