Skip to content

New extension: Pseudo random #1644

@Jurfix

Description

@Jurfix

Description

Set seed to generate pseudo-random numbers in sub-events.

This extension will be useful for:

  • Re-creating a randomly generated level.
  • Debugging everything related to randomness in your game.
  • Use in multiplayer so that all players have the same random event without having to synchronize its components.

How to use the extension

How to use:

  • Put the action "Set seed" with a specific seed in the form of a number, for example "1", then all expressions and conditions of randomness in subevents will give the same result (each expression and condition separately) until you change the seed, meaning the expressions Random(), RandomInRange, RandomFloat() etc. and the condition "Pick a random instance".

Example:

  1. Create a new event with the condition "At the beginning of the scene" and the action "Set seed" and the seed equal to "1".
  2. Create a sub-event with the action "Log message" and the message "ToString(Random(100))+";"+ToString(Random(100))+";"+ToString(Random(100))".
  3. Look in the console and you will see that the result at each restart will be equal to "17;21;53" until you change the seed.

Checklist

  • I've followed all of the best practices.
  • I confirm that this extension can be integrated to this GitHub repository, distributed and MIT licensed.
  • I am aware that the extension may be updated by anyone, and do not need my explicit consent to do so.

What tier of review do you aim for your extension?

Community (Unreviewed)

Example file

PseudoRandomExample.zip

Extension file

PseudoRandomExtension.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions