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

Trainers with Multiple Pokemon Refuse to Send Them Out?

30
Posts
10
Years
    • Seen Mar 25, 2017
    I'm not quite sure what I did, but in my game, any trainer with two or more Pokemon refuses to send any of them out after I defeat one of them. I don't know which script affects this, and I have no clue how to fix this.

    Wild battles and Trainers with only one Pokemon work just fine, but other battles are broken. Also, the Pokemon's sprite lingers after it has fainted, which probably is connected to the problem.
     
    Last edited:
    30
    Posts
    10
    Years
    • Seen Mar 25, 2017
    I've edited:

    Compiler (to extend Pokemon names to 12 characters)
    PokemonPokedex
    PokeBattle_Move
    TypesExtra
    PokeBattle_Pokemon

    I haven't edited Pokebattle_AI, so I don't see why the battles are working the way they are right now. I can't show what I mean since I haven't hit 15 posts yet, so that doesn't help.
     

    Radical Raptr

    #BAMFPokemonNerd
    1,124
    Posts
    13
    Years
  • try a stock essentials and make sure it works, then one by one add in your new codes and keep testing afyer each one until you find the one that breaks it
     
    30
    Posts
    10
    Years
    • Seen Mar 25, 2017
    Trainers with Multiple Pokemon Refuse to Send Them Out?


    Trainers with Multiple Pokemon Refuse to Send Them Out?


    What could possibly have caused this? I must have broken something, but which script would affect this?

    (BOSS BUS has no backsprite yet, so that's not the problem.

    PBWeather
    Code:
    begin
      class PBWeather
        SUNNYDAY  = 1
        RAINDANCE = 2
        SANDSTORM = 3
        HAIL      = 4
        LIGHTNING = 5
        FOG       = 6
        TORNADO   = 7
      end

    PBTypesExtra
    Spoiler:

    PokemonSummary

    Spoiler:

    PokeBattle_MoveEffects

    Spoiler:

    PokeBattle_Pokemon

    Spoiler:

    PokeBattle_Battler

    Code:
      attr_reader :totalhp
      attr_reader :fainted
      attr_reader :usingsubmove
      attr_accessor :lastAttacker
      attr_accessor :turncount
      attr_accessor :effects
      attr_accessor :species
      attr_accessor :type1
      attr_accessor :type2
      attr_accessor :type3
      attr_accessor :ability

    Code:
      def pbInitBlank
        @name         = ""
        @species      = 0
        @level        = 0
        @hp           = 0
        @totalhp      = 0
        @gender       = 0
        @ability      = 0
        @type1        = 0
        @type2        = 0
        @type3        = 0

    Code:
      end
    
      def pbUpdate(fullchange=false)
        if @pokemon
          @pokemon.calcStats
          @level     = @pokemon.level
          @hp        = @pokemon.hp
          @totalhp   = @pokemon.totalhp
          if !@effects[PBEffects::Transform]
            @attack    = @pokemon.attack
            @defense   = @pokemon.defense
            @speed     = @pokemon.speed
            @spatk     = @pokemon.spatk
            @spdef     = @pokemon.spdef
            if fullchange
              @ability = @pokemon.ability
              @type1   = @pokemon.type1
              @type2   = @pokemon.type2
              @type3   = @pokemon.type3
            end
          end
        end

    Code:
      def pbHasType?(type)
        if type.is_a?(Symbol) || type.is_a?(String)
          ret=isConst?(self.type1,PBTypes,type.to_sym) ||
             isConst?(self.type2,PBTypes,type.to_sym) ||
             isConst?(self.type3,PBTypes,type.to_sym)
          return ret
        else
          return (self.type1==type||self.type2==type||self.type3==type)
        end

    PokeBattle_Move

    Spoiler:

    PokeBattle_Battle

    Spoiler:
     

    Nickalooose

    --------------------
    1,309
    Posts
    16
    Years
    • Seen Dec 28, 2023
    Try commenting out all the type3 things in PokeBattle_? or remove them.
     
    30
    Posts
    10
    Years
    • Seen Mar 25, 2017
    I most likely did something wrong in the AI...

    Code:
    def pbTypeModifier(type,attacker,opponent)
        return 4 if type<0
        return 4 if isConst?(type,PBTypes,:GROUND) && opponent.pbHasType?(:FLYING) &&
                    isConst?(opponent.item,PBItems,:IRONBALL)
        atype=type
        otype1=opponent.type1
        otype2=opponent.type2
        otype3=opponent.type3
        if isConst?(otype1,PBTypes,:FLYING) && opponent.effects[PBEffects::Roost]
          if isConst?(otype2,PBTypes,:FLYING)
            otype1=getConst(PBTypes,:NORMAL) || 0
          else
            otype1=otype2
          end
        end
        if isConst?(otype2,PBTypes,:FLYING) && opponent.effects[PBEffects::Roost]
          otype2=otype1
        end
        mod1=PBTypes.getEffectiveness(atype,otype1)
        mod2=(otype1==otype2) ? 2 : PBTypes.getEffectiveness(atype,otype2)
        if isConst?(attacker.ability,PBAbilities,:SCRAPPY) || opponent.effects[PBEffects::Foresight]
          mod1=2 if isConst?(otype1,PBTypes,:GHOST) &&
             (isConst?(atype,PBTypes,:NORMAL) || isConst?(atype,PBTypes,:FIGHTING))
          mod2=2 if isConst?(otype2,PBTypes,:GHOST) &&
             (isConst?(atype,PBTypes,:NORMAL) || isConst?(atype,PBTypes,:FIGHTING))
        end
        if opponent.effects[PBEffects::MiracleEye]
          mod1=2 if isConst?(otype1,PBTypes,:DARK) && isConst?(atype,PBTypes,:PSYCHIC)
          mod2=2 if isConst?(otype2,PBTypes,:DARK) && isConst?(atype,PBTypes,:PSYCHIC)
        end
        return mod1*mod2
      end
    
      def pbTypeModifier2(battlerThis,battlerOther)
        if battlerThis.type1==battlerThis.type2
          return 4*pbTypeModifier(battlerThis.type1,battlerThis,battlerOther)
        else
          ret=pbTypeModifier(battlerThis.type1,battlerThis,battlerOther)
          ret*=pbTypeModifier(battlerThis.type2,battlerThis,battlerOther)
          return ret # 0,1,2,4,8,_16_,32,64,128,256
        end
      end
    
      def pbRoughStat(battler,stat)
        stagemul=[10,10,10,10,10,10,10,15,20,25,30,35,40]
        stagediv=[40,35,30,25,20,15,10,10,10,10,10,10,10]
        stage=battler.stages[stat]
        value=0
        value=battler.attack if stat==PBStats::ATTACK
        value=battler.defense if stat==PBStats::DEFENSE
        value=battler.speed if stat==PBStats::SPEED
        value=battler.spatk if stat==PBStats::SPATK
        value=battler.spdef if stat==PBStats::SPDEF
        return (value*stagemul[stage]/stagediv[stage]).floor
      end
     
    302
    Posts
    13
    Years
    • Seen Aug 25, 2014
    Don't know if it's been brought up, but have you made sure you specified how many Pokemon a trainer has in the PBS file Trainers.txt?
     
    30
    Posts
    10
    Years
    • Seen Mar 25, 2017
    Yes, I have; however, the trainer battles still malfunction even if the proper number of Pokemon is given in the .txt.
     

    Nickalooose

    --------------------
    1,309
    Posts
    16
    Years
    • Seen Dec 28, 2023
    try a stock essentials and make sure it works, then one by one add in your new codes and keep testing afyer each one until you find the one that breaks it

    Enough said really... If you're going to totally ignore advice, stop asking for help!
    P.S. Why would you edit Pokemon AI? In all my time of Essentials and scripting, I have never edited the AI!
     
    30
    Posts
    10
    Years
    • Seen Mar 25, 2017
    Enough said really... If you're going to totally ignore advice, stop asking for help!
    P.S. Why would you edit Pokemon AI? In all my time of Essentials and scripting, I have never edited the AI!

    I just need the right scripts to look in. The AI has a section on type matchups, so I needed to adjust some of that to create support for 3-type Pokemon.
     

    Nickalooose

    --------------------
    1,309
    Posts
    16
    Years
    • Seen Dec 28, 2023
    That's still not going to happen, you're pin pointing the AI, then remove your scripts... Why are you making this so hard...? Until you remove your scripts and slowly add your custom ones, you're not going to know where the problem is, because we didn't add any scripts, you did.
     
    Back
    Top