• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • The Eevee Expo Game Jam has concluded! 🎉 Head on over to the game jam forum to play through the games.
    Don't forget to come back September 21st to vote for your favorites!
  • Reminder: AI-generated content is not allowed on the forums per the Rules and Regulations. Please contact us if you have any questions!
Resource icon

Resource Automatic Level Scaling 1.6.3

Oh, this is the argument formatting for AutomaticLevelScaling.setTemporarySetting, try using AutomaticLevelScaling.setTemporarySetting("updateMoves", false) (on camelCase) or AutomaticLevelScaling.setSettings(update_moves: false).
Ah, makes sense. Thank you very much. Absolutely love the work you've done here by the way.
 
Is there a way to edit this feature to work on a fixed scale? Example: I want the levels of trainers and wild encounters to go up exactly 10 levels after defeating each gym. Is there a way to use a variable for this or something? I feel like this would be much easier than going through each trainer and making separate teams for each gym badge.
 
Is there a way to edit this feature to work on a fixed scale? Example: I want the levels of trainers and wild encounters to go up exactly 10 levels after defeating each gym. Is there a way to use a variable for this or something? I feel like this would be much easier than going through each trainer and making separate teams for each gym badge.
for this you can use level caps ex lol
 
I thought that plugin only enforced level caps, but didn't actually change trainer levels to match it? I'm not seeing anything in that plugin which would do that.
My mistake, I misread something.
 
I am using Automatic Level Scaling, and I am currently having config confusion, on how to setup a 1:1 Level Scaled setting. This is for the Battle Mode section of my game, and to save myself, from having to make at least 12 Dedicated Entries in trainers.txt, for just 1 trainer battle in Battle Mode. 3 for Battle Formats, 3 for Inverse Battle Formats, and 3 for Lvl.5, Lvl.50 and Lvl.100. What do I need to configure in Automatic Level Scaling, so it has the same effect as pbBalancedLevel($player.party)?

a9pfKCK.png

Djbz1RU.png

aFVJgPt.png

Ht3lAnP.png
 
I am using Automatic Level Scaling, and I am currently having config confusion, on how to setup a 1:1 Level Scaled setting. This is for the Battle Mode section of my game, and to save myself, from having to make at least 12 Dedicated Entries in trainers.txt, for just 1 trainer battle in Battle Mode. 3 for Battle Formats, 3 for Inverse Battle Formats, and 3 for Lvl.5, Lvl.50 and Lvl.100. What do I need to configure in Automatic Level Scaling, so it has the same effect as pbBalancedLevel($player.party)?

a9pfKCK.png

Djbz1RU.png

aFVJgPt.png

Ht3lAnP.png
Just finished trouble shooting the problem myself. Levels are not scaling in the way I want, but I now know the plugin is working, and there is no conflict with other plugins. After checking again the setup,I was able to get the Plugin to have an effect. Here is what has changed:
hYSjbTz.png

AcLSvMT.png

WjQB7Is.png

nQeovsD.png

ATds7hw.png
 
Is there a way to edit this feature to work on a fixed scale? Example: I want the levels of trainers and wild encounters to go up exactly 10 levels after defeating each gym. Is there a way to use a variable for this or something? I feel like this would be much easier than going through each trainer and making separate teams for each gym badge.
I think you should consider using both this plugin and a level caps plugin, because some other rom hacks and fan games do it this way (usually those that are more battle-focused), so players are already familiar with the system. But if you only want to lock the opponents' levels, I'll give you some options.

For the first step, you'd need a game variable that stores the number of gym leaders defeated (in these examples, I'm using game variable 10). Then, in the 005_Class_Overrides.rb file, you can change a method called scale, in the Pokemon class (line 27):

If you want to simply set the level to be exactly 10 + 10 times the number of gyms defeated, you can change it to look like this:
Ruby:
Expand Collapse Copy
  def scale(new_level = nil)
    new_level = 10 + 10 * pbGet(10) if new_level.nil?
    return if !AutomaticLevelScaling.shouldScaleLevel?(self.level, new_level)

    self.level = new_level
    self.scaleEvolutionStage if AutomaticLevelScaling.settings[:automatic_evolutions]
    self.calc_stats
    self.reset_moves if AutomaticLevelScaling.settings[:update_moves]
  end

