• 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!
  • Cyndy, May, Hero (Conquest), or Wes - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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] Surrender Script [help/question]

---------------------------
Pokemon Essentials
---------------------------
[Pokémon Essentials version 17.2]

Exception: NoMethodError

Message: undefined method `include' for [56, 57, 58]:Array

PokeBattle_Battle:1606:in `pbRun_ebs'

EliteBattle_0:287:in `pbRun'

PokeBattle_Battle:2696:in `pbCommandPhase_ebs'

PokeBattle_Battle:2640:in `loop'

PokeBattle_Battle:2730:in `pbCommandPhase_ebs'

PokeBattle_Battle:2629:in `each'

PokeBattle_Battle:2629:in `pbCommandPhase_ebs'

EliteBattle_0:294:in `pbCommandPhase'

EliteBattle_0:224:in `pbStartBattleCore'

EliteBattle_0:223:in `logonerr'



.. I should really try to get a grasp on Ruby, so I can even understand what's going on when this kinda things happen :v

My fault, my fault.
Change
Code:
 !banrun.include(pbGetOwner(1).trainertype)
to
Code:
 !banrun.include[b]?[/b](pbGetOwner(1).trainertype)
I tested and fixed it but forgot to update the code in the post at the same time.
 
My fault, my fault.
Change
Code:
 !banrun.include(pbGetOwner(1).trainertype)
to
Code:
 !banrun.include[b]?[/b](pbGetOwner(1).trainertype)
I tested and fixed it but forgot to update the code in the post at the same time.

that's quite alright, one thing tho;
if you go back on the decision to surrender to a regular trainer i gives you the same response as if you were trying to surrender to team rocket " You can't forfeit to these guys!"

.. would adding another else fix that? or would it have to be another elsif for when you trying to escape from regular trainers?
 
Sorry, I guess I should have tested in more depth.
change this
Code:
    if @opponent
      banrun=[getID(PBTrainers,:TEAMROCKET_M),
              getID(PBTrainers,:TEAMROCKET_F),
              getID(PBTrainers,:ROCKETBOSS)]
      if $DEBUG && Input.press?(Input::CTRL)
        if pbDisplayConfirm(_INTL("Treat this battle as a win?"))
          @decision=1
          return 1
        elsif pbDisplayConfirm(_INTL("Treat this battle as a loss?"))
          @decision=2
          return 1
        end
      elsif !banrun.include?(pbGetOwner(1).trainertype) && 
          pbDisplayConfirm(_INTL("Would you like to forfeit the match and quit now?"))
        pbSEPlay("Battle flee")
        pbDisplay(_INTL("{1} forfeited the match!",self.pbPlayer.name))
        @decision=3
        return 1
      else
        pbDisplayPaused(_INTL("No! You can't forfeit to these guys!"))
      end
      return 0
    end
to this
Code:
    if @opponent
      banrun=[getID(PBTrainers,:TEAMROCKET_M),
              getID(PBTrainers,:TEAMROCKET_F),
              getID(PBTrainers,:ROCKETBOSS)]
      if $DEBUG && Input.press?(Input::CTRL)
        if pbDisplayConfirm(_INTL("Treat this battle as a win?"))
          @decision=1
          return 1
        elsif pbDisplayConfirm(_INTL("Treat this battle as a loss?"))
          @decision=2
          return 1
        end
      elsif !banrun.include?(pbGetOwner(1).trainertype)
        if pbDisplayConfirm(_INTL("Would you like to forfeit the match and quit now?"))
          pbSEPlay("Battle flee")
          pbDisplay(_INTL("{1} forfeited the match!",self.pbPlayer.name))
          @decision=3
          return 1
        else
          return 0
        end
      else
        pbDisplayPaused(_INTL("No! You can't forfeit to these guys!"))
      end
      return 0
    end
 
Sorry, I guess I should have tested in more depth.
change this
Code:

thanks i'll be sure to try it as soon as i can!
thanks again, here have a little something for your time
[PokeCommunity.com] Surrender Script [help/question]


sorry for the bad quality, im currently dealing with art block XD
 
Last edited:
Back
Top