Advice on V's Level Up Stats script

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
21,854
Reaction score
11,066
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,136
Reaction score
809
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
21,854
Reaction score
11,066
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 Posts

Latest Profile Posts

The video of a psycho chasing people on the streets with a sword before getting subdued is wild. Apparent screenshots of his Twitter feed before it went private reveal a dangerous delusional mindset. I heard there was a bow person too. The crazies are really coming out of the woodworks.
Stream will be live shortly with some Witcher 3, followed by a session of the Interactive Text Adventure! Feel free to drop by!
Managed to find a way to hang a bed cover over my window. So no more being toasted alive in the afternoon!:kaoswt2:
So, uh, has anyone tried buying any resources from KokoroReflections? Because I've been looking for a 'buy' button on the site for like 10 minutes now and can't find one.
Any also thought it's too cringy to put the word "and you" in your credit as a special thanks?
Cause that's what I thought...

Forum statistics

Threads
97,993
Messages
948,398
Members
129,254
Latest member
Swiftz
Top