However, in general, I wouldn't recommend this approach, as it could lead to a big difficulty spike from the gym leader to the first trainers you fight. So, another option is to limit only the max level those pokémon can be:
Code:
Expand Collapse Copy
  def scale(new_level = nil)
    new_level = AutomaticLevelScaling.getScaledLevel if new_level.nil?
    max_level = 10 + 10 * pbGet(10)
    new_level = new_level.clamp(1, max_level)
    return if !AutomaticLevelScaling.shouldScaleLevel?(self.level, new_level)

    self.level = new_level
    self.scaleEvolutionStage if AutomaticLevelScaling.settings[:automatic_evolutions]
    self.calc_stats
    self.reset_moves if AutomaticLevelScaling.settings[:update_moves]
  end

This option should fix your issue, but I'll suggest another interesting option. One problem with the previous approach is that the maximum level scales linearly, while pokémon need more exp to level up as they get higher levels. So, if you want more control over the max level, you can manually set that variable value to the max level after each battle:
Ruby:
Expand Collapse Copy
  def scale(new_level = nil)
    new_level = AutomaticLevelScaling.getScaledLevel if new_level.nil?
    max_level = pbGet(10)
    new_level = new_level.clamp(1, max_level)
    return if !AutomaticLevelScaling.shouldScaleLevel?(self.level, new_level)

    self.level = new_level
    self.scaleEvolutionStage if AutomaticLevelScaling.settings[:automatic_evolutions]
    self.calc_stats
    self.reset_moves if AutomaticLevelScaling.settings[:update_moves]
  end
You'd need to playtest more to get more accurate levels, but you also get much more precise levels.

The decision is up to you. I hope one of these ideas solves your issues! If you run into any problems related to this or want some help implementing other features from the plugin, I'd be happy to help you out.
 
I am using Automatic Level Scaling, and I am currently having config confusion, on how to setup a 1:1 Level Scaled setting. This is for the Battle Mode section of my game, and to save myself, from having to make at least 12 Dedicated Entries in trainers.txt, for just 1 trainer battle in Battle Mode. 3 for Battle Formats, 3 for Inverse Battle Formats, and 3 for Lvl.5, Lvl.50 and Lvl.100. What do I need to configure in Automatic Level Scaling, so it has the same effect as pbBalancedLevel($player.party)?

a9pfKCK.png

Djbz1RU.png

aFVJgPt.png

Ht3lAnP.png
One problem I see is that you enabled both ONLY_SCALE_IF_HIGHER and ONLY_SCALE_IF_LOWER. The idea behind ONLY_SCALE_IF_HIGHER is to only activate level scaling if the player level is higher than the opponents, so, the PBS level is the minimum level possible. And ONLY_SCALE_IF_LOWER is the opposite, meaning encounters will be adjusted if the player is not in the level intended, but their levels will not get higher than defined in the PBS. If you enable both at the same time, scaling would be effectively disabled.

In the previous reply, I explained a little about setting levels manually, you might be interested in giving it a look. I hope I could help.
 
One problem I see is that you enabled both ONLY_SCALE_IF_HIGHER and ONLY_SCALE_IF_LOWER. The idea behind ONLY_SCALE_IF_HIGHER is to only activate level scaling if the player level is higher than the opponents, so, the PBS level is the minimum level possible. And ONLY_SCALE_IF_LOWER is the opposite, meaning encounters will be adjusted if the player is not in the level intended, but their levels will not get higher than defined in the PBS. If you enable both at the same time, scaling would be effectively disabled.

In the previous reply, I explained a little about setting levels manually, you might be interested in giving it a look. I hope I could help
Hi Benitex.

Thank you for your help. After looking over the previous post and adapting the suggestion for my project's needs, and only having Only Scale if Higher enabled, the problem now seems to be fixed! I still have to test Lvl.50 and Lvl.5 scaling, but I now know that the Auto Scaling is now working.

Thank you for your help!
QpdwQUF.png

dG3xwoI.png

3heIGFb.png

YVjwuIx.png

uYMXPlT.png

LkW5Apz.png
 
For some reason, I am not able to apply the temporary setting, that retains a Pokémon team's configured move set. I doubled checked the instructions and other people here facing the same problem as me, so I'm not sure how the setting setup needs to go in order to apply not having this battle's move sets auto change, as a result of the level scaling.
3irajcz.png

rHxDGa0.png

jo5sY3l.png

9jvLkGA.png

gabzuD5.png

g6sI09z.png

KZ4IVvX.png
 
