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 thescalemethod 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.so I am having an issue where I just need one trainer to keep the moves that are in the PBS file, I thought I had done everything right as specified, but the pokemon still just have random moves. here is a picture of the event. Did I put the script for temp settings in the right place? If not, where am I supposed to put it? Please let me know, thanks.
setTemporarySetting call looks correct. The only thing that looks a bit different to me is that you're using Variable 100 for trainer Pokémon, but I suppose that's on purpose. But even if it wasn't, the level wouldn't be changing in that scenario, and much less the moves. I tested something similar here, and it's working without any problems. Can you send me more information, like your settings file and the trainer party?I was using the wrong variable, just got them mixed up when I wrote the event. I fixed that, but am still having the same issue. I was having this issue previously, but thought maybe it was because I was using an older version of the plugin. but now that I am on the current plugin, I am thinking it may be something else entirely causing the issue... Just in case though, here is the info you asked for.ThesetTemporarySettingcall looks correct. The only thing that looks a bit different to me is that you're using Variable 100 for trainer Pokémon, but I suppose that's on purpose. But even if it wasn't, the level wouldn't be changing in that scenario, and much less the moves. I tested something similar here, and it's working without any problems. Can you send me more information, like your settings file and the trainer party?
Thank you for sharing your settings. So, you may be getting those random moves from Metronome (you can press F9 to open the debug menu in battle and see the moveset). If they are really getting generated with different moves, it may be something else, as you said.I was using the wrong variable, just got them mixed up when I wrote the event. I fixed that, but am still having the same issue. I was having this issue previously, but thought maybe it was because I was using an older version of the plugin. but now that I am on the current plugin, I am thinking it may be something else entirely causing the issue... Just in case though, here is the info you asked for.
the only two things I changed in settings are:
Default first evolution to be level 10,
and Only_Scale_If_Higher is set to True.
here is the trainer info:
[GAMBLER, Dirk]
LoseText = That's how the dice roll I guess.
Pokemon = IMPIDIMP,12
Item = FOCUSSASH
Moves = DARKPRANK,FAIRYLIGHTS,FLATTER,MINIMIZE
Pokemon = ACOOTSY,13
Item = QUICKCLAW
Moves = METRONOME,DARKPRANK,DOUBLETEAM,FLATTER
Pokemon = TERROLE,14
Item = RAZORFANG
Moves = METRONOME,DARKPRANK,DOUBLETEAM,FISSURE
Pokemon = WIGGLYTUFF,15
Item = LEFTOVERS
AbilityIndex = 0
Moves = METRONOME,FAIRYLIGHTS
Pokemon = CLEFABLE,16
Item = LUMBERRY
AbilityIndex = 0
Moves = FAIRYLIGHTS,METRONOME
Pokemon = MURKROW,16
Item = WIDELENS
Moves = DARKPRANK,METRONOME,CHATTER,COPYCAT
005_Class_Overrides.rb file and removing self.reset_moves if AutomaticLevelScaling.settings[:update_moves] on line 35. If the moves still change, that means there is something somewhere else changing them. It would look 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.calc_stats
end