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

[Script] Creating an Inverse Batlle Effect

  • 10
    Posts
    9
    Years
    I'm working in Pokemon Essentials v17.2, and trying to create a move that turns the battle into an Inverse Battle, Trick Room style. I'm currently running into an error though, in the PokeBattle_Battler script, with a NoMethodError, with the text underneath being "undefined method 'effects' for nil:NilClass". The code I'm using is as follows, and the error is on "if @field.effects[PBEffects::InverseRoom]>0"

    # Inverse Room
    if @field.effects[PBEffects::InverseRoom]>0
    @field.effects[PBEffects::InverseRoom]-=1
    if @field.effects[PBEffects::InverseRoom]==0
    pbDisplay(_INTL("Inverse Room wore off, and type effectiveness returned to normal!"))
    PBDebug.log("[End of effect] Inverse Room ended")
    end
    end

    I've set up an effect in PBEffects and PokeBattle_ActiveSideField in the correct section, and set up the effect in PokeBattle_MoveEffects, and what it actually does in PokeBattle_Move (since it directly changes type effectiveness). Everything is spelled the same way everywhere.

    Anyone know why I'm getting this error and how to fix it?

    I've set up an effect in PBEffects and PokeBattle_ActiveSideField in the correct section, and set up the effect in PokeBattle_MoveEffects, and what it actually does in PokeBattle_Move (since it directly changes type effectiveness). Everything is spelled the same way everywhere.

    Anyone know why I'm getting this error and how to fix it?
     
    Back
    Top