• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
Resource icon

Resource Automatic Level Scaling 1.5.1

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
674
I will assume that it's because you wrote it wrong. I have done that in the Event Handlers to change the levels of forced evolution for wild pokémon and I haven't run into a problem. It's, however, written differently.
Try this:
Code:
Expand Collapse Copy
AutomaticLevelScaling.setTemporarySetting("only_scale_if_higher", true)
 

Jman321

Rookie
Member
Joined
Jun 6, 2023
Posts
3
I will assume that it's because you wrote it wrong. I have done that in the Event Handlers to change the levels of forced evolution for wild pokémon and I haven't run into a problem. It's, however, written differently.
Try this:
Code:
Expand Collapse Copy
AutomaticLevelScaling.setTemporarySetting("only_scale_if_higher", true)
Thank you! It worked only when it was not an area event
 

mynameisumbreon

Novice
Member
Joined
Nov 11, 2021
Posts
19
I haven't installed the plugin yet but I want to make sure I understand a function about it before I get too deep. I'm curious about how to control what form applin will evolve into when used by an npc trainer. I want to guarantee they evolve into flapple at a certain level, but I'm not sure how to set that up. Or is the evolution form random? I have the same question about toxel/toxtricity and guaranteeing amped form.
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
674
I haven't installed the plugin yet but I want to make sure I understand a function about it before I get too deep. I'm curious about how to control what form applin will evolve into when used by an npc trainer. I want to guarantee they evolve into flapple at a certain level, but I'm not sure how to set that up. Or is the evolution form random?
The evolution is random if you gave the trainer an applin. If you give them a flapple instead, it will always be a flapple once the pokemon has enough level to be evolved.
 

mynameisumbreon

Novice
Member
Joined
Nov 11, 2021
Posts
19
Is there a way to set it up for pokemon that evolve through items, such as applin/flapple, or does this plugin only work with pokemon that specifically evolve upon level up?
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
674
The method of evolution doesn't matter. One of the settings in the plugin is defining a level after wich any pokémon that doesn't evolve by simply leveling up would be on any of their evolved forms. This setting is for both wild and trainer pokémon if you have one or both of them to scale with the plugin.
 

mynameisumbreon

Novice
Member
Joined
Nov 11, 2021
Posts
19
The method of evolution doesn't matter. One of the settings in the plugin is defining a level after wich any pokémon that doesn't evolve by simply leveling up would be on any of their evolved forms. This setting is for both wild and trainer pokémon if you have one or both of them to scale with the plugin.
Thank you so much for your fast responses and explanation! Based on what you described, this plugin should do exactly what I need, I'll just need to take my time with the settings.
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
674
No problem! And there aren't many things to set, really. You'll probably pass more time setting the difficulties you will be using in your game than in the other settings. And that's quite quick to do, so I'm sure you'll end pretty quickly.
 

Benitex

Trainer
Member
Joined
Nov 7, 2020
Posts
77
Thank you so much for your fast responses and explanation! Based on what you described, this plugin should do exactly what I need, I'll just need to take my time with the settings.
I'm happy to know my plugin will help you in the development of your game. Feel free to ask any other questions you may have while trying things out too.

Also, thank you @LinKazamine, for answering these people, those were some great explanations.
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
674
Oh, I have the plugin on my own game so I have read the explanation of things and this thread to know how to use it myself.
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
674
Sorry for the double post, but I noticed something with the plugin. I modified the script like that:
1686474906403.png

I wanted only wild pokemon that evolve by level to be evolved but both settings seems to sort of conflict with pokemon that are registered as having regional forms. Rattatas, for example, would stay as such even when at level 90 if both firstEvolutionLevel and secondEvolutionLevel line was present but would appear as a raticate if not.
I don't know if it's intentional or a bug, but I though I should comment it for anyone else with that problem. I, sort of, solved the problem by taking off the pokemon from the regional forms list but that will not work for anyone including both rattata and alolan rattata (or any of the pokemon in the list) in the game.
 

Benitex

Trainer
Member
Joined
Nov 7, 2020
Posts
77
Sorry for the double post, but I noticed something with the plugin. I modified the script like that:
View attachment 18435
I wanted only wild pokemon that evolve by level to be evolved but both settings seems to sort of conflict with pokemon that are registered as having regional forms. Rattatas, for example, would stay as such even when at level 90 if both firstEvolutionLevel and secondEvolutionLevel line was present but would appear as a raticate if not.
I don't know if it's intentional or a bug, but I though I should comment it for anyone else with that problem. I, sort of, solved the problem by taking off the pokemon from the regional forms list but that will not work for anyone including both rattata and alolan rattata (or any of the pokemon in the list) in the game.
This is intentional behavior because of the way the get_evolutions and check_evolution_on_level_up methods work, changing it would make regional forms evolve into their non-regional variation, or ignore alternative evolutions completely. I think there might be a better way to implement regional evolutions, but I couldn't find it.

