- 311
- Posts
- 4
- Years
- He / Him
- Under the truck
- Seen Apr 16, 2023
Let's say for example, you have a trainer class, an Ace Trainer, that you'd like to change into a Cooltrainer, but only for one battle. Instead of creating an entirely new trainer class, in trainertypes.txt, you can simply alter the output name defined in the scripts.
Do a global search for
Once there, you'll see this
Going with the previous example up above, we're going to change an Ace Trainer into a Cooltrainer. You'll want to set aside a variable to use. In this case we'll use variable # 70, so replace that with whatever else you'd like.
Replace the above code with this:
So when the variable #70 is equal to 1, it'll change the name of the trainer to be whatever you write there. Note you must also write the trainer's name.
You can have multiple occasions, as I showed, so you can continue having more and more instances of this.
So now, to actually apply the code. When you write the trainer, use the same as you would without the script. Still write ACETRAINER as the trainer class. Then, right before the battle, you'll set the variable 70 to be 1. And then of course don't forget to set the variable back to zero after the battle, otherwise all your trainers will become Cooltrainer Jeff.
I hope this guide was helpful, and could save you a slot in your trainers.txt.
Do a global search for
Code:
def fullname
Code:
def fullname
return _INTL("{1} {2}",self.trainerTypeName,@name)
end
Replace the above code with this:
Code:
def fullname
case $game_variables[70]
when 0
return _INTL("{1} {2}",self.trainerTypeName,@name)
when 1
return _INTL("Cooltrainer Jeff")
when 2
return _INTL("Other filler")
end
end
end
You can have multiple occasions, as I showed, so you can continue having more and more instances of this.
So now, to actually apply the code. When you write the trainer, use the same as you would without the script. Still write ACETRAINER as the trainer class. Then, right before the battle, you'll set the variable 70 to be 1. And then of course don't forget to set the variable back to zero after the battle, otherwise all your trainers will become Cooltrainer Jeff.
I hope this guide was helpful, and could save you a slot in your trainers.txt.