Question, is it possible to use proportional scaling without the game crashing at later levels?
My config is like so:
module LevelScalingSettings
# These two below are the variables that control difficulty
# (You can set both of them to be the same)
TRAINER_VARIABLE = 100
WILD_VARIABLE = 25
# Scales levels but takes original level differences into consideration
# Don't forget to set random_increase values to 0 when using this setting
PROPORTIONAL_SCALING = true
# You can use the following to disable level scaling in any condition other then the selected below
ONLY_SCALE_IF_HIGHER = true # The script will only scale levels if the player is overleveled
ONLY_SCALE_IF_LOWER = false # The script will only scale levels if the player is underleveled
# You can add your own difficulties here, using the function "Difficulty.new(id, fixed_increase, random_increase)"
# "id" is the value stored in TRAINER_VARIABLE or WILD_VARIABLE, defines the active difficulty
# "fixed_increase" is a pre defined value that increases the level (optional)
# "random_increase" is a randomly selected value between 0 and the value provided (optional)
# (These variables can also store negative values)
DIFICULTIES = [
Difficulty.new(id: 1, fixed_increase: 1), # Easy
Difficulty.new(id: 2, fixed_increase: 2), # Medium
Difficulty.new(id: 3, fixed_increase: 3), # Hard
Difficulty.new(id: 5, fixed_increase: 0), # Standard Essentials
]
I am going up against a regular battle that is normally Level 50, with a Level 100 against them. However, they seem to be scaling to Level 101, thus crashing the game.
[2023-02-01 14:13:24 -0500]
[Pokémon Essentials version 20.1]
[v20.1 Hotfixes 1.0.7]
Script error in event 61 (coords 42,13), map 127 (Moras Island)
Exception: ArgumentError
Message: The level number (101) is invalid.
***Full script:
TrainerBattle.start(:TESTERONE, "Anchora")
Backtrace:
259:Pokemon:201:in `level='
[Automatic Level Scaling] 003_Script.rb:51:in `setNewLevel'
[Automatic Level Scaling] 004_Event_Handlers.rb:28:in `block (2 levels) in <main>'
[Automatic Level Scaling] 004_Event_Handlers.rb:27:in `each'
[Automatic Level Scaling] 004_Event_Handlers.rb:27:in `block in <main>'
035:Event_Handlers:89:in `block in trigger'
035:Event_Handlers:89:in `each_value'
035:Event_Handlers:89:in `trigger'
036:Event_HandlerCollections:63:in `trigger'
242:Overworld_BattleStarting:577:in `block in generate_foes'
It saddens me a bit because the proportional scaling is perfect for keeping the balance of the trainers, rather than disabling it and having everyones level sort of flatline. Is there any fix for this?
If anyone can help me sort this out, I'd highly appreciate it! I'm not the best with coding, so I'm not sure how to tweak everything to work myself.
EDIT: Besides the issue with level 100 and Proportional Scaling, everything else works fantastically!