• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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.

[Custom Feature Question] Evolving with Linking Cord while holding an Item

  • 37
    Posts
    5
    Years
    • Seen Mar 11, 2025
    Hi!

    I'm working on a fangame, and I'm trying to remove (or semi-push aside) the need for evolving Pokémon through trading, the same way the Linking Cord did it in Legends Arceus. And while this isn't a problem to do in most cases, since most Pokémon only has one Trade Evolution (like how Poliwhirl becomes Poliwrath with a Water Stone, but if traded while holding a King's Rock, it will become Politoed), I now realize that I've run into a problem for the last few that do have more than one (i.e. Clamperl evolving into either Gorebyss or Huntail while trading while holding specific items)

    I have no plans to really include Clamperl, so I could just ignore and make it the one exception.

    However, the completionist inside me demands that I do all of them right.


    So can I set up an evolution method that would make a Pokémon capable of evolving when using a Linking Cord, but ONLY while also holding a specific item?

    Is this possible, and if so, how would I go about that?
     
    So the annoying thing is you can only check one thing at a time with the parameter.
    You didn't post your current code. Or what version you're on. I have a v20 sandbox project already set up, so you're getting v20 code.

    Here's a new LinkingCord evo type for consistency between the no item and held item variants
    Code:
    GameData::Evolution.register({
      :id            => :LinkingCord,
      :use_item_proc => proc { |pkmn, parameter, item|
        next item == :LINKINGCORD
      }
    })
    GameData::Evolution.register({
      :id            => :LinkingCordHeldItem,
      :parameter     => :Item,
      :use_item_proc => proc { |pkmn, parameter, item|
        next item == :LINKINGCORD && pkmn.item == parameter
      },
      :after_evolution_proc => proc { |pkmn, new_species, parameter, evo_species|
        next false if evo_species != new_species || !pkmn.hasItem?(parameter)
        pkmn.item = nil   # Item is now consumed
        next true
      }
    })
     
    Back
    Top