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