Provides random utilities Actions / Conditions / Expressions for Construct 3, include a Seperate Random Number Generator based on Mersenne Twister
Author: piranha305
Made using CAW
To build the addon, run the following commands:
npm i
npm run build
To run the dev server, run
npm i
npm run dev
Images | Description | Download |
---|---|---|
rng_examples |
Property Name | Description | Type |
---|---|---|
Seed | Seed for the random number generator | text |
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) |
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) |
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 seperated 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 |