• Hi, Guest!
    Some images might be missing as we move away from using embedded images, sorry for the mess!
    From now on, you'll be required to use a third party to host images. You can learn how to add images here, and if your thread is missing images you can request them here.
    Do not use Discord to host any images you post, these links expire quickly!
Resource icon

Resource Automatic Level Scaling 1.5.1

RoyJohnson49

Novice
Member
Joined
Mar 11, 2023
Posts
29
I'm interested in using this plugin. I'm just curious if there is a way to have the level scaling only apply to specific trainers and wild areas and not the entire game.
 

Benitex

Trainer
Member
Joined
Nov 7, 2020
Posts
77
I'm interested in using this plugin. I'm just curious if there is a way to have the level scaling only apply to specific trainers and wild areas and not the entire game.
To apply level scaling only for a specific trainer battle, you can follow the steps in the last part of the code in the first image of the overview page.

To activate level scaling only in a specific area, you can do the same steps in the event that teleports the player between maps (although it can generate some problems if the player teleports using fly or something like that) or include a condition in the 004_Event_Handlers.rb file like the one in the essentials Overworld_EncounterModifiers that checks for the game map. It should look like this: $game_map.map_id == 51.
 

Blakturne

Rookie
Member
Joined
Aug 25, 2020
Posts
1
hello the script works but i encountered a problem when i set ONLY_SCAL_IF_HiGHER to true i encounter this error when a fight is launched
erreur.png
 

R0mul0n

Rookie
Member
Joined
Mar 28, 2023
Posts
4
Benitex submitted a new resource:

Automatic Level Scaling - Scale and evolve wild and trainer pokemon levels according to multiple difficulty options.



Read more about this resource...
Okay I am super new, I followed directions, I just need to know if the script.rb I copy and paste above main?

Benitex submitted a new resource:

Automatic Level Scaling - Scale and evolve wild and trainer pokemon levels according to multiple difficulty options.



Read more about this resource...
 
Okay I am super new, I followed directions, I just need to know if the script.rb I copy and paste above main?
To install this plugin, extract the zip file into your game root folder.
Then, you should check if you're already using variables 99 and 100 in your game. These are the variables that control trainer and wild pokemon difficulty, respectively.
If you are already using these variables, go to the Settings.rb script and change the value to whichever variable you want to use to change the difficulty.
In Settings.rb, you can also change some options, create other difficulty options, and enable more complex conditions for level scaling.
This is everything you need to do to install the script, but you should also activate it by selecting a difficulty.
 

Neeka

Cooltrainer
Member
Joined
Aug 7, 2021
Posts
116
I think I'm being stupid again. I can't see the link to download this plugin!
 

Benitex

Trainer
Member
Joined
Nov 7, 2020
Posts
77
I think I'm being stupid again. I can't see the link to download this plugin!
If you can't find the download link on this page, there's an orange "Go to download" button in the top right corner. If you can't find the download link on GitHub, it may be hidden. Click on "Assets" and "Automatic.Level.Scaling.v20.1.zip" or "Automatic.Level.Scaling.v19.1.zip".
 

Neeka

Cooltrainer
Member
Joined
Aug 7, 2021
Posts
116
If you can't find the download link on this page, there's an orange "Go to download" button in the top right corner. If you can't find the download link on GitHub, it may be hidden. Click on "Assets" and "Automatic.Level.Scaling.v20.1.zip" or "Automatic.Level.Scaling.v19.1.zip".
I'm so stupid. I didn't even notice that go to download button in the top right corner. I'm so used to the download button being in the actual first post! Thank you for your response.
 

MegaPokeking

Let's do It
Member
Joined
Aug 16, 2020
Posts
23
Hey There,I am making an open world pokemon game which includes your script for level scaling. It is being a huge help to be me but I have a query.How do I change the automatic evolutions depending on my variables
 

Benitex

Trainer
Member
Joined
Nov 7, 2020
Posts
77
Hey There,I am making an open world pokemon game which includes your script for level scaling. It is being a huge help to be me but I have a query.How do I change the automatic evolutions depending on my variables
I hope you are enjoying using my script! Feel free to send me any other questions you may have.

As quickly described in the overview page, you can use AutomaticLevelScaling.setSettings or AutomaticLevelScaling.setTemporarySetting in conjunction with automaticEvolutions to disable or enable automatic evolutions temporarily. The difference is setTemporarySetting changes one setting for only one battle, and setSettings changes settings until the game is closed or you change settings at another time.

