• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Essentials Tutorial] Handling Trade Evolutions with an Item

  • 5
    Posts
    4
    Years
    • Seen Sep 19, 2020
    Before I begin, this is my first post so I hope everything shows up correctly. I will bold any of the text from my final txt files to try and clear things up.

    So I have been working on my own fan game and wanted to have a new way to deal with trade evolutions as trade doesn't really work with other people, so a solution I had was to replace it with an item. What I have is called an Omnistone, so first steps are to create or find an icon for the image (48 x 48) and define it in the items.txt file. So like the following:

    559,OMNISTONE,Omnistone,1,2500,A peculiar stone that makes certain species of Pokémon evolve. It has a winding helix pattern.,1,0,0,

    All I did was take the line for any of the other evolutionary stones and changed it to a new number, name, and flavour text. When adding the image to the icons folder in graphics, make sure it is labeled item### with the number matching the number in the txt file.

    For Pokémon with a simple trade evolution, such as Machoke or Graveler, go into the pokemon.txt file in the PBS folder and find this line at the bottom of the Pokémon's entry (Machoke's in this case):

    Evolutions=MACHAMP,Trade,

    And replace it with

    Evolutions=MACHAMP,Item,OMNISTONE

    with your respective item's internal name replacing OMNISTONE.

    The weird part comes to Pokémon such as Onix and Magmar who use an item in their trade. The solution I found allows the requirement of a specific item and the use of an Omnistone to simulate the trade with an item, however the item is not used up in the evolution.

    First, find the Pokemon_Evolution section in the Scripts section in RPG Maker XP. There are two changes you need to make at the start of that page. The first line should have module PBEvolution with a list of evolution methods up to 35. Change one of the custom methods to StoneHoldItem or whatever name you want the method to be called in that list under module PBEvolutions and the matching name under EVONAMES that is presented in purple.

    Under EVOPARAM, change the value of the number to 2 (in red) beside # Custom 1-5, so it matches the other item evolutions.

    Next is to go to Evolution methods and find the line:

    def pbMiniCheckEvolutionItem(pokemon,evonib,level,poke,item)

    The next step is to add our new evolution method to this section, so below
    when PBEvolution::ItemFemale
    return poke if level==item && pokemon.isFemale?
    add this:

    when PBEvolution::StoneHoldItem
    return poke if level==item && (isConst?(pokemon.species,PBSpecies,:POLIWHIRL) &&
    pokemon.item==getConst(PBItems,:KINGSROCK))

    In this instance, it defines the evolution from Poliwhirl into Politoed. I am not sure exactly how the coding works, but what it is doing is first saying that an item is used to evolve it through if level==item
    The isConst?(pokemon.species,PBSpecies,:POLIWHIRL) part checks for the specific Pokémon defined with this evolution in pokemon.txt and the pokemon.item==getConst(PBItems,:KINGSROCK) checks for the appropriate item defined in the items.txt file.

    To add any other Pokémon with this requirement, separate each entry with || .

    Last is to add this evolution in the pokemon.txt file.

    Once the evolution line is found, change the TradeItem (as follows)

    Evolutions=POLIWRATH,Item,WATERSTONE,POLITOED,TradeItem,KINGSROCK

    to our new evolution method

    Evolutions=POLIWRATH,Item,WATERSTONE,POLITOED,StoneHoldItem,OMNISTONE


    Hopefully this helps people and if something doesn't work I will try and help if I can. I did this a couple of months ago so I may have missed something.
    Here is the whole evolution text with all item trade evolutions up to generation 7:

    def pbMiniCheckEvolutionItem(pokemon,evonib,level,poke,item)
    # Checks for when an item is used on the Pokémon (e.g. an evolution stone)
    case evonib
    when PBEvolution::Item
    return poke if level==item
    when PBEvolution::ItemMale
    return poke if level==item && pokemon.isMale?
    when PBEvolution::ItemFemale
    return poke if level==item && pokemon.isFemale?
    when PBEvolution::StoneHoldItem
    return poke if level==item &&( (isConst?(pokemon.species,PBSpecies,:POLIWHIRL) &&
    pokemon.item==getConst(PBItems,:KINGSROCK)) || (isConst?(pokemon.species,PBSpecies,:SLOWPOKE) &&
    pokemon.item==getConst(PBItems,:KINGSROCK)) || (isConst?(pokemon.species,PBSpecies,:ONIX) &&
    pokemon.item==getConst(PBItems,:METALCOAT)) || (isConst?(pokemon.species,PBSpecies,:RHYDON) &&
    pokemon.item==getConst(PBItems,:PROTECTOR)) || (isConst?(pokemon.species,PBSpecies,:SEADRA) &&
    pokemon.item==getConst(PBItems,:DRAGONSCALE)) || (isConst?(pokemon.species,PBSpecies,:SCIZOR) &&
    pokemon.item==getConst(PBItems,:METALCOAT)) || (isConst?(pokemon.species,PBSpecies,:ELECTABUZZ) &&
    pokemon.item==getConst(PBItems,:ELECTIVIRE)) || (isConst?(pokemon.species,PBSpecies,:MAGMAR) &&
    pokemon.item==getConst(PBItems,:MAGMARIZER)) || (isConst?(pokemon.species,PBSpecies,:PORYGON) &&
    pokemon.item==getConst(PBItems,:UPGRADE)) || (isConst?(pokemon.species,PBSpecies,:PORYGON2) &&
    pokemon.item==getConst(PBItems,:DUBIOUSDISC)) || (isConst?(pokemon.species,PBSpecies,:FEEBAS) &&
    pokemon.item==getConst(PBItems,:PRISMSCALE)) || (isConst?(pokemon.species,PBSpecies,:DUSCLOPS) &&
    pokemon.item==getConst(PBItems,:REAPERCLOTH)) || (isConst?(pokemon.species,PBSpecies,:CLAMPERL) &&
    pokemon.item==getConst(PBItems,:DEEPSEATOOTH)) || (isConst?(pokemon.species,PBSpecies,:CLAMPERL) &&
    pokemon.item==getConst(PBItems,:DEAPSEASCALE)) || (isConst?(pokemon.species,PBSpecies,:SPRITZEE) &&
    pokemon.item==getConst(PBItems,:SACHET)) || (isConst?(pokemon.species,PBSpecies,:SWIRLIX) &&
    pokemon.item==getConst(PBItems,:WHIPPEDDREAM)))
    end
    return -1
    end
     
    Last edited:
  • 195
    Posts
    7
    Years
    • Seen May 21, 2024
    There may be an easier way of doing what you're doing, or at least on how it's coded. You can still keep your "Omnistone" item as the primary method.
    The process is pretty much the same as the above post mentions, you add the method at the top of Pokemon_Evolution, add the name in EVONAMES, up until the pbMiniCheckEvolutionItem part of the code.
    Underneath the check for ItemFemale, you can add some slightly different code that's a little easier to read. In my project I called the method ItemTradeEvo:
    Code:
    def pbMiniCheckEvolutionItem(pokemon,evonib,level,poke,item)
      # Checks for when an item is used on the Pokémon (e.g. an evolution stone)
      case evonib
      when PBEvolution::Item
        return poke if level==item
      when PBEvolution::ItemMale
        return poke if level==item && pokemon.isMale?
      when PBEvolution::ItemFemale
        return poke if level==item && pokemon.isFemale?
      # Changed added
      when PBEvolution::ItemTradeEvo
        if level == item
          pairs =[
          [:SEADRA, :DRAGONSCALE],
          [:SCYTHER, :METALCOAT],
          [:ONIX, :METALCOAT],
          [:SLOWPOKE, :KINGSROCK],
          [:POLIWHIRL, :KINGSROCK],
          [:DUSCLOPS, :REAPERCLOTH],
          [:RHYDON, :PROTECTOR],
          [:MAGMAR, :MAGMARIZER],
          [:ELECTABUZZ, :ELECTIRIZER],
          [:FEEBAS, :PRISMSCALE],
          [:PORYGON, :UPGRADE],
          [:PORYGON2, :DUBIOUSDISK],
          [:SLURPUFF, :WHIPPEDDREAM],
          [:SPRITZEE, :SACHET]
          ]
        for p in pairs
          ps = p[0]
          for pi in p [1..-1]
            return poke if isConst?(pokemon.species, PBSpecies, ps) && isConst?(pokemon.item, PBItems, pi)
        end
      end
    end
      # Changed end
    end
      return -1
    end
    end

    This should allow the same method as above, just easier to read.
    If you're going to use this, please credit Marin who made most of the method initially.
     
  • 5
    Posts
    4
    Years
    • Seen Sep 19, 2020
    Yeah, that definitely makes it a lot easier to read and add to for new Pokémon, thanks! I don't think I would have ever thought of the pairs solution.
     
  • 5
    Posts
    4
    Years
    • Seen Sep 19, 2020
    Clamperl should work in the same way, but have a separate entry for both paths, so one pairing for the deep sea scale and one for the deep sea tooth for Gorebyss and Huntail respectively. So whichever item Clamperl is holding when you use the stone (or respective item you have made) should still affect the evolution, similar to if you traded it.
    So like [:CLAMPERL, :DEEPSEASCALE], and [:CLAMPERL, :DEEPSEATOOTH] as Mashirosakura described. In the pokemon.txt document, the evolution method will look the same for both Gorebyss and Huntail though.
     
  • 5
    Posts
    4
    Years
    • Seen Sep 19, 2020
    Okay, I had a realization that this probably wouldn't work as I expected for Clamperl and unfortunately that's the case. Even if they have the right items for their normal evolution, they both evolve into the species defined first in the pokemon.txt file. I will try and figure out a solution to this.
     
  • 5
    Posts
    4
    Years
    • Seen Sep 19, 2020
    I am sure there is a better way to do it, but all I did was make another evolution method the same way and called it StoneHoldItem2. So this way Clamperl has both evolution types, with say StoneHoldItem for Huntail's and StoneHoldItem2 for Gorebyss.

    So to compare the two is just like this in my coding:

    Huntail's
    when PBEvolution::StoneHoldItem
    return poke if level==item && (isConst?(pokemon.species,PBSpecies,:CLAMPERL) && pokemon.item==getConst(PBItems,:DEEPSEATOOTH))

    Gorebyss'
    when PBEvolution::StoneHoldItem2
    return poke if level==item &&( (isConst?(pokemon.species,PBSpecies,:CLAMPERL) && pokemon.item==getConst(PBItems,:DEEPSEASCALE))

    I am sure the paired method works for a single entry but I haven't tried it myself.
     
    Back
    Top