Hi, I've been struggling with the "change exp" option on the event commands.
Basically, I have an event that according to some decisions, adds or remove exp from the player, the adding part works great by lvling up the player if enough exp is added, but I would like the removing part to not lvl down the player, if being possible, I would like it to work like, if you get enough exp removed to lvl down, you simply remain with 0 exp for that level, as if you just lvl up from the lvl before.
I've tried just using the event commands, using variables with the player lvl and exp, but I can't achieve what I want that way. I've also tried changing the base scripts of the engine, for example, I've found some change_exp definitions, on game_interpreter line 1202, there's this:
and on game_actor line 405, there's this:
Now, I think that I should put an "if" somewhere that basically says something like "if the exp amount removed is enough to lvl down, restart the exp for that level", but honestly I don't know exactly how to do that nor on which of those parts put it, if I have to put it on those parts.
If anyone can tell me any lead or actually know something about this topic, I would appreciate the help, as I feel somewhat lost here really.
Basically, I have an event that according to some decisions, adds or remove exp from the player, the adding part works great by lvling up the player if enough exp is added, but I would like the removing part to not lvl down the player, if being possible, I would like it to work like, if you get enough exp removed to lvl down, you simply remain with 0 exp for that level, as if you just lvl up from the lvl before.
I've tried just using the event commands, using variables with the player lvl and exp, but I can't achieve what I want that way. I've also tried changing the base scripts of the engine, for example, I've found some change_exp definitions, on game_interpreter line 1202, there's this:
#--------------------------------------------------------------------------
# * Change EXP
#--------------------------------------------------------------------------
def command_315
value = operate_value(@params[2], @params[3], @params[4])
iterate_actor_var(@params[0], @params[1]) do |actor|
actor.change_exp(actor.exp + value, @params[5])
end
end
# * Change EXP
#--------------------------------------------------------------------------
def command_315
value = operate_value(@params[2], @params[3], @params[4])
iterate_actor_var(@params[0], @params[1]) do |actor|
actor.change_exp(actor.exp + value, @params[5])
end
end
and on game_actor line 405, there's this:
#--------------------------------------------------------------------------
# * Change Experience
# show : Level up display flag
#--------------------------------------------------------------------------
def change_exp(exp, show)
@exp[@class_id] = [exp, 0].max
last_level = @level
last_skills = skills
level_up while !max_level? && self.exp >= next_level_exp
level_down while self.exp < current_level_exp
display_level_up(skills - last_skills) if show && @level > last_level
refresh
end
# * Change Experience
# show : Level up display flag
#--------------------------------------------------------------------------
def change_exp(exp, show)
@exp[@class_id] = [exp, 0].max
last_level = @level
last_skills = skills
level_up while !max_level? && self.exp >= next_level_exp
level_down while self.exp < current_level_exp
display_level_up(skills - last_skills) if show && @level > last_level
refresh
end
Now, I think that I should put an "if" somewhere that basically says something like "if the exp amount removed is enough to lvl down, restart the exp for that level", but honestly I don't know exactly how to do that nor on which of those parts put it, if I have to put it on those parts.
If anyone can tell me any lead or actually know something about this topic, I would appreciate the help, as I feel somewhat lost here really.

