• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Scottie, Todd, Serena, Kris - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

Use Item on limited pokemon [solved]

  • 4
    Posts
    10
    Years
    • Seen Feb 17, 2017
    Is it possible to create an item that you can only use on some species of pokemon, I want the item to do similar things as protein, iron, calcium ect But to be only work on certain pokemon such as starters.

    I tried looking at stone evolution methods but upon compiling my script it kept breaking as im not sure where to put it.

    __

    I am trying to make it so the item Upgrade can only be used on Porygon, and for it to increase its base happiness as I want it to evolve through happiness.

    UnderchangeHappiness among the other items i added in what i want upgrade to do.
    Code:
    when "Upgrade"
            gain=5
            gain=200 if @happiness<200

    I think that is right.

    And under ItemEffects I want something like this

    Code:
    ItemHandlers::UseOnPokemon.add(:UPGRADE,proc{|item,pokemon,scene|
      
      if pb.isSpecies(PORYGON) 
        scene.pbDisplay(_INTL("It won't have any effect."))
         next false
       else
         scene.pbDisplay(_INTL("{1} Seems to be growing at a very fast rate",pokemon.name))
         pokemon.changeHappiness("Upgrade")
         next true
       end
    })

    But i dont know the correct way to make it so its only Porygon can have this item used on it. This doesn't compile because if pb.isSpecies(PORYGON) is just my pseudo code I dont know how to check for the species.

    __

    Thank you mej!

    Code:
    ItemHandlers::UseOnPokemon.add(:UPGRADE,proc{|item,pokemon,scene|
       if pokemon.species != getID(PBSpecies,:PORYGON)
         scene.pbDisplay(_INTL("It won't have any effect."))
         next false
       else
          scene.pbDisplay(_INTL("{1} Seems to be growing at a very fast rate",pokemon.name))
          pokemon.changeHappiness("Upgrade")
          next true
         
       end
    })
     
    Last edited:
    Is it possible to create an item that you can only use on some species of pokemon, I want the item to do similar things as protein, iron, calcium ect But to be only work on certain pokemon such as starters.

    I tried looking at stone evolution methods but upon compiling my script it kept breaking as im not sure where to put it.

    You're looking in the right place, it should be in PokemonItemEffects. Show us what you have and we can help you correct it.
     
    Back
    Top