Resource icon

Random Trainers 1.0

Pokémon Essentials Version
Important: when I say "random Trainers" I mean "randomizing the trainers.txt file," not "procedurally generated whatever during runtime." It's for people like me who don't want to have to manually assign Pokémon to a hundred odd trainers rather than people who want a different experience every single save file.

Also this is just a Javascript script so if you want to change how it works feel free to do so.

How To Use

1. Save the code as random_teams.js or something similar to that. The file name can't contain spaces.

2. If you don't have it already, install NodeJS.

3. Create an input file. It looks a lot like a stripped-down version of trainers.txt, as:


The arguments go like:

1. Trainer class
2. Trainer name
3. Battle ID
4. Number of Pokémon the trainer has

4. Open up random_trainers.js. You'll see a lot of arrays of Pokémon names (as strings) in a bunch of arrays named more or less after trainer classes. The arrays dictate what Pokémon each Trainer class can have; the ones I provided are from the game jam game I did, but you probably want to change them. For example, in a Kanto-based game birdkeeper would probably contain ["Pidgey", "Spearow"].

The code which actually does stuff is down at the bottom, in the event that you want to play around with that, too. It's commented fairly well, at least on my standards.

5. Open the command prompt. Run this command:

node random_teams.js input.txt output.txt

where random_teams.js is the file you saved, input.txt is the input file you created and output.txt doesn't strictly have to exist as the program should be able to create it for you.

6. Open output.txt. It should be an exactly functional version of trainers.txt, which you can do pretty much whatever with.

7. Enjoy the fact that you just spent ten minutes doing a task that could otherwise have taken two hours.

Note that the script so far generates everybody at Level 1. I may or may not address this in an update.
Me, I guess, plus whoever invented the trainers.txt file format
First release
Last update
0.00 star(s) 0 ratings

More resources from Dragonite