Jump to content
Fisherolol

Stop Experience Gain at X Level Until a Switch is On

Recommended Posts

Something that would be useful for everyone would be a script to stop all experience gains you get as soon as youre at a particuliar level until the switch is on.

 

It would be useful to stop the grinding to make bosses easier and also it would provide a better balance overall in the game by not having overpowered actors.

 

So for exemple there is this switch 130 that will only get on only when you kill a certain boss

Until the switch 130 is on, the level limit in the game is level 30, you cannot be higher until the switch 130 is on.

When the switch 130 is on, you can level normally again until level 40 where there is another boss that keep the switch 140

As long as the switch 140 is on, you cant level more than level 40.

 

l tried this with events already but l had no idea how to stop the xp

everything with google goes negative.

 

Lemme know your questions if l wasn't clear enough.

 

 

Share this post


Link to post
Share on other sites
class Game_Actor < Game_Battler
  alias :change_exp_level_limiter :change_exp
  def change_exp(exp, show)
    case @level
    when 30...40
      return unless $game_switches[130]
    when 40...max_level
      return unless $game_switches[140]
    end
    change_exp_level_limiter(exp, show)
  end
end

 

You can add as many "when"'s to that case statement as you want. Just remember that there are two kinds of ranges:

1..5 (two fullstops) is "One through five" (1,2,3,4,5) while 1...5 (three fullstops) is "One to five" (1,2,3,4).

Share this post


Link to post
Share on other sites

Thanks, l put this below materials and did a battle test on a level 40 character while the switch 140 was off and the switch 130 was on

 

The experience gain stays the same, a monster that gave me over 500k xp made me level to 48

 

since l am the dumbest ever when it comes to scripts but still being able to add lines by copy pasting l wonder what is the difference between

 

when 30...40

 

and

 

when 40...max_level

 

also what is the difference between "one through five" and "one to five"

Share this post


Link to post
Share on other sites

I don't know what which is which, but one of them is

 

[1,2,3,4,5]

 

and the other is

 

[1,2,3,4]

 

If you're comparing 30...40 and 40...max_level it is obvious that the range is different.

Share this post


Link to post
Share on other sites

Sorry for the late reply.

 

For anyone that want to use it, I tested a while ago and seen that you just need to put a number; the level you want it to stop otherwise it dont seem to work or its just because l dont know at all what this is used for.

 

Ill be doing some more tests before asking for a close.

 

Got it, another like for explaining this to me, now closing this

Edited by Fisherolol

Share this post


Link to post
Share on other sites

1..5 (two fullstops/dots/points) is [1,2,3,4,5] or "one up to and including five".

1...5 (three fullstops/dots/points) is [1,2,3,4] or "one up to but not including five".

 

My code does the following:

Before your actor gains experience, my code checks for his level.

If it is included in the range 30..40 and the switch 130 is not set, nothing happens and the method stops.

If it is included in the range 40..max_level and the switch 140 is not set, nothing happens and the method stops.

Otherwise, the actor gains experience as usual.

 

You can add different level and switch requirements by adding further "when" statements just like I did.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×