
RNG Plugin (Construct3)
A downloadable asset pack
Download NowName your own price
RNG Plugin
This Construct 3 plugin offers a comprehensive suite of utility functions centered around randomness. It includes a dedicated random-number generator based on the Mersenne Twister algorithm
Current Features
- Rolling of various n-sided dice
- Random string generation
- Pick random from comma-separated string (weighted / unweighted)
- Chance condition
- Generate Random Positions (layout, viewport, sprite, circle)
- Perlin / Simplex Noise
- SDK v2
Properties
Property Name | Description | Type |
---|---|---|
Seed | Seed for the random number generator | text |
Actions
Action | Description | Params |
---|---|---|
Clear Dice Roll History | Clears the dice roll history | |
Roll Dice | Rolls a number of dice with a number of sides and adds a modifier | Number of Dice (number) Number of Sides (number) Modifier (number) Tag (string) |
RandomSeed | Generates a random seed | |
SetSeed | Sets the seed to use for the RNG | Seed (string) |
Pick Random Point In Circle | Picks a random point in a circle, can access using RandomX and RandomY expressions | Center X (number) Center Y (number) Radius (number) Edge (boolean) |
Pick Random Position In Layout | Picks a random position in the layout, can access using RandomX and RandomY expressions | |
Pick Random Position In Layout With Margin | Picks a random position in the layout with a margin, can access using RandomX and RandomY expressions | Left (number) Right (number) Top (number) Bottom (number) |
Pick Random Position In Rect | Picks a random position in a rectangle, can access using RandomX and RandomY expressions | Left (number) Top (number) Right (number) Bottom (number) |
Pick Random Position In Sprite | Picks a random position in a sprite, can access using RandomX and RandomY expressions | Sprite (object) Edge (boolean) |
Pick Random Position In Viewport | Picks a random position in the viewport, can access using RandomX and RandomY expressions | |
Pick Random Position In Viewport With Margin | Picks a random position in the viewport with a margin, can access using RandomX and RandomY expressions | Left (number) Right (number) Top (number) Bottom (number) |
Conditions
Condition | Description | Params |
---|---|---|
For Each Rolled Dice | Triggered for each dice rolled | |
On Dice Roll | Triggered when a dice is rolled | |
Chance | if a random chance is true | Likelihood (number) |
Expressions
Expression | Description | Return Type | Params |
---|---|---|---|
DiceRollDiceId | Get the dice id of a dice roll | string | Tag (string) |
DiceRollModifier | Get the modifier of a dice roll | number | Tag (string) |
DiceRollSum | Get the sum of a dice roll | number | Tag (string) |
DiceRollValue | Get the value of a dice roll | number | Tag (string) Index (number) |
LastDiceRollDiceId | Get the dice id of the last dice roll | string | |
LastDiceRollDiceValue | Get the value of a dice in the last dice roll | number | Index (number) |
LastDiceRollModifier | Get the modifier of the last dice roll | number | |
LastDiceRollSum | Get the sum of the last dice roll | number | |
LoopDiceValue | Get the value of the dice in the loop | number | |
PerlinNoise2D | Get a 2D Perlin noise value | number | X (number) Y (number) Resolution (number) |
RandomChoice | Get a random choice from a list | any | List (string) |
RandomChoiceWeighted | Get a random weighted choice from a list | any | List (string) Weights (string) |
RandomFloat | Get a random float | number | Min (number) Max (number) |
RandomInt | Get a random integer | number | Min (number) Max (number) |
RandomNormal | Get a random number from a normal distribution | number | Mean (number) Standard Deviation (number) |
RandomNumber | Get a random number | string | Length (number) |
RandomSign | Get a random sign (-1 or 1) | number | |
RandomString | Get a random string | string | Length (number) |
RandomToken | Get a random token | string | List (string) |
RandomUUID | Get a random UUID | string | |
Shuffle | Shuffle a comma separated list | string | List (string) |
SimplexNoise2D | Get a 2D Simplex noise value | number | X (number) Y (number) Resolution (number) |
Seed | Get the seed used for the RNG | number | |
LastX | Gets the last random X position | number | |
LastY | Gets the last random Y position | number |
Links
Updated | 18 days ago |
Status | Released |
Category | Assets |
Author | Piranha305 |
Tags | c3, construct-3, construct3, plugin, random, rng |
Download
Download NowName your own price
Click download now to get access to the following files:
piranha305_rng-2.0.0.1.c3addon 12 kB
rng_examples.c3p 181 kB
Development log
- RNG v1.0.0.3Sep 06, 2023
Comments
Log in with itch.io to leave a comment.
With this addon can you assign a chance at which a certain item or number will fall out?
Thank you for your work
I think there is a weighted expression, you might need to convert the data type but for examples you can use
.RandomChoiceWeighted("1,2,3,4,5,6,7,8,9,10", "1,1,1,1,1,2,2,2,3,3")
this will pick a number between 1 and 10
with 9,10 being 3x more likely to be chosen
6,7,8 being 2x more likely to be chosen
and 1,2,3,4,5 being the least likely to be chosen
if this is not what you are looking for let me know more details about exactly what your looking and I can add something for it.