Skip to content

New extension: Pseudo random #1644

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks done
Jurfix opened this issue Apr 5, 2025 · 0 comments
Open
3 tasks done

New extension: Pseudo random #1644

Jurfix opened this issue Apr 5, 2025 · 0 comments
Labels
✨ New extension A new extension

Comments

@Jurfix
Copy link
Contributor

Jurfix commented Apr 5, 2025

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

@Jurfix Jurfix added the ✨ New extension A new extension label Apr 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ New extension A new extension
Projects
None yet
Development

No branches or pull requests

1 participant