I got it working, thank you
# Activates script when a wild pokemon is created
EventHandlers.add(:on_wild_pokemon_created, :automatic_level_scaling,
proc { |pokemon|
id = pbGet(LevelScalingSettings::WILD_VARIABLE)
next if id == 0
AutomaticLevelScaling.setTemporarySetting("automaticEvolutions", false)
AutomaticLevelScaling.difficulty = id
AutomaticLevelScaling.setNewLevel(pokemon)
}
)
Both of LinKazemine's suggestions should work well. Another option is to modify the conditions in theDuring the process of making Battle Mode for my fan game, I have run into another minor problem, that is only a problem in the context of my fan game's Battle Mode. I need to modify the Scaler's handling of auto evolving opponent Pokémon, so if an opponent Pokémon is holding the Eviolite item, it will stay at the evolution stage that is set in the PBS. Meaning if an opponent Pokémon is set to be Onix, it will stay an Onix as its level is scaled, when holding the Eviolite.
I need this modification, because I do not want to micromanage every occurrence, of a competitive opponent Pokémon's Eviolite set being sabotaged, as a result of the Automatic Level Scaling indirectly cancelling out the Eviolite's effect, because it's needs a Pokémon to not be fully evolved, in order for it's Def and Sp.Def boost to kick in.
Screenshots that help illustrate the minor problem I am trying to solve:
![]()
![]()
![]()
![]()
scale
method in 005_Class_Overrides.rb
, like this: def scale(new_level = nil)
new_level = AutomaticLevelScaling.getScaledLevel if new_level.nil?
new_level = new_level.clamp(1, GameData::GrowthRate.max_level)
return if !AutomaticLevelScaling.shouldScaleLevel?(self.level, new_level)
self.level = new_level
self.scaleEvolutionStage if AutomaticLevelScaling.settings[:automatic_evolutions] && self.item != :EVIOLITE
self.calc_stats
self.reset_moves if AutomaticLevelScaling.settings[:update_moves]
end
Thank you for your help. The Eviolite check fixed the minor problem for the context of my fan game project, in exactly the way I want. Now I can craft teams using the Eviolite item without trouble.Both of LinKazemine's suggestions should work well. Another option is to modify the conditions in thescale
method in005_Class_Overrides.rb
, like this:
Ruby:def scale(new_level = nil) new_level = AutomaticLevelScaling.getScaledLevel if new_level.nil? new_level = new_level.clamp(1, GameData::GrowthRate.max_level) return if !AutomaticLevelScaling.shouldScaleLevel?(self.level, new_level) self.level = new_level self.scaleEvolutionStage if AutomaticLevelScaling.settings[:automatic_evolutions] && self.item != :EVIOLITE self.calc_stats self.reset_moves if AutomaticLevelScaling.settings[:update_moves] end
Hey, would you mind sharing how you were able to add this? And Im not very experienced with code, so the exact code and where to put it would be nice. Thanks!Just a suggestion... Might want to think about ignoring too low leveled Pokemon. I added it on my end because without it, I could break the game. (I.E. at level 30-40, hatching a level 5 egg drop the average level significantly. Get a couple eggs and you can steamroll the game) Think I changed it to ignore eggs and ignore Pokemon that are outside 4 levels of the average range. That way the Pokemon are always close to the players level.
Awesome plugin, though. Definitely seems necessary for "open world" type games where there's not a set route.
There was a short discussion about this some time ago. Some people shared their ideas and what they decided to do in their games. I also shared my perspective about this. It starts here.Hello, Ive noticed that players can cheat this system by adding eggs or low level pokemon to their team to significantly reduce the trainers lvl pokemon. Is there a work around this?
pbBalancedLevel
function, which uses a weighted mean and standard deviation to choose a level. You could try to design and implement other systems, but all of them come with their pros and cons.