manunited668

Untitled

Oct 23rd, 2017
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. How To Use
  2.  
  3. 1. Save the code as random_teams.js or something similar to that. The file name can't contain spaces.
  4.  
  5. 2. If you don't have it already, install NodeJS.
  6.  
  7. 3. Create an input file. It looks a lot like a stripped-down version of trainers.txt, as:
  8.  
  9. ACETRAINER_M,Bob,0,4
  10. CRUSHGIRL,Sarah,0,3
  11.  
  12. The arguments go like:
  13.  
  14. 1. Trainer class
  15. 2. Trainer name
  16. 3. Battle ID
  17. 4. Number of Pokémon the trainer has
  18.  
  19. 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"].
  20.  
  21. 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.
  22.  
  23. 5. Open the command prompt. Run this command:
  24.  
  25. node random_teams.js input.txt output.txt
  26.  
  27. 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.
  28.  
  29. 6. Open output.txt. It should be an exactly functional version of trainers.txt, which you can do pretty much whatever with.
  30.  
  31. 7. Enjoy the fact that you just spent ten minutes doing a task that could otherwise have taken two hours.
  32.  
  33. Note that the script so far generates everybody at Level 1. I may or may not address this in an update.
Add Comment
Please, Sign In to add comment