Control Variable to Specific Random Numbers

mylafter

I’m a creep... I’m a weirdo...
Veteran
Joined
Dec 30, 2012
Messages
195
Reaction score
174
First Language
English
Primarily Uses
N/A
Randomizing a variables' value can only be set from, for example '1-9'.
Is there a way to control a variable to equal to a random specific set of values like; '1, 2, 5, or 7'
 

A-Moonless-Night

WINTER IS COMING
Veteran
Joined
Mar 17, 2012
Messages
675
Reaction score
437
First Language
English
Primarily Uses
RMVXA
You can do $game_variables[X] = [1, 2, 5, 7].sample, where X is the ID of the variable. Alternatively, in the 'Control Variables' section, set it to script and use [1, 2, 5, 7].sample
 

mylafter

I’m a creep... I’m a weirdo...
Veteran
Joined
Dec 30, 2012
Messages
195
Reaction score
174
First Language
English
Primarily Uses
N/A
You can do $game_variables[X] = [1, 2, 5, 7].sample, where X is the ID of the variable. Alternatively, in the 'Control Variables' section, set it to script and use [1, 2, 5, 7].sample
Thank you! The second option is definitely more convenient to use.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Released a spider. Looked deadly.
I’ll just assume it was deadly. Bravery, people.

The hero compassionately saves the frightful beast of unknown persuasions. Did it feel gratitude or fear? Nevertheless, the hero sees their good deed in the darkest shadows of the night, wondering if each would be the one to repay them with an unknown demise.
Success, my character has harnessed the power of the particle, and now she leaves a speed streak.:kaopride:



I'm breaking up with QSprite. :kaolivid:
Ami
--- Spoiled Food ---

M.Knight: Oh,no! the Bread has been Mold!
Chef: It's not Mold,it's in Fermentation.
M.Knight: Are you sure?
Chef: Y'know Cheese? It's safe to eat
(Chef eat the Moldy Bread,after that he take into the Hospital with Green Face)
Suddenly I remember the days when I create something just by pure wild imagination. I wasn't thinking about concept, structure, or anything else. Just create (even if it's unfinished in the end). Somehow I kinda want to have that wild imagination again. :D
Google "The Great Stink"
Enjoy.

Forum statistics

Threads
104,335
Messages
1,005,642
Members
135,849
Latest member
drtreaven
Top