• 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!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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.

Trainer Pokemon not attacking

  • 119
    Posts
    11
    Years
    hey, i noticed that some trainer pokemon dont attack, for example the only ones i have noticed is the bellsprout line. as soon as i use a move it just loops back to me again, i changed the pokemon to a charmander and it worked fine. is this a common problem? i am using v14
     
    That would be the case. somehow some moves still work even on the opponent side(can't recall what certain moves). but all move will work on player's side although some moves may get the same error because they have no animation.
     
    its not thats they have no animation. they just dont attack at all. the opponent pokemon just wont attack. it will let me consecutively keep on attacking when the opponent pokemon is of the bellsprout line for some reason.
     
    its not thats they have no animation. they just dont attack at all. the opponent pokemon just wont attack. it will let me consecutively keep on attacking when the opponent pokemon is of the bellsprout line for some reason.

    Usually when this happens it's because of how the it is processing a specific move. I don't think it's the pokemon itself, but some type of move that line learns. Figure out what moves it has, and you can narrow down what's causing it. I know it used to do this when your opponent had mirror move, but I think that was fixed. But I'd imagine the error is something of the same variety.
     
    I have encountered a similar error while using Aerial Ace. I was using the Pokemon Staraptor, if it matters.
     
    Usually when this happens it's because of how the it is processing a specific move. I don't think it's the pokemon itself, but some type of move that line learns. Figure out what moves it has, and you can narrow down what's causing it. I know it used to do this when your opponent had mirror move, but I think that was fixed. But I'd imagine the error is something of the same variety.

    OK, so i looked i the pokemon pbs file and bellsprout will only learn vinewhip and growth before lvl 10. and in the trainers txt i made a bellspout that was lvl 10. when i dont assign it moves and it shoudl auto give it moves thats when it doesnt attack. I then tried giving only vinewhip and test it and it worked fine. then i gave it growth only and that worked fine. i dont really know how else to test this but this only seems to happen to this specific line for me. how can i see what the trainer pokemon moves are if the trainers txt only looks like this :
    Code:
    #-------------------
    TEAMSATURN_F
    Grunt
    1
    BELLSPROUT,10
    when it looks like this it works fine
    Code:
    #-------------------
    TEAMSATURN_F
    Grunt
    1
    BELLSPROUT,10,,GROWTH,,,,0,0,,,,20
    
    or 
    #-------------------
    TEAMSATURN_F
    Grunt
    1
    BELLSPROUT,10,,VINEWHIP,,,,0,0,,,,20
     
    In the debug menu set the internal flag on and then do your test battle agains the pokémon with the problem. Then post here the debug log (debuglog.txt) that is located on your project's data folder so we can see where the bug is.

    here is the debug log
    Code:
    Vine Whip: damage 35=>0
       score change: 100=>100
    Vine Whip: final score: 100
    **Exception: undefined method `+' for nil:NilClass
    ["Section072:486:in `pbGetMoveScore'", "Section072:3625:in `pbChooseMoves'", "Section072:3623:in `each'", "Section072:3623:in `pbChooseMoves'", "Section072:4044:in `pbDefaultChooseEnemyCommand'", "Section068:2687:in `pbChooseEnemyCommand'", "Section070:2352:in `pbCommandPhase'", "Section070:2347:in `each'", "Section070:2347:in `pbCommandPhase'", "Section070:2295:in `pbStartBattleCore'", "Section070:2294:in `logonerr'", "Section070:2294:in `pbStartBattleCore'", "Section070:2284:in `loop'", "Section070:2307:in `pbStartBattleCore'", "Section070:2117:in `pbStartBattle'", "Section110:428:in `pbTrainerBattle'", "Section110:427:in `pbSceneStandby'", "Section110:429:in `pbTrainerBattle'", "Section110:426:in `pbBattleAnimation'", "Section110:426:in `pbTrainerBattle'", "(eval):1:in `pbExecuteScript'", "Section020:788:in `eval'", "Section020:243:in `pbExecuteScript'", "Section020:788:in `command_111'", "Section020:320:in `execute_command'", "Section020:193:in `update'", "Section020:106:in `loop'", "Section020:198:in `update'", "Section153:30:in `updateold'", "Section153:28:in `loop'", "Section153:41:in `updateold'", "Section161:151:in `update'", "Section021:68:in `main'", "Section021:65:in `loop'", "Section021:72:in `main'", "Section176:49:in `mainFunctionDebug'", "Section176:27:in `mainFunction'", "Section176:27:in `pbCriticalCode'", "Section176:27:in `mainFunction'", "Section176:59", "Section176:58:in `loop'", "Section176:67"]
    Vine Whip: damage 35=>0
       score change: 100=>100
    Vine Whip: final score: 100
    **Exception: undefined method `+' for nil:NilClass
    ["Section072:486:in `pbGetMoveScore'", "Section072:3625:in `pbChooseMoves'", "Section072:3623:in `each'", "Section072:3623:in `pbChooseMoves'", "Section072:4044:in `pbDefaultChooseEnemyCommand'", "Section068:2687:in `pbChooseEnemyCommand'", "Section070:2352:in `pbCommandPhase'", "Section070:2347:in `each'", "Section070:2347:in `pbCommandPhase'", "Section070:2295:in `pbStartBattleCore'", "Section070:2294:in `logonerr'", "Section070:2294:in `pbStartBattleCore'", "Section070:2284:in `loop'", "Section070:2307:in `pbStartBattleCore'", "Section070:2117:in `pbStartBattle'", "Section110:428:in `pbTrainerBattle'", "Section110:427:in `pbSceneStandby'", "Section110:429:in `pbTrainerBattle'", "Section110:426:in `pbBattleAnimation'", "Section110:426:in `pbTrainerBattle'", "(eval):1:in `pbExecuteScript'", "Section020:788:in `eval'", "Section020:243:in `pbExecuteScript'", "Section020:788:in `command_111'", "Section020:320:in `execute_command'", "Section020:193:in `update'", "Section020:106:in `loop'", "Section020:198:in `update'", "Section153:30:in `updateold'", "Section153:28:in `loop'", "Section153:41:in `updateold'", "Section161:151:in `update'", "Section021:68:in `main'", "Section021:65:in `loop'", "Section021:72:in `main'", "Section176:49:in `mainFunctionDebug'", "Section176:27:in `mainFunction'", "Section176:27:in `pbCriticalCode'", "Section176:27:in `mainFunction'", "Section176:59", "Section176:58:in `loop'", "Section176:67"]
    Vine Whip: damage 35=>0
       score change: 100=>100
    Vine Whip: final score: 100
    **Exception: undefined method `+' for nil:NilClass
    ["Section072:486:in `pbGetMoveScore'", "Section072:3625:in `pbChooseMoves'", "Section072:3623:in `each'", "Section072:3623:in `pbChooseMoves'", "Section072:4044:in `pbDefaultChooseEnemyCommand'", "Section068:2687:in `pbChooseEnemyCommand'", "Section070:2352:in `pbCommandPhase'", "Section070:2347:in `each'", "Section070:2347:in `pbCommandPhase'", "Section070:2295:in `pbStartBattleCore'", "Section070:2294:in `logonerr'", "Section070:2294:in `pbStartBattleCore'", "Section070:2284:in `loop'", "Section070:2307:in `pbStartBattleCore'", "Section070:2117:in `pbStartBattle'", "Section110:428:in `pbTrainerBattle'", "Section110:427:in `pbSceneStandby'", "Section110:429:in `pbTrainerBattle'", "Section110:426:in `pbBattleAnimation'", "Section110:426:in `pbTrainerBattle'", "(eval):1:in `pbExecuteScript'", "Section020:788:in `eval'", "Section020:243:in `pbExecuteScript'", "Section020:788:in `command_111'", "Section020:320:in `execute_command'", "Section020:193:in `update'", "Section020:106:in `loop'", "Section020:198:in `update'", "Section153:30:in `updateold'", "Section153:28:in `loop'", "Section153:41:in `updateold'", "Section161:151:in `update'", "Section021:68:in `main'", "Section021:65:in `loop'", "Section021:72:in `main'", "Section176:49:in `mainFunctionDebug'", "Section176:27:in `mainFunction'", "Section176:27:in `pbCriticalCode'", "Section176:27:in `mainFunction'", "Section176:59", "Section176:58:in `loop'", "Section176:67"]
     
    here is the debug log
    Code:
    Vine Whip: damage 35=>0
       score change: 100=>100
    Vine Whip: final score: 100
    **Exception: undefined method `+' for nil:NilClass
    ["Section072:486:in `pbGetMoveScore'", "Section072:3625:in `pbChooseMoves'", "Section072:3623:in `each'", "Section072:3623:in `pbChooseMoves'", "Section072:4044:in `pbDefaultChooseEnemyCommand'", "Section068:2687:in `pbChooseEnemyCommand'", "Section070:2352:in `pbCommandPhase'", "Section070:2347:in `each'", "Section070:2347:in `pbCommandPhase'", "Section070:2295:in `pbStartBattleCore'", "Section070:2294:in `logonerr'", "Section070:2294:in `pbStartBattleCore'", "Section070:2284:in `loop'", "Section070:2307:in `pbStartBattleCore'", "Section070:2117:in `pbStartBattle'", "Section110:428:in `pbTrainerBattle'", "Section110:427:in `pbSceneStandby'", "Section110:429:in `pbTrainerBattle'", "Section110:426:in `pbBattleAnimation'", "Section110:426:in `pbTrainerBattle'", "(eval):1:in `pbExecuteScript'", "Section020:788:in `eval'", "Section020:243:in `pbExecuteScript'", "Section020:788:in `command_111'", "Section020:320:in `execute_command'", "Section020:193:in `update'", "Section020:106:in `loop'", "Section020:198:in `update'", "Section153:30:in `updateold'", "Section153:28:in `loop'", "Section153:41:in `updateold'", "Section161:151:in `update'", "Section021:68:in `main'", "Section021:65:in `loop'", "Section021:72:in `main'", "Section176:49:in `mainFunctionDebug'", "Section176:27:in `mainFunction'", "Section176:27:in `pbCriticalCode'", "Section176:27:in `mainFunction'", "Section176:59", "Section176:58:in `loop'", "Section176:67"]
    Vine Whip: damage 35=>0
       score change: 100=>100
    Vine Whip: final score: 100
    **Exception: undefined method `+' for nil:NilClass
    ["Section072:486:in `pbGetMoveScore'", "Section072:3625:in `pbChooseMoves'", "Section072:3623:in `each'", "Section072:3623:in `pbChooseMoves'", "Section072:4044:in `pbDefaultChooseEnemyCommand'", "Section068:2687:in `pbChooseEnemyCommand'", "Section070:2352:in `pbCommandPhase'", "Section070:2347:in `each'", "Section070:2347:in `pbCommandPhase'", "Section070:2295:in `pbStartBattleCore'", "Section070:2294:in `logonerr'", "Section070:2294:in `pbStartBattleCore'", "Section070:2284:in `loop'", "Section070:2307:in `pbStartBattleCore'", "Section070:2117:in `pbStartBattle'", "Section110:428:in `pbTrainerBattle'", "Section110:427:in `pbSceneStandby'", "Section110:429:in `pbTrainerBattle'", "Section110:426:in `pbBattleAnimation'", "Section110:426:in `pbTrainerBattle'", "(eval):1:in `pbExecuteScript'", "Section020:788:in `eval'", "Section020:243:in `pbExecuteScript'", "Section020:788:in `command_111'", "Section020:320:in `execute_command'", "Section020:193:in `update'", "Section020:106:in `loop'", "Section020:198:in `update'", "Section153:30:in `updateold'", "Section153:28:in `loop'", "Section153:41:in `updateold'", "Section161:151:in `update'", "Section021:68:in `main'", "Section021:65:in `loop'", "Section021:72:in `main'", "Section176:49:in `mainFunctionDebug'", "Section176:27:in `mainFunction'", "Section176:27:in `pbCriticalCode'", "Section176:27:in `mainFunction'", "Section176:59", "Section176:58:in `loop'", "Section176:67"]
    Vine Whip: damage 35=>0
       score change: 100=>100
    Vine Whip: final score: 100
    **Exception: undefined method `+' for nil:NilClass
    ["Section072:486:in `pbGetMoveScore'", "Section072:3625:in `pbChooseMoves'", "Section072:3623:in `each'", "Section072:3623:in `pbChooseMoves'", "Section072:4044:in `pbDefaultChooseEnemyCommand'", "Section068:2687:in `pbChooseEnemyCommand'", "Section070:2352:in `pbCommandPhase'", "Section070:2347:in `each'", "Section070:2347:in `pbCommandPhase'", "Section070:2295:in `pbStartBattleCore'", "Section070:2294:in `logonerr'", "Section070:2294:in `pbStartBattleCore'", "Section070:2284:in `loop'", "Section070:2307:in `pbStartBattleCore'", "Section070:2117:in `pbStartBattle'", "Section110:428:in `pbTrainerBattle'", "Section110:427:in `pbSceneStandby'", "Section110:429:in `pbTrainerBattle'", "Section110:426:in `pbBattleAnimation'", "Section110:426:in `pbTrainerBattle'", "(eval):1:in `pbExecuteScript'", "Section020:788:in `eval'", "Section020:243:in `pbExecuteScript'", "Section020:788:in `command_111'", "Section020:320:in `execute_command'", "Section020:193:in `update'", "Section020:106:in `loop'", "Section020:198:in `update'", "Section153:30:in `updateold'", "Section153:28:in `loop'", "Section153:41:in `updateold'", "Section161:151:in `update'", "Section021:68:in `main'", "Section021:65:in `loop'", "Section021:72:in `main'", "Section176:49:in `mainFunctionDebug'", "Section176:27:in `mainFunction'", "Section176:27:in `pbCriticalCode'", "Section176:27:in `mainFunction'", "Section176:59", "Section176:58:in `loop'", "Section176:67"]

    In PokeBattle_AI, around line 471, replace this:

    Code:
          when 0x27, 0x28
            if attacker.pbTooHigh?(PBStats::ATTACK) &&
               attacker.pbTooHigh?(PBStats::SPATK)
              score-=90
            else
              score-=attacker.stages[PBStats::ATTACK]*10
              score-=attacker.stages[PBStats::SPATK]*10
              if skill>=PBTrainerAI.mediumSkill
                hasdamagingattack=false
                for thismove in attacker.moves
                  if thismove.id!=0 && thismove.basedamage>0
                    hasdamagingattack=true
                  end
                end
                if hasdamagingattack
                  avg+=20
                elsif skill>=PBTrainerAI.highSkill
                  avg-=90
                end
              end
              if move.function==0x28 # Growth
                score+=20 if pbWeather==PBWeather::SUNNYDAY
              end
            end

    with this:

    Code:
          when 0x27, 0x28
            if attacker.pbTooHigh?(PBStats::ATTACK) &&
               attacker.pbTooHigh?(PBStats::SPATK)
              score-=90
            else
              score-=attacker.stages[PBStats::ATTACK]*10
              score-=attacker.stages[PBStats::SPATK]*10
              if skill>=PBTrainerAI.mediumSkill
                hasdamagingattack=false
                for thismove in attacker.moves
                  if thismove.id!=0 && thismove.basedamage>0
                    hasdamagingattack=true
                  end
                end
                if hasdamagingattack
                  score+=20
                elsif skill>=PBTrainerAI.highSkill
                  score-=90
                end
              end
              if move.function==0x28 # Growth
                score+=20 if pbWeather==PBWeather::SUNNYDAY
              end
            end
     
    In PokeBattle_AI, around line 471, replace this:

    Code:
          when 0x27, 0x28
            if attacker.pbTooHigh?(PBStats::ATTACK) &&
               attacker.pbTooHigh?(PBStats::SPATK)
              score-=90
            else
              score-=attacker.stages[PBStats::ATTACK]*10
              score-=attacker.stages[PBStats::SPATK]*10
              if skill>=PBTrainerAI.mediumSkill
                hasdamagingattack=false
                for thismove in attacker.moves
                  if thismove.id!=0 && thismove.basedamage>0
                    hasdamagingattack=true
                  end
                end
                if hasdamagingattack
                  avg+=20
                elsif skill>=PBTrainerAI.highSkill
                  avg-=90
                end
              end
              if move.function==0x28 # Growth
                score+=20 if pbWeather==PBWeather::SUNNYDAY
              end
            end

    with this:

    Code:
          when 0x27, 0x28
            if attacker.pbTooHigh?(PBStats::ATTACK) &&
               attacker.pbTooHigh?(PBStats::SPATK)
              score-=90
            else
              score-=attacker.stages[PBStats::ATTACK]*10
              score-=attacker.stages[PBStats::SPATK]*10
              if skill>=PBTrainerAI.mediumSkill
                hasdamagingattack=false
                for thismove in attacker.moves
                  if thismove.id!=0 && thismove.basedamage>0
                    hasdamagingattack=true
                  end
                end
                if hasdamagingattack
                  score+=20
                elsif skill>=PBTrainerAI.highSkill
                  score-=90
                end
              end
              if move.function==0x28 # Growth
                score+=20 if pbWeather==PBWeather::SUNNYDAY
              end
            end

    JV that also fixed my problem thank you. :)
     
    Same problem with the moves Bulk up (0x24) and Coil (0x25). change this

    Code:
                if hasphysicalattack
                  avg+=20
                elsif skill>=PBTrainerAI.highSkill
                  avg-=90
    to

    Code:
                if hasphysicalattack
                  score+=20
                elsif skill>=PBTrainerAI.highSkill
                  score-=90
    PS: works fine for me, not sure if it's correct.
     
    Yeah, there are plenty of little typos in the Pokebattle AI that triggers those bugs, however it's pretty easy to fix them if you use the Internal Flag correctly to identify them.

    If only i knew how to do this lol, im a noob at scripting so for me its not as easy as it should be
     
    Is anyone else having issues with Shuckle?


    i made a battle with shuckle. and he uses double team then he stops attacking so i keep attacking shuckle with out giving shuckle a turn to attack.
     
    Last edited:
    ---------------------------
    Pokémon Liquid Blue
    ---------------------------
    Exception: ArgumentError

    Message: wrong number of arguments(3 for 2)

    PokeBattle_AI:1821:in `pbCanSleep?'

    PokeBattle_AI:1821:in `pbGetMoveScore'

    PokeBattle_AI:3625:in `pbChooseMoves'

    PokeBattle_AI:3623:in `each'

    PokeBattle_AI:3623:in `pbChooseMoves'

    PokeBattle_AI:4044:in `pbDefaultChooseEnemyCommand'

    PokeBattle_ActualScene:2686:in `pbChooseEnemyCommand'

    PokeBattle_Battle:2334:in `pbCommandPhase'

    PokeBattle_Battle:2329:in `each'

    PokeBattle_Battle:2329:in `pbCommandPhase'

    PokeBattle_Battle:2277:in `pbStartBattleCore'

    PokeBattle_Battle:2276:in `logonerr'

    PokeBattle_Battle:2276:in `pbStartBattleCore'

    PokeBattle_Battle:2266:in `loop'

    PokeBattle_Battle:2289:in `pbStartBattleCore'

    PokeBattle_Battle:2099:in `pbStartBattle'

    PokemonTrainers:428:in `pbTrainerBattle'

    PokemonTrainers:427:in `pbSceneStandby'

    PokemonTrainers:429:in `pbTrainerBattle'

    PokemonTrainers:426:in `pbBattleAnimation'

    PokemonTrainers:426:in `pbTrainerBattle'

    (eval):1:in `pbExecuteScript'

    Interpreter:788:in `eval'

    Interpreter:243:in `pbExecuteScript'

    Interpreter:788:in `command_111'



    This exception was logged in

    C:\Users\Breits\Saved Games/Pokémon Liquid Blue/errorlog.txt.

    Press Ctrl+C to copy this message to the clipboard.
    ---------------------------
    OK
    ---------------------------
    I get this message when Shuckle wont attack. i can only attack. can someone help me out.
     
    Back
    Top