• 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!
  • 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] How do I check if a Pokemon is NOT Wishiwashi using code?

  • 428
    Posts
    5
    Years
    if isSpecies?(:WISHIWASHI) && self.ability == :SCHOOLING
    if @level>=20 && @hp>@totalhp/4
    if @form!=1
    @battle.pbShowAbilitySplash(self,true)
    @battle.pbHideAbilitySplash(self)
    pbChangeForm(1,_INTL("{1} formed a school!",pbThis))
    end
    elsif @form!=0
    @battle.pbShowAbilitySplash(self,true)
    @battle.pbHideAbilitySplash(self)
    pbChangeForm(0,_INTL("{1} stopped schooling!",pbThis))
    end
    end

    That's the code Wishiwashi uses to determine if it's Wishiwashi and if it has the ability Schooling.

    I had this idea where the code could then check if the user is NOT Wishiwashi but has this ability anyway, and if that's the case, boost the user's stats. And if the user's HP drops to the point where Wishiwashi's Schooling ability would deactivate, remove the boosted stat effect. It'd have to be a less severe stat boost, but I can playtest the numbers and figure out how reduced the stat-buff should be once the code works.
     
    Last edited:
    To check for if it's not you need to use ! At the beginning

    Code:
    !isSpecies?(:WISHIWASHI)

    You could also modify your code so that there's an "elsif self.ability == :SCHOOLING" on the if isSpecies?(:WISHIWASHI) && self.ability == :SCHOOLING

    i.e.

    Code:
    if isSpecies?(:WISHIWASHI) && self.ability == :SCHOOLING
        # Is Wishiwashi & has schooling ability
    elsif self.ability == :SCHOOLING
        # Isn't Wishiwashi but has schooling ability
    end
     
    Last edited:
    Thank you! Right now there's an error keeping the game from turning on.

    [Pokémon Essentials version 19.1]
    [Generation 8 Project v1.1.0]
    [v19.1 Hotfixes 1.0.7]

    Exception: ArgumentError
    Message: invalid byte sequence in UTF-8

    Backtrace:
    368:Compiler:105:in `[]'
    368:Compiler:105:in `block in pbEachFileSectionEx'
    368:Compiler:100:in `each_line'
    368:Compiler:100:in `pbEachFileSectionEx'
    368:Compiler:134:in `pbEachFileSection'
    369:Compiler_CompilePBS:389:in `block in compile_pokemon'
    369:Compiler_CompilePBS:383:in `open'
    369:Compiler_CompilePBS:383:in `compile_pokemon'
    368:Compiler:704:in `compile_all'
    [v19.1 Hotfixes] Debug bug fixes.rb:68:in `compile_all'

    I've looked at the text the error message speaks of, and nothing appears out of the ordinary. There are no coding errors in the PBS. I've seen this error before and fixed it by copypasting over a backup copy of the problem file from a backup of my work, from before I made any changes to these files. Does Wordpad do something UTF-8 doesn't like? Because right now it seems these files cannot be edited in any way at all without making the entire game unable to run.
     
    Thank you, Notepad++ seems a lot better. What file was causing the error there?

    [Pokémon Essentials version 19.1]
    [Generation 8 Project v1.1.0]
    [v19.1 Hotfixes 1.0.7]

    Exception: ArgumentError
    Message: invalid byte sequence in UTF-8

    Backtrace:
    368:Compiler:105:in `[]'
    368:Compiler:105:in `block in pbEachFileSectionEx'
    368:Compiler:100:in `each_line'
    368:Compiler:100:in `pbEachFileSectionEx'
    368:Compiler:134:in `pbEachFileSection'
    369:Compiler_CompilePBS:389:in `block in compile_pokemon'
    369:Compiler_CompilePBS:383:in `open'
    369:Compiler_CompilePBS:383:in `compile_pokemon'
    368:Compiler:704:in `compile_all'
    [v19.1 Hotfixes] Debug bug fixes.rb:68:in `compile_all'
     
    Last edited:
    Back
    Top