• 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.
  • Eevee Expo's webhost has been having technical issues since Nov. 20th and you might be unable to connect to our site. Staff are also facing issues connecting, so please send a DM to Cat on-site or through Discord directly for faster service!
Resource icon

Tutorial Trainer modifier (part 1) 1.0

grogro

Cooltrainer
Member
Joined
Mar 6, 2021
Posts
120
grogro submitted a new resource:

Trainer modifier (part 1) - How to modify a trainer's team before a fight

With a trainer modifier script, you can change the attributes of any trainer in your game. A trainer modifier script looks like this:

Code:
Expand Collapse Copy
EventHandlers.add(:on_trainer_load, :nameofthemodifier,
  proc { |trainer|
   if trainer   # check if you are facing a  trainer
     if Condition
           do what you want
     end
   end
  }
)

The Condition is here to determine which trainer will be affected. If you don't put anything, it applies to every trainer in your game.
It can be...

Read more about this resource...
 

Nixahma

Rookie
Member
Joined
Aug 20, 2024
Posts
1
I'm having a tough time implementing this in your pokepaste script. Could you give an example of what it would look like to give a trainer 6 pokemon from the pokepaste txt file? I also noticed it says the tutorial is for 20.0, but I figured it would be worth asking.
 

grogro

Cooltrainer
Member
Joined
Mar 6, 2021
Posts
120
I'm still using it in v21, it's the same. So strat by making a trainer with 6 dummy pkmn to be replaced. I have a genrandpkmn method at the bottom of the pokepaste script. add a parameter number to it, then replace r = rand(sup) by r=number. This is a Pokémon! You can now replace the dummy pokémons of the trainers by those positioned at the position number of your file (you need to loop from 0 to 5 to have them all).

Example:

tier=["PU","PU","NU","NU","RU","UU"]
for i in 0...trainer.party.length
pk=genrandpkmn("Data/Rand_trainer/"+tier+".txt")
trainer.party=pk
trainer.party.level=pbBalancedLevel($player.party)-6+rand(4)
trainer.party.calc_stats
end
 

grogro

Cooltrainer
Member
Joined
Mar 6, 2021
Posts
120
and Yes I have a pokepaste for every tier, you can split them
 
Back
Top