Advice on V's Level Up Stats script

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
I am using V's Level Up Stats script which can be found here.


A certain number of spend points are allocated every time an actor levels up.  Everything is working as it should.  However, I hit a problem when an actor changes class.


In order to keep the actor at the same level after the class change as s/he was before, instead of reverting to level one, I use a variable to store the actor's EXP.  Once the class has been chosen, I change the EXP to the amount in the variable.  This works as intended.  However, what also happens is that the spend points for all those levels are allocated to the actor again, on top of the ones that have been received in the normal course of playing.  As these changes happen around level 7, the actor gets an extra 20+ points, which effectively breaks the balance.


Can anyone see a way round this?  


Thanks.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
You can do several things to counter this.


1. Restrict the stat point gain on class change. Can be done with scripting.

Code:
  def level_up
    old_level_up546345()
    return if @dont_add_points # <-- Added this line.
    @lvupp += Points_Per_Level
    $game_system.leveling = true
  end

The above code is from V's script.


I made a @dont_add_points instance variable there.


That will be set to true just before you make the class change, and set to false after all is done with the class change.


I don't know how you make the class change, but seeing that you already did it, I assume you know when and where it triggers. That's where you should toggle this instance variable as well.


If your class change is entirely evented, you will need to do some extra work.


First, you will need to allow access to this new instance variable from outside the class. That should be easy, looks like:

Code:
class Game_Actor < Game_Battler

  attr_accessor :dont_add_points

end

Just enter this anywhere in the script editor.


When this is done, you can set it's value from evented script calls too. That works like:

$game_actors[id].dont_add_points = true/false

$game_party.members[index].dont_add_points = true/false

The first one is based on actor ID, while the second one is based on the members' party position.


Just set the value to true for this variable before the class change in the event, and set it back to false after the change.


But I don't know how this stat allocation works. If the allocated points are stored within the actor object, than the above change should be enough. But if it's stored somewhere else which might also reset due to the class change, than further edits will be needed to save the allocated points somewhere else. 


I wrote "several things", but quite honestly, I forgot what else I had in mind. :D  
 
Last edited by a moderator:
  • Like
Reactions: Kes

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
The class change is indeed entirely evented.


I've tested this out and it works to perfection.  It was looking like I'd have to choose between stat allocation or class choice, and now I can continue with both.


Thank you so much.  I much appreciate your help.
 

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

Latest Threads

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,860
Messages
1,017,038
Members
137,567
Latest member
sashalag
Top