How would this script work if say in the scenario where you want your first gym leader's Pokemon to have Water Gun if battled at about Level 13, but then a stronger move like Water Pulse at like Level 20 (though you wouldn't be able to be Level 20 unless you grinded a lot)? Or like Ancient Power on a fourth gym's Pokemon if battled at Level 32ish, but then Power Gem if battled at like Level 40. Additionally, how do I implement the script into a trainer battle? I don't see how to do it.
First of all, make sure your trainer variable has a valid difficulty value activated. If the trainer variable (variable 99 of RPG Maker by default, or whatever value you set it to be) is equal to 0 (which is the default value), my script is not going to activate. Just change this variable value to one of the difficulties id to activate it.
By default, the script will update moves automatically (the script will set new moves after a new level and evolution is defined, the same way Essentials does to decide which moves a trainer's pokemon will have if you don't select them manually), so you probably don't need to worry about making different trainer versions depending on player's party level.
But, if you do want to make different trainer versions according to the party levels, you'd have to do something like this:
First, make a different trainer version in your
trainers.txt
PBS file for each different moveset you want. I made a tutorial about this
here, the only difference is that you have to set different moveset in each trainer version, instead of setting different pokemon.
After this, call the script command
AutomaticLevelScaling.setSettings(update_moves: false)
. This will disable the feature I mentioned earlier, letting you use predefined moves.
Then, you have to set a variable value depending on the level of the player's party pokemon. Call this variable in the
BattleID
field of
pbTrainerBattle
.
Lastly call
AutomaticLevelScaling.setSettings
again to reset settings, use any parameters you were using before if you were using any.
In the end, it should look like this: