• 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!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • PokéCommunity supports the Stop Killing Games movement. If you're a resident of the UK or EU, consider signing one of the petitions to stop publishers from destroying games. Click here for more information!
  • 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.

[Scripting Question] Setting evolution method [level+held item]

  • 5
    Posts
    3
    Years
    • she/they
    • Seen Jan 13, 2024
    Alright, so, I'm aware that this was already asked before here. However, the scripting method used seems to be for an older version of Essentials.

    Effectively, I'd like to set it so that:
    - When an alternate form of Charmeleon reaches X level while holding Y item, they evolve into variant A of Charizard
    - But also if the same form of Charmeleon reaches X level while holding a different Y item, they evolve into variant B of Charizard

    (Preferably in a way where both X and Y are variables I can set, so other forms of other pokemon can evolve into multiple variants of their next forms)
     
    Ok, if this is the script for "Level up AND holding item":
    Spoiler:

    And this is the code for just "Level up":
    Spoiler:

    Maybe I'd want something like:
    Spoiler:


    Obviously this means adding and implementing the required items, but this should work, right?

    EDIT: It didn't work as intended, the pokemon evolved on level up regardless of whether they were the right level
     
    Last edited:
    The current evolution system only accept one parameter. So you need to edit how this system works (PBS compiler/make a list on script like in your example) OR make an evolution method for every item (example with Leftovers):

    Code:
    GameData::Evolution.register({
      :id                   => :HoldItemDelta1,
      :parameter            => :Level,
      :parameter     	=> Integer,
      :level_up_proc        => proc { |pkmn, parameter|
        next pkmn.level == parameter && pkmn.item == :LEFTOVERS
      },
      :after_evolution_proc => proc { |pkmn, new_species, parameter, evo_species|
        next false if evo_species != new_species || !pkmn.hasItem?(:LEFTOVERS)
        pkmn.item = nil   # Item is now consumed
        pkmn.form = 1 # Change form here. Comment this line so won't change form
        next true
      }
    })
     
    Last edited:
    Back
    Top