Random stat distribution at level up

Darkfire1408

Novice
Veteran
Joined
Jan 7, 2015
Messages
33
Reaction score
4
First Language
English
Primarily Uses
Well, I was playing Shining Force and I was wondering how I could go about making a random stat distribution like that game has at level up. If you haven't played it, when you level up, all of your stats increase by a rough range of 0-5. With this you can have some sucky level ups like 1 speed, and some awesome level ups like 5 Attack, 2 Defense, 3 Speed, 4 HP, and 5 MP. I've looked around and I can't seem to find anything about this on the forums. Does anyone have any ideas?
 

Celianna

Tileset artist
Veteran
Joined
Mar 1, 2012
Messages
10,557
Reaction score
5,592
First Language
Dutch
Primarily Uses
RMMV
Well you could simply do it yourself by randomizing a variable (say 1 through 5), and then using that variable to 'change parameters', and choose the 'increase' option.


Of course, this has to happen when the player levels up (you can also check this with variables). Have you tried out the Variables Guide?
 

Darkfire1408

Novice
Veteran
Joined
Jan 7, 2015
Messages
33
Reaction score
4
First Language
English
Primarily Uses
I'm still fairly new to VX Ace but I know how to use variables pretty well. It's just making it happen at level up that's the issue.
 

Celianna

Tileset artist
Veteran
Joined
Mar 1, 2012
Messages
10,557
Reaction score
5,592
First Language
Dutch
Primarily Uses
RMMV
Run a common event (parallel process), and check to see if the player has leveled up by setting a variable to the player's level. To see if the player has leveled up, you must set a variable to 1 in the beginning of the game (this is a one-time event only). Then, have the common event check to see if that variable is lower than the player's current level (which means they leveled up). If yes, add the random stat distribution, and set the player's current level to the other variable so that the process can continue.


Add a 10 frame wait command in there so that it doesn't lag your game.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
Celianna's solution will work okay, but you will have some quirks, such as needing extra eventing to detect if a character has leveled up multiple times, and only being able to run the event once the player is back on the map after a battle.  It's a good evented solution, so it will get the job done if you think through all the possibilities, but it's a bit clumsy and inefficient.

This kind of thing would be pretty easy to script from a functionality point of view.  You just alias the level_up method in Game_Actor to add lines like add_param(3, rand(6).to_i), which would add 0-5 DEF to the character when they level up.  If you don't do any scripting yourself, this is probably something that a scripter would be willing to make for you in RGSS Requests.
 

Darkfire1408

Novice
Veteran
Joined
Jan 7, 2015
Messages
33
Reaction score
4
First Language
English
Primarily Uses
Thanks, but I'm wanting to try my hand at a commercial game so I can't use your script.
 

Pianotm

The TM is for Total Menace
Member
Joined
Nov 10, 2013
Messages
20
Reaction score
14
First Language
English
Primarily Uses
RMVXA


Yeah...this only adjusts parameters based on what's set in the script and completely ignores the values set in your note tags, meaning, yes, I can make it so that my character's parameters advance randomly at level up, but all of the characters have to use the the same min max values.  Unless, this  <rpg: par_id, gain, min, max> isn't the right note tag.  Put whatever you want in the gain, min, and max spots.  It won't work.  It'll only read the par_id, and then plug in whatever's in the script default settings.  I wish I could find Tsukihime's Parameter Levels.  I've been looking for days.
 
Last edited by a moderator:

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,575
Latest member
akekaphol101
Top