For some reason, I am not able to apply the temporary setting, that retains a Pokémon team's configured move set. I doubled checked the instructions and other people here facing the same problem as me, so I'm not sure how the setting setup needs to go in order to apply not having this battle's move sets auto change, as a result of the level scaling.
3irajcz.png

rHxDGa0.png

jo5sY3l.png

9jvLkGA.png

gabzuD5.png

g6sI09z.png

KZ4IVvX.png
I tested this setting, and it seems to be working as expected. Your setup seems to be correct, though. Since you made some custom changes to the script, there might be something unexpected that's causing this bug. I suggest debugging and printing every step to see what might be happening. Also, you can remove or modify the line self.reset_moves if AutomaticLevelScaling.settings[:update_moves] in the same scale method we were discussing, which is the only line that changes moves.
 
Questions!

1. Is there a way to set it up to only level up wild pokemon on set maps only? like Friend Safari maps.
2. How do I set it up?
 
I tested this setting, and it seems to be working as expected. Your setup seems to be correct, though. Since you made some custom changes to the script, there might be something unexpected that's causing this bug. I suggest debugging and printing every step to see what might be happening. Also, you can remove or modify the line self.reset_moves if AutomaticLevelScaling.settings[:update_moves] in the same scale method we were discussing, which is the only line that changes moves.
I ended up giving turning off self.reset_moves in 005_Class_Overrides.rb, and this change has fixed my problem. My modded Level Scaling Class Override now works in the way I want! Thank you for your help. I'm okay with manually setting up each trainer battles Move sets, because for Battle Mode, it matters more to me that I have full manual control. And I usually also hand craft the Move Sets of ordinary trainer battles anyway, with or without Level Scaling.
ABfbFAA.png
 
Questions!

1. Is there a way to set it up to only level up wild pokemon on set maps only? like Friend Safari maps.
2. How do I set it up?
Yes! The easiest way to implement this feature is by modifying the first EventHandlers in 004_Event_Handlers.rb, like this:
Ruby:
Expand Collapse Copy
EventHandlers.add(:on_wild_pokemon_created, :automatic_level_scaling,
  proc { |pokemon|
    id = pbGet(LevelScalingSettings::WILD_VARIABLE)
    next if id == 0

    map_ids = [5, 21] # add your maps here
    next unless map_ids.include?($game_map.map_id)

    AutomaticLevelScaling.difficulty = id

    if AutomaticLevelScaling.settings[:use_map_level_for_wild_pokemon]
      pokemon.scale(AutomaticLevelScaling.getMapLevel($game_map.map_id))
    else
      pokemon.scale
    end
  }
)

Just change the numbers in the array with the map ids of the maps you want to activate scaling in. Then, you can activate level scaling at the beginning of the game (or at any other moment before entering those maps). You can also add those same two lines anywhere before the
Ruby:
Expand Collapse Copy
$PokemonGlobal.map_levels[$game_map.map_id] = AutomaticLevelScaling.getScaledLevel
call in the last event handlers to make save files a little more compact, but that's not necessary. There are some other ways to implement this, so let me know if you have any problems.
 
In the [imath]PokemonGlobal.map_levels[[/imath]game_map.map_id] = AutomaticLevelScaling.getScaledLevel do I change the map_id to the map id that I put the event on?
 
In the [imath]PokemonGlobal.map_levels[[/imath]game_map.map_id] = AutomaticLevelScaling.getScaledLevel do I change the map_id to the map id that I put the event on?
No, you just need to add the same two lines and leave the rest as is, like this:
Ruby:
Expand Collapse Copy
# Set map level when player enters a map
EventHandlers.add(:on_enter_map, :define_map_level,
  proc { |old_map_id|
    next if !AutomaticLevelScaling.settings[:use_map_level_for_wild_pokemon]
    next if $PokemonGlobal.map_levels.has_key?($game_map.map_id)

    map_ids = [5, 21] # add your maps here
    next unless map_ids.include?($game_map.map_id)
 
    id = pbGet(LevelScalingSettings::WILD_VARIABLE)
    next if id == 0
    AutomaticLevelScaling.difficulty = id

    $PokemonGlobal.map_levels[$game_map.map_id] = AutomaticLevelScaling.getScaledLevel
  }
)
This code simply avoids saving levels for the other maps. If you change the game_map.map_id to a specific map, the script will use the level when the player first enters another map for that map. So just add the same maps to the map_ids array and it should work.
 
Back
Top