For example, you can make a script Event Command in an Event:
Ruby:
AutomaticLevelScaling.setSettings(
  automatic_evolutions: pbGet(variableNumber)
)
Change variableNumber with the number of your variable (make sure its value is a boolean), and when you want to go back to automaticEvolutions enabled, just call AutomaticLevelScaling.setSettings in another event command.

If you are thinking about a more complex scenario, you can also change the EventHandlers in 004_Event_Handlers.rb (or create a new one) and call AutomaticLevelScaling.setTemporarySetting using your variable, the code will activate before each battle. Using this method, you can also add conditions, like if the current map is the one you want. If you want a more detailed explanation about this, feel free to ask me.

I think the solution I provided should solve most of the scenarios, but feel free to give me a more detailed explanation about the system you want to implement, and I will give my best to help you.
 

MegaPokeking

Let's do It
Member
Joined
Aug 16, 2020
Posts
23
Thanks a lot for your response. Your reply is helping me immensely.I would reach out to you if I ever find a issue.
 

Screen Lady

Glitch Trainer
Member
Joined
Dec 2, 2022
Posts
20
Is there a way to possibly allow a level cap to exist? (Example, you have scaling enabled, but it won't go past a certain value, such as 80.)
I noticed it is tricky to get this working with wild battle scaling without it throwing balance out the window. Though trying to double down on the negative values only makes it so that the early game is laughably low leveled.
 

Benitex

Trainer
Member
Joined
Nov 7, 2020
Posts
77
Is there a way to possibly allow a level cap to exist? (Example, you have scaling enabled, but it won't go past a certain value, such as 80.)
I noticed it is tricky to get this working with wild battle scaling without it throwing balance out the window. Though trying to double down on the negative values only makes it so that the early game is laughably low leveled.
You can use this plugin to include level caps in your game, I think there are no compatibility issues.
 

Screen Lady

Glitch Trainer
Member
Joined
Dec 2, 2022
Posts
20
You can use this plugin to include level caps in your game, I think there are no compatibility issues.
Hm, this seems to only cap the player unfortunately. But thanks for the redirect!
I think I'll pass due to it having to wipe saves though, my players would be a bit upset from that.
 

Benitex

Trainer
Member
Joined
Nov 7, 2020
Posts
77
Hm, this seems to only cap the player unfortunately. But thanks for the redirect!
I think I'll pass due to it having to wipe saves though, my players would be a bit upset from that.
Sorry, I misunderstood you, but I think I can help you now if I understand you correctly. You want to cap the level of opponents then, right? You can use the ONLY_SCALE_IF_LOWER setting if so.

The script will check the level of the pokemon (defined in the PBS or in the event), compare it with the level of the pokemon in the player's party, and scale it only if the player's party level is lower than the pokemon's. In other words, you can define the most powerful version (including level and evolutionary stage) in the PBS, and the plugin will scale it down if the player is not at that level yet.

If you only want to apply this setting to wild pokemon, just add this line of code in the wild pokemon EventHandlers in 004_Event_Handlers.rb: AutomaticLevelScaling.setTemporarySetting("onlyScaleIfLower", true). It'll look like this:
Ruby:
# Activates script when a wild pokemon is created
EventHandlers.add(:on_wild_pokemon_created, :automatic_level_scaling,
  proc { |pokemon|
    id = pbGet(LevelScalingSettings::WILD_VARIABLE)
    if id != 0
      AutomaticLevelScaling.setDifficulty(id)
      AutomaticLevelScaling.setTemporarySetting("onlyScaleIfLower", true)
      AutomaticLevelScaling.setNewLevel(pokemon)
    end
  }
)
 

Jman321

Rookie
Member
Joined
Jun 6, 2023
Posts
3
I love your plug-in, but I found that all trainers scale with it.
For example:
I have this in my trainer.txt for a Gym Leader:

#-------------------------------
[LEADER_Allan,Allan]
Items = FULLRESTORE,FULLRESTORE
LoseText = Very good.
Pokemon = POOCHYENA,12
Gender = male
Moves = BITE,ASSURANCE,SANDATTACK,MUDSLAP
AbilityIndex = 1
IV = 31,31,31,31,31,31
Pokemon = ZORUA,12
Gender = female
Moves = HONECLAWS,DIG,PROTECT,FURYSWIPES
AbilityIndex = 0
Item = SITRUSBERRY
IV = 31,31,31,31,31,31
Pokemon = STUNKY,13
Gender = male
Moves = BITE,SMOKESCREEN,ACIDSPRAY,POISONGAS
AbilityIndex = 1
Item = SITRUSBERRY
IV = 31,31,31,31,31,31
Pokemon = NUZLEAF,14
Gender = female
Shiny = yes
Moves = ABSORB,FAKEOUT,ASTONISH,GROWTH
AbilityIndex = 2
Item = SITRUSBERRY
IV = 31,31,31,31,31,31

But when challenging him with a lvl 5 as a test run, all of his pokemon are lvl 5 (on easy mode)

What should I do to make sure that he is at or above a min level no matter what?
For example: Nuzleaf is at 14 on easy and still scales normally with difficulty but never dips below 14
 
Last edited:

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
614
You have to set true the "only_scale_if_higher" setting. This will make the minimum level for all trainers the one you define in the PBS file. If you only want certain trainers to have a minimum level and the others to scale both up and down, you'll have to change temporarily that condition before all and any trainer battles where you want that minimum level cap to be.
Here you have the code for changing the rules of the autoscaling (both for one battle or until the game is closed) with the condition of automatic evolutions:
I hope you are enjoying using my script! Feel free to send me any other questions you may have.

As quickly described in the overview page, you can use AutomaticLevelScaling.setSettings or AutomaticLevelScaling.setTemporarySetting in conjunction with automaticEvolutions to disable or enable automatic evolutions temporarily. The difference is setTemporarySetting changes one setting for only one battle, and setSettings changes settings until the game is closed or you change settings at another time.

For example, you can make a script Event Command in an Event:
Ruby:
AutomaticLevelScaling.setSettings(
  automatic_evolutions: pbGet(variableNumber)
)
Change variableNumber with the number of your variable (make sure its value is a boolean), and when you want to go back to automaticEvolutions enabled, just call AutomaticLevelScaling.setSettings in another event command.

If you are thinking about a more complex scenario, you can also change the EventHandlers in 004_Event_Handlers.rb (or create a new one) and call AutomaticLevelScaling.setTemporarySetting using your variable, the code will activate before each battle. Using this method, you can also add conditions, like if the current map is the one you want. If you want a more detailed explanation about this, feel free to ask me.

I think the solution I provided should solve most of the scenarios, but feel free to give me a more detailed explanation about the system you want to implement, and I will give my best to help you.
You only have to change the "automatic_evolutions" for the corresponding rule you want to modify. I think that in overview is a list of the rules you can change and how to write them.
 

Jman321

Rookie
Member
Joined
Jun 6, 2023
Posts
3
You have to set true the "only_scale_if_higher" setting. This will make the minimum level for all trainers the one you define in the PBS file. If you only want certain trainers to have a minimum level and the others to scale both up and down, you'll have to change temporarily that condition before all and any trainer battles where you want that minimum level cap to be.
Here you have the code for changing the rules of the autoscaling (both for one battle or until the game is closed) with the condition of automatic evolutions:

You only have to change the "automatic_evolutions" for the corresponding rule you want to modify. I think that in overview is a list of the rules you can change and how to write them.
Thank you!

This is the error message that I am receiving when I am trying to do that:
[Pokémon Essentials version 20.1]
[v20.1 Hotfixes 1.0.7]

Script error in event 22 (coords 25,47), map 32 (Gym)
Exception: NameError
Message: undefined local variable or method `only_scale_if_higher' for #<Interpreter @event_id: 22>

***Full script:
AutomaticLevelScaling.setTemporarySetting(only_scale_if_higher,true)

Backtrace:
(eval):1:in `execute_script'
033:Interpreter:143:in `eval'
033:Interpreter:143:in `execute_script'
034:Interpreter_Commands:1112:in `command_355'
034:Interpreter_Commands:116:in `execute_command'
033:Interpreter:133:in `block in update'
033:Interpreter:90:in `loop'
033:Interpreter:90:in `update'
032:Scene_Map:160:in `block in update'
032:Scene_Map:159:in `loop'

What am I doing wrong?
 
Back
Top