How to random stats?

J-G

Veteran
Member
Joined
Oct 4, 2019
Messages
616
Reaction score
145
First Language
English
Primarily Uses
RMMV
So I want to make a common event that will grant a total of 100 random stats from atk, def, m.def, m.atk, luck and agility.
So it will randomly give any number of stats from those 6 until it reaches an accumulated total of 100.
I know I have to tie a variable to each stat but apart from that I'm lost.
Not sure how to go about the rest to make sure it doesn't go over the sum total of 100 or even go about getting it to be random.

Anyone have any idea?
 

rechronicle

Mystvaldia
Veteran
Joined
Oct 30, 2013
Messages
137
Reaction score
109
First Language
Bahasa
Primarily Uses
RMMV
You just need to count, make 'isItAHundredAlready?' var or something like that.
When you randomly add 3 ATK stat, add 3 to the var.
When you randomly add 5 LUK stat, add 5 to the var.
And so on.
Then do a conditional branch the var if isItAHundredAlready? >= 100.

Voila!
 

J-G

Veteran
Member
Joined
Oct 4, 2019
Messages
616
Reaction score
145
First Language
English
Primarily Uses
RMMV
You just need to count, make 'isItAHundredAlready?' var or something like that.
When you randomly add 3 ATK stat, add 3 to the var.
When you randomly add 5 LUK stat, add 5 to the var.
And so on.
Then do a conditional branch the var if isItAHundredAlready? >= 100.

Voila!
Would using a range for variables that have that, work doing random? Since var 1-6 are my stats.
 

rechronicle

Mystvaldia
Veteran
Joined
Oct 30, 2013
Messages
137
Reaction score
109
First Language
Bahasa
Primarily Uses
RMMV
Hmm, it should work fine, add var 1 to 6, check if the sum of it all is 100, then you can stop adding more stats to them. No more need a new variable to count.
 

J-G

Veteran
Member
Joined
Oct 4, 2019
Messages
616
Reaction score
145
First Language
English
Primarily Uses
RMMV
Okay thanks. I'll give it a shot n see if I can set it up properly lol if not I'll be back
 

Latest Threads

Latest Posts

Latest Profile Posts

Ami


Imagine you (as Miner) Sleep in the Cave,the other side is a Bunch of Golds,how d'you feel?
finally got footage of my main character running around his corrupted street...
I finally got the ships and water to flow like I wanted to~ the canals are a success. Now to loop the animation for the kites. So many kites.
Bendyizzt wrote on staggqueen's profile.
Hello Newcomer...

Forum statistics

Threads
107,694
Messages
1,031,493
Members
139,819
Latest member
KirbDog
Top