Hacking Showdown

more like showclown

bonzairob at 23:49 on 18 Nov 16
#1
If you've attempted to add fakemon to showdown you'll know its a bastard. Luckily, as you all know, I'm too bull-headed and contrarian to let this deliberately obtuse garbage stop me.

First off you need two components - server and client.

Things to bear in mind here:
  1. you need to be able to install node, they've got some instructions on the server link above
  2. you need to be able to run a php server; for windows i recommend WAMP, it's nice and simple to set up
  3. the guys making it are really insular and not happy about people using it, and seem to have made it open source out of a weird superiority complex. Let's break their toys.
You can save the server anywhere but I'd recommend putting it inside the client folder, in a _server folder. Rename testclient.html to index.html; remove this from the top of the file:
 var Config = {testclient: true};
(function() {
if (location.search !== '') {
var m = /\?~~(([^:\/]*)(:[0-9]*)?)/.exec(location.search);
if (m) {
Config.server = {
id: m[1 ],
host: m[2],
port: (m[3] && parseInt(m[3].substr(1))) || 8000
};
} else {
alert('Unrecognised query string syntax: ' + location.search);
}
}
})();

And replace it with this:

var Config = {
testclient: true,
server: {
id: 'localhost:8000',
host: 'localhost',
port: 8000
}
};


I changed Venusaur to Penisaur but it's not showing up - what gives?
There's a data folder in each - the one for the client should actually have everything out of the server one! I'd suggest editing the data files on server and then copying them to client when you make changes.

However, I've got it setup so the server folder is inside the client stuff at _server; then with this in the .htaccess file, it falls back to server data if it can't find it in client:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} ^/data/
RewriteRule data/(.+) _server/data/$1 [L]


Files you need to download from the live server:
https://play.pokemonshowdown.com/data/teambuilder-tables.js (client data folder, not server)
https://play.pokemonshowdown.com/data/search-index.js (client data folder, not server)
https://play.pokemonshowdown.com/config/config.js (I haven't messed with this much yet)

Files you need to edit to add a pokemon
I've been adding all the pokemon in as CAP since it's pretty much what we want.
  • server/data/pokedex.js - copy something existing, make sure the array key (name:) is unique, give it an id like -1000 and make sure this is unique too
  • server/data/learnsets.js - just copy Missingno.'s here - the format is gen/movetype/data, so 5L1 is level1 in gen 5; 5E is egg move. Doesn't really matter in practice. The keys here have to match the ones in moves.js! (like Poison Gas becomes poisongas)
  • client/data/pokedex-mini-bw.js - make sure your unique name and ID from above match up properly. I think this is just for sprites so may not be necessary.
  • client/data/learnsets-g6.js - this one does seem to be necessary, but I need to investigate further. It's the same as learnsets.js without the level codes.
  • client/data/teambuilder-tables.js - this one is a shit. It's like a big built cache of other data, with no way to build it given. This is the search data for the teambuilder, so alas, it's necessary.
  1. Right at the top, find
    ["header", "CAP"],
    and add some returns after it (after its comma), then add your array key from pokedex here ("bonzai" not "Bonzai")
  2. ctrl F for "learnsets" and add some returns after the {, then you need to add moves like in learnsets.js, but in a slightly different format, so like,
    "headbutt":"456",
    I haven't looked into this code yet but 456 seems to work.
What about moves and abilities? Or don't you CARE about that, PFminati??
Abilities are waay simpler, you can just edit them into the server/data/abilities.js file, and then reference them in pokedex.js on your pokeman.
I haven't tried custom moves yet! (So to answer your oddly accusatory question, no)

That's about it. I'm working on some hax tools to do the editing for us and then I'll try to get a permanent server set up somewhere to play with.
Edited at 13:11 on 19 Nov 16 by bonzairob