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

Today I drove through my city of 100,000+ people during rush hour and the streets were nearly empty. Just so I could go get my favorite burger. There a dental assistant (she said that's her other job, even though I didn't ask) took my order and handed me a burger. I know it's bad out there... But wow, she's either atrocious with her money, or "it really be like that".
Chilling out while toodling around someone's painstaking Minecraft recreation of Disneyland. It is mind-boggling and probably as close as I'll ever be to going.
>Testing with fonts change.
>Tries installing a plugin. Doesn't work.
>Tries changing the plugin commands. Doesn't work.
>Tries installing another plugin. Doesn't work.
>Changes a few more plugin commands. Doesn't work.
>Goes directly to the gamefont file and changes the src. Works.

YYEEEAAAAHHHAAAA

Perseverance is key, bois and girls.
What Reviews say on RPG Maker MZ?

Forum statistics

Threads
107,810
Messages
1,032,379
Members
139,956
Latest member
LeoMaguire
Top