Articles on: Blocks Creator
This article is also available in:

πŸŸ₯ Random path

πŸŸ₯ Random path



The Random Path block allows you to draw a path from several possibilities to introduce variability and replayability into a story. Great for creating unpredictable events like random encounters, rewards, or obstacles.


This block is particularly useful for simulating non-deterministic choices, such as opening a chest or meeting a character whose behavior varies each game.


πŸ“₯ Entries


  • in (Flow): Triggers the draw when the flow reaches this block.
  • number (Number): Number of possible paths from which the block will choose randomly (default: 2).
  • draw without replacement (Boolean): If activated (True), the block memorizes the paths already taken and excludes them until all have been used at least once.


πŸ“€ Outings


  • 1, 2, 3... (Flow): Numbered outputs corresponding to the possible paths (their number depends on the value of number). Only one output is activated randomly.
  • shuffleEnd (Flux): Exit triggered only if "shuffleend" mode is enabled and all paths have already been taken at least once.


πŸ’‘ Example of use


Scenario: Opening a mysterious chest


  1. The player finds a chest in a dark room.
  2. A message is displayed: "You open the trunk carefully...".
  3. The Random Path block is placed with number = 3 to simulate three possible outcomes.
  4. The block randomly chooses an output:
  • Exit 1: "The chest contains 100 gold coins!" (reward).
  • Exit 2: "A trap is triggered! You lose 20 VP." (danger).
  • Exit 3: "The trunk is empty..." (disappointment).
  1. The flow continues to the event corresponding to the selected output.


βš™οΈ Technical Details

  • Path management: Outputs are generated dynamically based on the value of number. If number = 2, only outputs 1 and 2 will be available.
  • "Draw without replacement" mode: When this mode is activated, the block uses an internal list to follow the paths already taken. Once all paths are used, the shuffleEnd output is triggered.
  • Reset: The block does not automatically reset its state between game sessions. For a complete new draw, disable then re-enable "no reset draw" mode.

Updated on: 04/03/2026

Was this article helpful?

Share your feedback

Cancel

Thank you!