Más funciones del motor
Aleatoriedad y tiradas de dados
Usa la aleatoriedad para crear mecánicas de juego y tablas de recompensas.
Por ahora, esta lección solo está disponible en inglés.
You can add random functions to your gameplay, which unlocks the following types of game functionality:
- Random dice rolls of any denomination (e.g. D20, D2, D100)
- Random loot or rewards
- Increasing values by random amounts
So instead of:
You can now do:
Option 1: Dice notation
This turns a value such as affection into a random roll instead of a fixed number. You are making the affection equal to a dice roll.
Example: If you write 1d20, the game picks a number from 1 to 20, and that number becomes affection.
What does it look like?

Option 2: Random between X and Y
This sets a value to a random number in a range, with an optional bonus added. Pick a random number between X and Y, set affection to that, and you can add a fixed bonus on top of it.
Example: If you write a minimum value of 1 and a maximum value of 5, plus 2:
- The game picks a number from 1 to 5.
- The game always adds 2.
- The outcome will always be between 3 and 7.



Option 3: Increase by a random amount
Similar to the previous option, but instead of setting a new score it increases or decreases the player's existing score.

Outcome
After applying any of these options, use a checkpoint or a choice requiring a minimum number of points for a desirable outcome.
Example: You need at least 6 points for the positive outcome "Heal the Love Interest." Position your checkpoint or choice immediately after the random step.
- If the random roll is greater than 6 → positive outcome
- If the dice roll is less than 6 → negative outcome

