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

[Script] Creating an Inverse Batlle Effect

  • 10
    Posts
    8
    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