• 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.

[Scripting Question] New Evolution Method (Quick question)

971
Posts
7
Years
    • Age 21
    • Seen Nov 28, 2022
    I'm trying to make an evolution method where a Pokémon evolves if certain Pokémon (plural or single) is in the player's party. While checking for other Pokémon to be isn't hard at all, I want it to be able to check for two or even three of the same Pokémon. Here is an example:
    Code:
      when PBEvolution::StackOne
        if pokemon.level>=level
          for i in $Trainer.party
            return poke if i.isConst?(pokemon.species,PBSpecies,:TURTONATOR)
          end
        end
    I want my Turtonator here to evolve if besides itself, there is another Turtonator in the player's party. How would I check for that?

    PS: The method itself is already setup properly, but I don't think you really need to see that as it's irrelevant.

    EDIT: To summarize everything, I want something like HasInParty, but I want to be able to check for two Pokémon (The one evolving and another one in the party).
     
    Last edited:
    824
    Posts
    8
    Years
  • Code:
      when PBEvolution::StackOne
        if pokemon.level>=level
          j=0
          for i in $Trainer.party
            j+=1 if i.isConst?(pokemon.species,PBSpecies,:TURTONATOR)
          end
        end
        return poke if j>=2
     
    971
    Posts
    7
    Years
    • Age 21
    • Seen Nov 28, 2022
    Code:
      when PBEvolution::StackOne
        if pokemon.level>=level
          j=0
          for i in $Trainer.party
            j+=1 if i.isConst?(pokemon.species,PBSpecies,:TURTONATOR)
          end
        end
        return poke if j>=2

    Thanks for your help, but something doesn't work. I played around a bit, and from what I tested, J goes up six times if there is A Turtonator in the party. When I changed if j>=6, it still returned, but when I changed it to j>=7, it didn't.
    From what it looks like, the rest is working. It doesn't do anything if I tell it to look for any other Pokémon that's not in my party, which is what I want.
     
    824
    Posts
    8
    Years
  • Thanks for your help, but something doesn't work. I played around a bit, and from what I tested, J goes up six times if there is A Turtonator in the party. When I changed if j>=6, it still returned, but when I changed it to j>=7, it didn't.
    From what it looks like, the rest is working. It doesn't do anything if I tell it to look for any other Pokémon that's not in my party, which is what I want.

    There's a syntax error in what I gave you.

    Code:
      when PBEvolution::StackOne
        if pokemon.level>=level
          j=0
          for i in $Trainer.party
            j+=1 if isConst?(i.species,PBSpecies,:TURTONATOR)
          end
        end
        return poke if j>=2

    It went up 6 times because it was checking the evolver's species each time, not the party member's.
     
    971
    Posts
    7
    Years
    • Age 21
    • Seen Nov 28, 2022
    There's a syntax error in what I gave you.

    Code:
      when PBEvolution::StackOne
        if pokemon.level>=level
          j=0
          for i in $Trainer.party
            j+=1 if isConst?(i.species,PBSpecies,:TURTONATOR)
          end
        end
        return poke if j>=2

    It went up 6 times because it was checking the evolver's species each time, not the party member's.

    Right! I really should've seen that... Thanks, though. I'll test it tomorrow.
     
    971
    Posts
    7
    Years
    • Age 21
    • Seen Nov 28, 2022
    Right! I really should've seen that... Thanks, though. I'll test it tomorrow.

    It's obviously working wonderfully, but I want it to delete the second Pokémon it finds, so it's actually "stacking" or "fusing". Even if there are three of the species, the first one will evolve and the second one will be deleted, and the third one will remain untouched. Is this doable? It would've probably been smart to have said that right at the beginning.
     
    824
    Posts
    8
    Years
  • Code:
    if evonib==PBEvolution::StackOne
      for i in 0...6
        if $Trainer.party[i]==@pokemon
        elsif $Trainer.party[i][email protected]
          $Trainer.party[i]=nil
          $Trainer.party.compact!
          break
        end
      end
    end

    Insert this beneath line 838 of Pokemon_Evolution. Assuming you haven't edited that script section, that should be above the code that creates Shedinja when Nincada evolves into Ninjask.
     
    Back
    Top