How to random stats?

J-G

Veteran
Member
Joined
Oct 4, 2019
Messages
604
Reaction score
138
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
604
Reaction score
138
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
604
Reaction score
138
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
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Happy Thanksgiving everyone! What are you thankful for? I'm thankful that I no longer have PTSD, and that I get to enjoy a good meal with my mom and stepdad! It might not be the same as before COVID, but at least I still get to enjoy the holiday!


Made another map, this one even has a cool moving waterfall. I'll have an animated GIF later whenever I'm done adding stuff. :LZSwink:
Back here again?! RPG MAKER, I can't quit you. :kaosigh:
um... why didn't anyone tell how easy it is to add motions to Sideview battlers? I literally copied the last one, changed the name and index, said where it should play, and boom... I've got intro motions.

Forum statistics

Threads
105,543
Messages
1,014,498
Members
137,222
Latest member
THENZNOZ
Top