Also, the part that evolves pokemon according to their level is pretty simple. If anyone only wants evolutions from level up, they could remove everything from AutomaticLevelScaling.setNewStage and leave it like this:
Ruby:
Expand Collapse Copy
def self.setNewStage(pokemon)
    while pokemon.check_evolution_on_level_up != nil
        pokemon.species = pokemon.check_evolution_on_level_up
    end
end
Note that more specific scenarios, like changing only wild pokemon evolutions, would require more changes in the code, like adding a bool to check if it's a wild pokemon and gets set in the event handler.
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
674
Oh, ok. I don't know that much of coding so while I could modify the code to add more evolution metods to be considered as "level up", I couldn't figure out how the whole regional forms worked.

As for the wild pokemon evolutions, I have it settled to make all pokemon, both wild and trainers, evolve when scaling their levels regardless of their evolution method. I only added the two lines I showed before in the event handler for wild encounters and changed the check for other_evolving_method by adding conditions to the if statement.
1686501342967.png

It has ended quite long, but it sure keeps all the evolutions that might require human intervention (at least, the ones I consider as such) from happening. Also, I don't really have regional forms so I emptied that list and the burmy/wormadam forms seem to work fine in the wild anyway. I asume that deerling/sawsbuck, that work similarly, work as well.
 

Benitex

Trainer
Member
Joined
Nov 7, 2020
Posts
77
I've just updated the download link to include v21, no changes were needed in the code for the update to v21. If you don't plan to update your project to v21 yet, don't worry, I'll keep releasing updates for v20 and v19 the same way I've been doing with v19 since v20 was released. If you find any compatibility issues or any other bug I didn't notice, please tell me about them in this thread. I hope to see some cool games made with my plugin in v21!
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
674
For anyone interested, I (think) managed to make the code I shared for the excluded evolution methods shorter and fully customisable from the settings file.
This goes in the settings:
1688113937615.png

And this is the new code in the script file:
1688113599595.png

I tried multiple times to have this work and only managed to do so by looking at how this worked so I guess that credits for this go to TechSkylander1518.
 

Jukes

Cooltrainer
Member
Joined
Jul 15, 2023
Posts
102
Is there a code i can put in here to be able to exclude Gym leaders from automatically scaling but letting regular trainers scale?
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
674
Try this?
1689884357315.png

1689884386778.png

In the first image you'll need an array in the 002_Settings file with the names of your gym leaders and in the second you'll need an array with their trainer types. I haven't tested so not sure if it'll work.

Alternativelly, you could store the difficulty the player selected somewhere and turn the variable for trainers to 0 when the player interacts with the gym leader to fight them and restore the value afterwards. (This one works as long as you remember to restore the value in the gym leader event after the player wins or in the pokemon centers or any other place the player may end after loosing.)
 

Jukes

Cooltrainer
Member
Joined
Jul 15, 2023
Posts
102
How would I make the array in the 02 file? I'm just trying to exclude trainer types Gym_leader and EliteFour and Champion..

I'm new to this
 

LinKazamine

Champion
Member
Joined
May 24, 2023
Posts
674
There's already an array for regional forms. Just copy it, change the name (the part all in caps) to GYM_LEADERS (or whatever you want, but remember to match the name in the event handler) and change it's content for the trainers' name or trainer type depending on what option you do.
You shuld have one of those (with the names or types of your game):
1689887929070.png
 

Jukes

Cooltrainer
Member
Joined
Jul 15, 2023
Posts
102
1689889358964.png


EventHandlers.add(:on_trainer_load, :automatic_level_scaling,
proc { |trainer|
id = pbGet(LevelScalingSettings::TRAINER_VARIABLE)
if trainer && id != 0 &&LevelScalingSettings::EXCLUDED_TRAINERS.includes?(trainer.name)
AutomaticLevelScaling.setDifficulty(id)
avarage_level = 0
trainer.party.each { |pokemon | avarage_level += pokemon.level }
avarage_level /=trainer.party.length

for pokemon in trainer.party do
AutomaticLevelScaling.setNewLevel(pokemon, pokemon.level - avarage_level)
end
end
}
)
 
Back
Top