• 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

Resource Showdown Exporter 1.0

Cilerba

relic artist!
Relic Artist
Joined
Nov 15, 2014
Posts
12
Cilerba submitted a new resource:

Showdown Exporter - Turn your Pokémon Essentials team into a Pokémon Showdown-ready text file.

A small script to turn your team into a Showdown text file.

To use it just throw it in and call pbShowdown and it will create a "team.txt" file in your game's directory.

Code:
#===============================================================================
#
#   Showdown Exporter v1.0 for Pokémon Essentials by Cilerba
#
#===============================================================================
 
def holdItem
 return self.item
end
 
def pbShowdown
   # Make outfile
   outfile...

Read more about this resource...
 

Cilerba

relic artist!
Relic Artist
Joined
Nov 15, 2014
Posts
12
Cilerba updated Showdown Exporter with a new update entry:

v2 Rewrite by M3rein!

Hey don't use v1 it's bad use v2 by M3rein he made it real good

Support for custom moves and Alolan forms woo

Code:
#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=
#
#  Showdown Exporter v2 for Pokémon Essentials by Cilerba, rewritten by M3rein
#
#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=
SDWN_ALOLAN = { # What forms of what species are seen as Alolan.
  :RATTATA   => 1,
  :RATICATE  => 1,
  :RAICHU	=> 1,
  :SANDSHREW...

Read the rest of this update entry...
 

lavendersiren

Mage of Light
Member
Joined
Apr 17, 2023
Posts
9
I managed to personally update this to work in v20.1. I'm not sure how much will break in terms of corner cases, but it seems to work!
Ruby:
#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=
#
#  Showdown Exporter v3 for Pokémon Essentials by Cilerba, rewritten by M3rein, rerewritten by lavendersiren
#
#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=
SDWN_ALOLAN = { # What forms of what species are seen as Alolan.
  :RATTATA   => 1,
  :RATICATE  => 1,
  :RAICHU    => 1,
  :SANDSHREW => 1,
  :SANDSLASH => 1,
  :VULPIX    => 1,
  :NINETALES => 1,
  :DIGLETT   => 1,
  :DUGTRIO   => 1,
  :MEOWTH    => 1,
  :PERSIAN   => 1,
  :GEODUDE   => 1,
  :GRAVELER  => 1,
  :GOLEM     => 1,
  :GRIMER    => 1,
  :MUK       => 1,
  :EXEGGUTOR => 1,
  :MAROWAK   => 1
}
 
SDWN_MOVES = { # Turns the left move into the right move. This for compatibility with custom moves.
  :CUSTOM1 => :TACKLE,
  :CUSTOM2 => :POUND,
  :CUSTOM3 => :SLAM
}
 
 
def getShowdownName(pkmn)
  for key in SDWN_ALOLAN.keys
    if pkmn.species == getConst(GameData::Species,key) && pkmn.form == SDWN_ALOLAN[key] #PBSpecies
      return "#{GameData::Species.get(pkmn.species).name}-Alola" #PBSpecies.getName(pkmn.species)
    end
  end
  return GameData::Species.get(pkmn.species).name #PBSpecies.getName(pkmn.species)
end
 
def getShowdownMove(m)
  for key in SDWN_MOVES.keys
    if m.id == getConst(GameData::Move,key)
      return GameData::Move.get(pkmn.moves).name(getConst(GameData::Move,SDWN_MOVES[key])) #PBMoves.getName(getConst(PBMoves,SDWN_MOVES[key]))
      #get the name of the moves ( get a constant (the moves, that hash up there[key]) )
    end
  end
  return GameData::Move.get(m.id).name #PBMoves.getName(m.id)
end
 
def pbShowdown
  ret = ""
  for i in 0...$Trainer.party.size
    pkmn = $Trainer.party[i]
    next if !pkmn || pkmn.egg? #chaged to egg instead of isEgg?
    if pkmn.name != "" && pkmn.name != GameData::Species.get(pkmn.species).name #PBSpecies.getName(pkmn.species) old thing
      ret += "#{pkmn.name} (#{getShowdownName(pkmn)}) "
    else
      ret += "#{getShowdownName(pkmn)} "
    end
    ret += pkmn.gender == 0 ? "(M) " : pkmn.gender == 1 ? "(F) " : ""
    ret += "@ #{GameData::Item.get(pkmn.item).name}" if pkmn.item != nil #> 0 #PBItems.getName(pkmn.item)
    ret += "\n"
    ret += "Ability: #{GameData::Ability.get(pkmn.ability).name}\n" #PBAbilities.getName(pkmn.ability)
    ret += "Level: #{pkmn.level}\n" if pkmn.level < 100
    ret += "Shiny: Yes\n" if pkmn.shiny?
    ret += "Happiness: #{pkmn.happiness}\n" if pkmn.happiness < 255
    evs = [pkmn.ev[:HP],pkmn.ev[:ATTACK],pkmn.ev[:DEFENSE],pkmn.ev[:SPECIAL_DEFENSE],pkmn.ev[:SPEED],pkmn.ev[:SPECIAL_ATTACK]] #evs = [pkmn.ev[0],pkmn.ev[1],pkmn.ev[2],pkmn.ev[4],pkmn.ev[5],pkmn.ev[3]]
    stats = ["HP", "Atk", "Def", "SpA", "SpD", "Spe"]
    p evs #print the effort values
    p pkmn.ev
    if evs[0] > 0 || evs[1] > 0 || evs[2] > 0 || evs[3] > 0 || evs[4] > 0 || evs[5] > 0
      ret += "EVs:"
      for i in 0...6
        ret += " #{evs[i]} #{stats[i]} /" if evs[i] > 0
      end
      ret = ret[0, ret.size - 2] + "\n"
    end
    ret += "#{GameData::Nature.get(pkmn.nature).name} Nature\n" #PBNatures.getName(pkmn.nature)
    ivs = [pkmn.iv[:HP],pkmn.iv[:ATTACK],pkmn.iv[:DEFENSE],pkmn.iv[:SPECIAL_DEFENSE],pkmn.iv[:SPEED],pkmn.iv[:SPECIAL_ATTACK]]
    if ivs[0] < 31 || ivs[1] < 31 || ivs[2] < 31 || ivs[3] < 31 || ivs[4] < 31 || ivs[5] < 31
      ret += "IVs:"
      for i in 0...6
        ret += " #{ivs[i]} #{stats[i]} /" if ivs[i] < 31
      end
      ret = ret[0, ret.size - 2] + "\n"
    end
    for j in 0...pkmn.moves.size
      next if !pkmn.moves[j] || pkmn.moves[j].id == 0
      ret += "- #{getShowdownMove(pkmn.moves[j])}\n"
    end
    ret += "\n"
  end
  file = File.new("showdown.txt", "w+")
  file.write(ret)
  file.close
end
 
Back
Top