Scripts, Tutorials & Tools This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.

Ad Content
Reply
 
Thread Tools
  #26   Link to this post, but load the entire thread.  
Old August 17th, 2014 (9:26 AM).
Lusus's Avatar
Lusus Lusus is offline
     
    Join Date: Jan 2013
    Location: Ljubljana
    Age: 19
    Gender: Other
    Nature: Lonely
    Posts: 1,405
    Quote:
    Originally Posted by J the Gamer View Post
    And is it worth paying $70 to get
    It only costs around 24$, if you plan on actually completing your game, it is worth it.
    Reply With Quote
      #27   Link to this post, but load the entire thread.  
    Old August 17th, 2014 (9:30 AM).
    J the Gamer's Avatar
    J the Gamer J the Gamer is offline
       
      Join Date: Aug 2014
      Location: United States,Iowa
      Age: 18
      Gender: Male
      Nature: Relaxed
      Posts: 31
      One website was actually selling it for 70$ I was looking at it but it didn't seem right
      __________________
      This signature has been disabled.
      Too tall!
      Please review and fix the issues by reading the signature rules.

      You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

      Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.
      Reply With Quote
        #28   Link to this post, but load the entire thread.  
      Old August 23rd, 2014 (1:51 PM).
      Florio's Avatar
      Florio Florio is offline
      Pokemon Crimson Skies Owner
         
        Join Date: Nov 2008
        Location: Canada
        Gender: Male
        Nature: Lax
        Posts: 392
        Honestly this script seems somewhat unnecessary. Editing the PBS is easy enough, and if you make your Trainer's VIA this method then you can't easily change the Pokemon after. Sometimes I change around the Pokemon in my game and the Trainer's to and Ctrl+H and Ctrl+F come in handy while using the trainers PBS file. I feel like this would make the game more unorganized overall. But still, it seems useful for people who aren't as accustomed to Essentials.
        __________________
        Reply With Quote
          #29   Link to this post, but load the entire thread.  
        Old October 8th, 2014 (7:55 AM).
        sword's Avatar
        sword sword is offline
        LETS HACK.
           
          Join Date: May 2014
          Location: Kalos
          Gender: Male
          Nature: Calm
          Posts: 99
          What Tool You Are Using Can You Tell Me the Link To Download It
          __________________
          Reply With Quote
            #30   Link to this post, but load the entire thread.  
          Old April 24th, 2015 (10:00 AM). Edited April 24th, 2015 by TACHAN.
          TACHAN TACHAN is offline
             
            Join Date: Jan 2010
            Gender: Female
            Posts: 198
            I tried to create a trainer but it causes error message.

            Spoiler:
            Exception: RuntimeError
            Message: Script error within event 190, map 188 (TEST):
            Exception: NameError
            Message: (eval):21:in `pbExecuteScript'undefined local variable or method `pokemon' for #<Interpreter:0x10acc0a0>
            ***Full script:
            p0 = createPokemon("PIKACHU", 100)
            p0.iv[0] = 30
            p0.iv[1] = 31
            p0.iv[2] = 30
            p0.iv[3] = 31
            p0.iv[4] = 31
            p0.iv[5] = 31
            p0.ev[0] = 6
            p0.ev[1] = 0
            p0.ev[2] = 0
            p0.ev[3] = 252
            p0.ev[4] = 252
            p0.ev[5] = 0
            p0.natureflag = PBNatures::TIMID
            p0.abilityflag = 0
            p0.genderflag = 0
            p0.moves = PBMoves::THUNDER
            p0.moves = PBMoves::SURF
            p0.moves = PBMoves::GRASSKNOT
            p0.moves = PBMoves::HIDDENPOWER
            pokemon.calcStats
            party = [p0]
            trainer = createTrainer(140, "RED2", party)
            result = customTrainerBattle(trainer, "...!")
            pbSet(1, result == BR_WIN ? 0 : 1)
            Interpreter:243:in `pbExecuteScript'
            Interpreter:1606:in `eval'
            Interpreter:243:in `pbExecuteScript'
            Interpreter:1606:in `command_355'
            Interpreter:494:in `execute_command'
            Interpreter:193:in `update'
            Interpreter:106:in `loop'
            Interpreter:198:in `update'
            Scene_Map:103:in `updateOldFL'
            Scene_Map:101:in `loop'
            Interpreter:276:in `pbExecuteScript'
            Interpreter:1606:in `command_355'
            Interpreter:494:in `execute_command'
            Interpreter:193:in `update'
            Interpreter:106:in `loop'
            Interpreter:198:in `update'
            Scene_Map:103:in `updateOldFL'
            Scene_Map:101:in `loop'
            Scene_Map:114:in `updateOldFL'


            Spoiler:



            EDIT: I changed "pokemon.calcStats" for "p0.calcStats" and it fixed up.
            But when the trainer is going to use the Pokemon in battle, another error message:

            Spoiler:

            Exception: RuntimeError
            Message: Script error within event 190, map 188 (TEST):
            Exception: NoMethodError
            Message: Section078:43:in `initialize'undefined method `pp' for 1:Fixnum
            ***Full script:
            p0 = createPokemon("PIKACHU", 100)
            p0.iv[0] = 30
            p0.iv[1] = 31
            p0.iv[2] = 30
            p0.iv[3] = 31
            p0.iv[4] = 31
            p0.iv[5] = 31
            p0.ev[0] = 6
            p0.ev[1] = 0
            p0.ev[2] = 0
            p0.ev[3] = 252
            p0.ev[4] = 252
            p0.ev[5] = 0
            p0.natureflag = PBNatures::TIMID
            p0.abilityflag = 0
            p0.genderflag = 0
            p0.moves = PBMoves::THUNDER
            p0.moves = PBMoves::SURF
            p0.moves = PBMoves::GRASSKNOT
            p0.moves = PBMoves::HIDDENPOWER
            p0.calcStats
            party = [p0]
            trainer = createTrainer(140, "RED2", party)
            result = customTrainerBattle(trainer, "...!")
            pbSet(1, result == BR_WIN ? 0 : 1)
            Interpreter:243:in `pbExecuteScript'
            PokeBattle_Move:54:in `new'
            PokeBattle_Move:54:in `pbFromPBMove'
            PokeBattle_Battler:212:in `__shadow_pbInitPokemon'
            Pokemon_ShadowPokemon:524:in `pbInitPokemon'
            PokeBattle_Battler:438:in `pbInitialize'
            PokeBattle_Battle:2602:in `pbStartBattleCore'
            PokeBattle_Battle:2494:in `pbStartBattle'
            CUSTOM TRAINER:173:in `customTrainerBattle'
            CUSTOM TRAINER:172:in `pbSceneStandby'
            Interpreter:276:in `pbExecuteScript'
            Interpreter:1606:in `command_355'
            Interpreter:494:in `execute_command'
            Interpreter:193:in `update'
            Interpreter:106:in `loop'
            Interpreter:198:in `update'
            Scene_Map:103:in `updateOldFL'
            Scene_Map:101:in `loop'
            Scene_Map:114:in `updateOldFL'
            Reply With Quote
              #31   Link to this post, but load the entire thread.  
            Old April 24th, 2015 (12:06 PM).
            Maruno's Avatar
            Maruno Maruno is offline
            Lead Dev of Pokémon Essentials
               
              Join Date: Jan 2008
              Location: England
              Posts: 5,178
              Quote:
              Originally Posted by TACHAN View Post
              p0.moves = PBMoves::THUNDER
              p0.moves = PBMoves::SURF
              p0.moves = PBMoves::GRASSKNOT
              p0.moves = PBMoves::HIDDENPOWER
              That's not how you teach moves to a Pokémon. Try reading the Essentials wiki and/or looking at how the demo Pokémon are given movesets full of HMs (in def pbCreatePokemon).
              __________________
              Go to the Essentials Docs Wiki

              Essentials Docs Wiki

              Follow me on Twitter: @maruno42


              Reply With Quote
                #32   Link to this post, but load the entire thread.  
              Old April 24th, 2015 (12:23 PM).
              TACHAN TACHAN is offline
                 
                Join Date: Jan 2010
                Gender: Female
                Posts: 198
                Quote:
                Originally Posted by Maruno View Post
                That's not how you teach moves to a Pokémon. Try reading the Essentials wiki and/or looking at how the demo Pokémon are given movesets full of HMs (in def pbCreatePokemon).
                p0.pbLearnMove(:TACKLE)

                It's works now.
                Thanks you! :D
                Reply With Quote
                  #33   Link to this post, but load the entire thread.  
                Old June 8th, 2015 (6:57 PM).
                NeoPlayerX NeoPlayerX is offline
                   
                  Join Date: Jan 2015
                  Gender: Male
                  Posts: 4
                  Quote:
                  Originally Posted by Stochastic View Post
                  Sure, it's not hard. Insert this method in the script.

                  Code:
                  # ------------------------------------------------------------------------------
                  # Returns a random element from a given array.
                  # ------------------------------------------------------------------------------
                  def randomElement(array)
                    i = rand(array.length)
                    return array[i]
                  end
                  Then, in the event, instead of writing createPokemon("PIKACHU", 13) you can write
                  createPokemon(randomElement(SomePool), 13), and you'll need to define 'SomePool',
                  either in the event script or in a global script (such as CustomTrainers) as,
                  Code:
                  SomePool = ["PIKACHU", "BULBASAUR", "SOME_OTHER_POKEMON"]


                  Sorry, I don't understand. Do you want me to describe functions better?
                  To put all the Pokémon at once in the "array" instead of putting one by one?

                  Instead of placing: SomePool = [Bulbasaur, Ivysaur ...]
                  Place: SomePool = [Bulbasaur ... Zygard]

                  It's possible?

                  Thanks
                  Reply With Quote
                    #34   Link to this post, but load the entire thread.  
                  Old June 10th, 2015 (8:39 AM).
                  gioni gioni is offline
                     
                    Join Date: Aug 2014
                    Gender: Male
                    Posts: 20
                    it might be possible to add that the duelist just sees the player approaches to fight
                    Reply With Quote
                      #35   Link to this post, but load the entire thread.  
                    Old November 12th, 2015 (11:38 PM). Edited November 23rd, 2015 by Rot8er_ConeX.
                    Rot8er_ConeX's Avatar
                    Rot8er_ConeX Rot8er_ConeX is offline
                       
                      Join Date: May 2015
                      Location: The Dissa Region
                      Gender: Male
                      Posts: 822
                      Quote:
                      Originally Posted by Florio View Post
                      Honestly this script seems somewhat unnecessary. Editing the PBS is easy enough, and if you make your Trainer's VIA this method then you can't easily change the Pokemon after. Sometimes I change around the Pokemon in my game and the Trainer's to and Ctrl+H and Ctrl+F come in handy while using the trainers PBS file. I feel like this would make the game more unorganized overall. But still, it seems useful for people who aren't as accustomed to Essentials.
                      I plan on using this only for "dynamic" trainers. Characters like your rival where your choices affect their party. Rather than defining a slot for him in the PBS files for each encounter, each starter, and each Eeveeloution, and have a convoluted mess of conditional branches in each event, I'm going to just have him dynamically create his party at each encounter. You picked this starter? Okay, add these two pokemon to his party. You evolved your plot Eevee into this? Add these two pokemon. You're playing as a female? Make this member of his team male.

                      Standard trainers who are going to have the same Pokemon no matter what you choose see going to stay in the PBS files.
                      __________________
                      Features of Pokemon Entropy

                      The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
                      Reply With Quote
                        #36   Link to this post, but load the entire thread.  
                      Old November 23rd, 2015 (4:07 PM).
                      Dugtrio-Ramen's Avatar
                      Dugtrio-Ramen Dugtrio-Ramen is offline
                         
                        Join Date: Nov 2015
                        Gender: Male
                        Posts: 22
                        Is there a way to add support for the gen 6 battle mechanics, the one's found in the pokemon essentials gen6.
                        Amazing job by the way.
                        Reply With Quote
                          #37   Link to this post, but load the entire thread.  
                        Old November 23rd, 2015 (5:46 PM).
                        Rot8er_ConeX's Avatar
                        Rot8er_ConeX Rot8er_ConeX is offline
                           
                          Join Date: May 2015
                          Location: The Dissa Region
                          Gender: Male
                          Posts: 822
                          Quote:
                          Originally Posted by Dugtrio-Ramen View Post
                          Is there a way to add support for the gen 6 battle mechanics, the one's found in the pokemon essentials gen6.
                          Amazing job by the way.
                          Code:
                          # ------------------------------------------------------------------------------
                          # Written by Stochastic, except for customTrainerBattle method which is a
                          # modified version of pbTrainerBattle method.
                          # ------------------------------------------------------------------------------
                          
                          BR_DRAW = 5
                          BR_LOSS = 2
                          BR_WIN = 1
                          
                          # ------------------------------------------------------------------------------
                          # species - Name of the species, e.g. "PIKACHU"
                          # level - Level
                          # moveset - Optional. Array of moves, e.g. [:MUDSLAP, :THUNDERBOLT, :VINEWHIP]
                          # If not specified, pokemon will be created with moves learned by leveling.
                          # The pokemon doesn't need to be able to learn the given moves, they can be
                          # arbitary.
                          # ------------------------------------------------------------------------------
                          def createPokemon(species, level, moveset=nil)
                            begin
                              poke = PokeBattle_Pokemon.new(species, level)
                              poke.moves = convertMoves(moveset) if moveset
                              poke.shinyflag = false
                              return poke
                            rescue
                              return PokeBattle_Pokemon.new("PIKACHU", 5)
                            end
                          end
                          
                          def convertMoves(moves)
                            moves.map! {|m| PBMove.new(getMoveID(m))}
                            return moves
                          end
                          
                          # provide move like this; :TACKLE
                          def getMoveID(move)
                            return getConst(PBMoves,move)
                          end
                          
                          # ------------------------------------------------------------------------------
                          # Creates a trainer with specified id, name, party, and optionally, items.
                          # Does not depend on defined trainers, only on trainer types
                          # ------------------------------------------------------------------------------
                          def createTrainer(trainerid,trainername,party,items=[])
                            
                            name = pbGetMessageFromHash(MessageTypes::TrainerNames, trainername)
                            opponent = PokeBattle_Trainer.new(name, trainerid)
                            opponent.setForeignID($Trainer) if $Trainer
                            opponent.party = party
                            
                            return [opponent,items,party]
                          end
                          
                          # ------------------------------------------------------------------------------
                          # Initiates trainer battle. This is a modified pbTrainerBattle method.
                          #
                          # trainer - custom PokeBattle_Trainer provided by the user
                          # endspeech - what the trainer says in-battle when defeated
                          # doublebattle - Optional. Set it to true if you want a double battle
                          # canlose - Optional. Set it to true if you want your party to be healed after battle,
                          # and if you don't want to be sent to a pokemon center if you lose
                          # ------------------------------------------------------------------------------
                          def customTrainerBattle(trainer,endspeech,doublebattle=false,canlose=false,
                                                  skybattle=false,inverse=false)
                             # Sky battle eligibility for player
                            if skybattle
                              count=0
                              for poke in $Trainer.party
                                count+=1 if pbCanSkyBattle?(poke)
                              end
                              if count==0
                                Kernel.pbMessage(_INTL("You don't have any eligible pokemon for a sky battle"))
                                return false
                              end
                            end
                            trainerparty=0 # added by SH
                            if $Trainer.pokemonCount==0
                              Kernel.pbMessage(_INTL("SKIPPING BATTLE...")) if $DEBUG
                              return BR_LOSS # changed by SH
                            end
                            if !$PokemonTemp.waitingTrainer && $Trainer.ablePokemonCount>1 &&
                              pbMapInterpreterRunning?
                              thisEvent=pbMapInterpreter.get_character(0)
                              triggeredEvents=$game_player.pbTriggeredTrainerEvents([2],false)
                              otherEvent=[]
                              for i in triggeredEvents
                                if i.id!=thisEvent.id && !$game_self_switches[[$game_map.map_id,i.id,"A"]]
                                  otherEvent.push(i)
                                end
                              end
                              if otherEvent.length==1
                                if trainer[2].length<=3
                                  $PokemonTemp.waitingTrainer=[trainer,thisEvent.id,endspeech,doublebattle]
                                  return BR_LOSS # changed by SH
                                end
                              end
                            end
                            
                            if $PokemonGlobal.partner && ($PokemonTemp.waitingTrainer || doublebattle)
                              othertrainer=PokeBattle_Trainer.new(
                                $PokemonGlobal.partner[1],$PokemonGlobal.partner[0])
                              othertrainer.id=$PokemonGlobal.partner[2]
                              othertrainer.party=$PokemonGlobal.partner[3]
                              playerparty=[]
                              for i in 0...$Trainer.party.length
                                playerparty[i]=$Trainer.party[i]
                              end
                              for i in 0...othertrainer.party.length
                                playerparty[6+i]=othertrainer.party[i]
                              end
                              fullparty1=true
                              playertrainer=[$Trainer,othertrainer]
                              doublebattle=true
                            else
                              playerparty=$Trainer.party
                              playertrainer=$Trainer
                              fullparty1=false
                            end
                            if $PokemonTemp.waitingTrainer
                              combinedParty=[]
                              fullparty2=false
                              if false
                                if $PokemonTemp.waitingTrainer[0][2].length>3
                                  raise _INTL("Opponent 1's party has more than three Pokémon, which is not allowed")
                                end
                                if trainer[2].length>3
                                  raise _INTL("Opponent 2's party has more than three Pokémon, which is not allowed")
                                end
                              elsif $PokemonTemp.waitingTrainer[0][2].length>3 || trainer[2].length>3
                                for i in 0...$PokemonTemp.waitingTrainer[0][2].length
                                  combinedParty[i]=$PokemonTemp.waitingTrainer[0][2][i]
                                end
                                for i in 0...trainer[2].length
                                  combinedParty[6+i]=trainer[2][i]
                                end
                                fullparty2=true
                              else
                                for i in 0...$PokemonTemp.waitingTrainer[0][2].length
                                  combinedParty[i]=$PokemonTemp.waitingTrainer[0][2][i]
                                end
                                for i in 0...trainer[2].length
                                  combinedParty[3+i]=trainer[2][i]
                                end
                                fullparty2=false
                              end
                              #Sky battle eligibility for opponent
                              if skybattle
                                count=0
                                for poke in combinedParty
                                  count+=1 if pbCanSkyBattle?(poke)
                                end
                                if count==0
                                  Kernel.pbMessage(_INTL("The opponents don't have any eligible pokemon for a sky battle"))
                                  return false
                                end
                              end
                              scene=pbNewBattleScene
                              battle=PokeBattle_Battle.new(scene,playerparty,combinedParty,playertrainer,
                                [$PokemonTemp.waitingTrainer[0][0],trainer[0]],skybattle,inverse,gen)
                              trainerbgm=pbGetTrainerBattleBGM(
                                [$PokemonTemp.waitingTrainer[0][0],trainer[0]])
                              battle.fullparty1=fullparty1
                              battle.fullparty2=fullparty2
                              battle.doublebattle=battle.pbDoubleBattleAllowed?()
                              battle.endspeech=$PokemonTemp.waitingTrainer[2]
                              battle.endspeech2=endspeech
                              battle.items=[$PokemonTemp.waitingTrainer[0][1],trainer[1]]
                            else
                              #Sky battle eligibility for opponent
                              if skybattle
                                count=0
                                for poke in trainer[2]
                                  count+=1 if pbCanSkyBattle?(poke)
                                end
                                if count==0
                                  Kernel.pbMessage(_INTL("The opponents don't have any eligible pokemon for a sky battle"))
                                  return false
                                end
                              end
                              scene=pbNewBattleScene
                              battle=PokeBattle_Battle.new(scene,playerparty,trainer[2],playertrainer,trainer[0],skybattle,inverse)
                              battle.fullparty1=fullparty1
                              battle.doublebattle=doublebattle ? battle.pbDoubleBattleAllowed?() : false
                              battle.endspeech=endspeech
                              battle.items=trainer[1]
                              trainerbgm=pbGetTrainerBattleBGM(trainer[0])
                            end
                            if Input.press?(Input::CTRL) && $DEBUG
                              Kernel.pbMessage(_INTL("SKIPPING BATTLE..."))
                              Kernel.pbMessage(_INTL("AFTER LOSING..."))
                              Kernel.pbMessage(battle.endspeech)
                              Kernel.pbMessage(battle.endspeech2) if battle.endspeech2
                              if $PokemonTemp.waitingTrainer
                                pbMapInterpreter.pbSetSelfSwitch(
                                  $PokemonTemp.waitingTrainer[1],"A",true
                                )
                                $PokemonTemp.waitingTrainer=nil
                              end
                              return BR_WIN # changed by SH
                            end
                            Events.onStartBattle.trigger(nil,nil)
                            battle.internalbattle=true
                            pbPrepareBattle(battle)
                            restorebgm=true
                            decision=0
                            pbBattleAnimation(trainerbgm,trainer[0].trainertype,trainer[0].name) { 
                              pbSceneStandby {
                                  decision=battle.pbStartBattle(canlose)
                              }
                              if $PokemonGlobal.partner
                                pbHealAll
                                for i in $PokemonGlobal.partner[3]; i.heal; end
                              end
                              if decision==2 || decision==5
                                if canlose
                                  for i in $Trainer.party; i.heal; end
                                  for i in 0...10
                                    Graphics.update
                                  end
                                else
                                  $game_system.bgm_unpause
                                  $game_system.bgs_unpause
                                  Kernel.pbStartOver
                                end
                              else
                                Events.onEndBattle.trigger(nil,decision)
                                if decision==1
                                  if $PokemonTemp.waitingTrainer
                                    pbMapInterpreter.pbSetSelfSwitch(
                                        $PokemonTemp.waitingTrainer[1],"A",true
                                    )
                                  end
                                end
                              end
                            }
                            Input.update
                            $PokemonTemp.waitingTrainer=nil
                            return decision  # changed by SH
                          end
                          __________________
                          Features of Pokemon Entropy

                          The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
                          Reply With Quote
                            #38   Link to this post, but load the entire thread.  
                          Old November 24th, 2015 (9:59 PM).
                          Dugtrio-Ramen's Avatar
                          Dugtrio-Ramen Dugtrio-Ramen is offline
                             
                            Join Date: Nov 2015
                            Gender: Male
                            Posts: 22
                            Quote:
                            Originally Posted by Rot8er_ConeX View Post
                            Code:
                            # ------------------------------------------------------------------------------
                            # Written by Stochastic, except for customTrainerBattle method which is a
                            # modified version of pbTrainerBattle method.
                            # ------------------------------------------------------------------------------
                            
                            BR_DRAW = 5
                            BR_LOSS = 2
                            BR_WIN = 1
                            
                            # ------------------------------------------------------------------------------
                            # species - Name of the species, e.g. "PIKACHU"
                            # level - Level
                            # moveset - Optional. Array of moves, e.g. [:MUDSLAP, :THUNDERBOLT, :VINEWHIP]
                            # If not specified, pokemon will be created with moves learned by leveling.
                            # The pokemon doesn't need to be able to learn the given moves, they can be
                            # arbitary.
                            # ------------------------------------------------------------------------------
                            def createPokemon(species, level, moveset=nil)
                              begin
                                poke = PokeBattle_Pokemon.new(species, level)
                                poke.moves = convertMoves(moveset) if moveset
                                poke.shinyflag = false
                                return poke
                              rescue
                                return PokeBattle_Pokemon.new("PIKACHU", 5)
                              end
                            end
                            
                            def convertMoves(moves)
                              moves.map! {|m| PBMove.new(getMoveID(m))}
                              return moves
                            end
                            
                            # provide move like this; :TACKLE
                            def getMoveID(move)
                              return getConst(PBMoves,move)
                            end
                            
                            # ------------------------------------------------------------------------------
                            # Creates a trainer with specified id, name, party, and optionally, items.
                            # Does not depend on defined trainers, only on trainer types
                            # ------------------------------------------------------------------------------
                            def createTrainer(trainerid,trainername,party,items=[])
                              
                              name = pbGetMessageFromHash(MessageTypes::TrainerNames, trainername)
                              opponent = PokeBattle_Trainer.new(name, trainerid)
                              opponent.setForeignID($Trainer) if $Trainer
                              opponent.party = party
                              
                              return [opponent,items,party]
                            end
                            
                            # ------------------------------------------------------------------------------
                            # Initiates trainer battle. This is a modified pbTrainerBattle method.
                            #
                            # trainer - custom PokeBattle_Trainer provided by the user
                            # endspeech - what the trainer says in-battle when defeated
                            # doublebattle - Optional. Set it to true if you want a double battle
                            # canlose - Optional. Set it to true if you want your party to be healed after battle,
                            # and if you don't want to be sent to a pokemon center if you lose
                            # ------------------------------------------------------------------------------
                            def customTrainerBattle(trainer,endspeech,doublebattle=false,canlose=false,
                                                    skybattle=false,inverse=false)
                               # Sky battle eligibility for player
                              if skybattle
                                count=0
                                for poke in $Trainer.party
                                  count+=1 if pbCanSkyBattle?(poke)
                                end
                                if count==0
                                  Kernel.pbMessage(_INTL("You don't have any eligible pokemon for a sky battle"))
                                  return false
                                end
                              end
                              trainerparty=0 # added by SH
                              if $Trainer.pokemonCount==0
                                Kernel.pbMessage(_INTL("SKIPPING BATTLE...")) if $DEBUG
                                return BR_LOSS # changed by SH
                              end
                              if !$PokemonTemp.waitingTrainer && $Trainer.ablePokemonCount>1 &&
                                pbMapInterpreterRunning?
                                thisEvent=pbMapInterpreter.get_character(0)
                                triggeredEvents=$game_player.pbTriggeredTrainerEvents([2],false)
                                otherEvent=[]
                                for i in triggeredEvents
                                  if i.id!=thisEvent.id && !$game_self_switches[[$game_map.map_id,i.id,"A"]]
                                    otherEvent.push(i)
                                  end
                                end
                                if otherEvent.length==1
                                  if trainer[2].length<=3
                                    $PokemonTemp.waitingTrainer=[trainer,thisEvent.id,endspeech,doublebattle]
                                    return BR_LOSS # changed by SH
                                  end
                                end
                              end
                              
                              if $PokemonGlobal.partner && ($PokemonTemp.waitingTrainer || doublebattle)
                                othertrainer=PokeBattle_Trainer.new(
                                  $PokemonGlobal.partner[1],$PokemonGlobal.partner[0])
                                othertrainer.id=$PokemonGlobal.partner[2]
                                othertrainer.party=$PokemonGlobal.partner[3]
                                playerparty=[]
                                for i in 0...$Trainer.party.length
                                  playerparty[i]=$Trainer.party[i]
                                end
                                for i in 0...othertrainer.party.length
                                  playerparty[6+i]=othertrainer.party[i]
                                end
                                fullparty1=true
                                playertrainer=[$Trainer,othertrainer]
                                doublebattle=true
                              else
                                playerparty=$Trainer.party
                                playertrainer=$Trainer
                                fullparty1=false
                              end
                              if $PokemonTemp.waitingTrainer
                                combinedParty=[]
                                fullparty2=false
                                if false
                                  if $PokemonTemp.waitingTrainer[0][2].length>3
                                    raise _INTL("Opponent 1's party has more than three Pokémon, which is not allowed")
                                  end
                                  if trainer[2].length>3
                                    raise _INTL("Opponent 2's party has more than three Pokémon, which is not allowed")
                                  end
                                elsif $PokemonTemp.waitingTrainer[0][2].length>3 || trainer[2].length>3
                                  for i in 0...$PokemonTemp.waitingTrainer[0][2].length
                                    combinedParty[i]=$PokemonTemp.waitingTrainer[0][2][i]
                                  end
                                  for i in 0...trainer[2].length
                                    combinedParty[6+i]=trainer[2][i]
                                  end
                                  fullparty2=true
                                else
                                  for i in 0...$PokemonTemp.waitingTrainer[0][2].length
                                    combinedParty[i]=$PokemonTemp.waitingTrainer[0][2][i]
                                  end
                                  for i in 0...trainer[2].length
                                    combinedParty[3+i]=trainer[2][i]
                                  end
                                  fullparty2=false
                                end
                                #Sky battle eligibility for opponent
                                if skybattle
                                  count=0
                                  for poke in combinedParty
                                    count+=1 if pbCanSkyBattle?(poke)
                                  end
                                  if count==0
                                    Kernel.pbMessage(_INTL("The opponents don't have any eligible pokemon for a sky battle"))
                                    return false
                                  end
                                end
                                scene=pbNewBattleScene
                                battle=PokeBattle_Battle.new(scene,playerparty,combinedParty,playertrainer,
                                  [$PokemonTemp.waitingTrainer[0][0],trainer[0]],skybattle,inverse,gen)
                                trainerbgm=pbGetTrainerBattleBGM(
                                  [$PokemonTemp.waitingTrainer[0][0],trainer[0]])
                                battle.fullparty1=fullparty1
                                battle.fullparty2=fullparty2
                                battle.doublebattle=battle.pbDoubleBattleAllowed?()
                                battle.endspeech=$PokemonTemp.waitingTrainer[2]
                                battle.endspeech2=endspeech
                                battle.items=[$PokemonTemp.waitingTrainer[0][1],trainer[1]]
                              else
                                #Sky battle eligibility for opponent
                                if skybattle
                                  count=0
                                  for poke in trainer[2]
                                    count+=1 if pbCanSkyBattle?(poke)
                                  end
                                  if count==0
                                    Kernel.pbMessage(_INTL("The opponents don't have any eligible pokemon for a sky battle"))
                                    return false
                                  end
                                end
                                scene=pbNewBattleScene
                                battle=PokeBattle_Battle.new(scene,playerparty,trainer[2],playertrainer,trainer[0],skybattle,inverse)
                                battle.fullparty1=fullparty1
                                battle.doublebattle=doublebattle ? battle.pbDoubleBattleAllowed?() : false
                                battle.endspeech=endspeech
                                battle.items=trainer[1]
                                trainerbgm=pbGetTrainerBattleBGM(trainer[0])
                              end
                              if Input.press?(Input::CTRL) && $DEBUG
                                Kernel.pbMessage(_INTL("SKIPPING BATTLE..."))
                                Kernel.pbMessage(_INTL("AFTER LOSING..."))
                                Kernel.pbMessage(battle.endspeech)
                                Kernel.pbMessage(battle.endspeech2) if battle.endspeech2
                                if $PokemonTemp.waitingTrainer
                                  pbMapInterpreter.pbSetSelfSwitch(
                                    $PokemonTemp.waitingTrainer[1],"A",true
                                  )
                                  $PokemonTemp.waitingTrainer=nil
                                end
                                return BR_WIN # changed by SH
                              end
                              Events.onStartBattle.trigger(nil,nil)
                              battle.internalbattle=true
                              pbPrepareBattle(battle)
                              restorebgm=true
                              decision=0
                              pbBattleAnimation(trainerbgm,trainer[0].trainertype,trainer[0].name) { 
                                pbSceneStandby {
                                    decision=battle.pbStartBattle(canlose)
                                }
                                if $PokemonGlobal.partner
                                  pbHealAll
                                  for i in $PokemonGlobal.partner[3]; i.heal; end
                                end
                                if decision==2 || decision==5
                                  if canlose
                                    for i in $Trainer.party; i.heal; end
                                    for i in 0...10
                                      Graphics.update
                                    end
                                  else
                                    $game_system.bgm_unpause
                                    $game_system.bgs_unpause
                                    Kernel.pbStartOver
                                  end
                                else
                                  Events.onEndBattle.trigger(nil,decision)
                                  if decision==1
                                    if $PokemonTemp.waitingTrainer
                                      pbMapInterpreter.pbSetSelfSwitch(
                                          $PokemonTemp.waitingTrainer[1],"A",true
                                      )
                                    end
                                  end
                                end
                              }
                              Input.update
                              $PokemonTemp.waitingTrainer=nil
                              return decision  # changed by SH
                            end
                            Thanks, it works perfectly.
                            And for anyone who has trouble with it, you have to show printable version.
                            Also the sky battle and inverse battles are the next 2 places like so:

                            "result = customTrainerBattle(trainer, "Oh no, you defeated me!",false,false,true,true)"
                            --------------------------------------------------------------------------------------------------------------|.....|
                            --------------------------------------------------------------------------------------------------------------^.....^
                            -----------------------------------------------------------------------------------------------------------sky....inverse
                            Reply With Quote
                              #39   Link to this post, but load the entire thread.  
                            Old December 11th, 2015 (3:00 AM).
                            Telemetius's Avatar
                            Telemetius Telemetius is offline
                            Tele*
                               
                              Join Date: Nov 2014
                              Location: Italy
                              Gender: Male
                              Nature: Relaxed
                              Posts: 267
                              Hi, after upgrading to essentials v16 I'm receiving this error every time i use the script:
                              http://i.imgur.com/rz5OXlJ.png
                              In the essentials wiki it sais that it's due to a spelling mistake but the script worked perfectly with v15.
                              __________________

                              That way!
                              I thought..uhm, ok.
                              -----------------------------------------------------------------------------------------------
                              Beta 50%
                              Reply With Quote
                                #40   Link to this post, but load the entire thread.  
                              Old December 29th, 2015 (10:52 AM).
                              Fakemon123's Avatar
                              Fakemon123 Fakemon123 is offline
                                 
                                Join Date: Dec 2015
                                Gender: Male
                                Posts: 22
                                Oh, this will make adding trainers so much easier! Thank you for this!
                                Reply With Quote
                                  #41   Link to this post, but load the entire thread.  
                                Old February 9th, 2016 (11:12 AM).
                                coguepard coguepard is offline
                                   
                                  Join Date: Feb 2016
                                  Posts: 1
                                  Quote:
                                  Originally Posted by Telemetius View Post
                                  Hi, after upgrading to essentials v16 I'm receiving this error every time i use the script:
                                  *new user (cannot display links)*
                                  In the essentials wiki it sais that it's due to a spelling mistake but the script worked perfectly with v15.
                                  Hey buddy, same trouble as you. Since I have no idea what the whole code does, not even the essential because there is no information where I can find each part of the essential code to learn what the whole scripts do.

                                  I suggest you go to "Custom Trainers" which is the one you created, according to your image and as your debugger says in the image you attached, line 180. There you have 7 arguments, the sky and inverse (I am an old pokemon player, from first generations so I have no idea what these battle modes are) and since for Essentials v16 it only accepts 5 arguments, erase the last two I told you.

                                  Cheers!
                                  Reply With Quote
                                    #42   Link to this post, but load the entire thread.  
                                  Old February 25th, 2016 (8:16 PM). Edited February 26th, 2016 by Maruno.
                                  Sapph the Knight's Avatar
                                  Sapph the Knight Sapph the Knight is offline
                                     
                                    Join Date: Jun 2014
                                    Location: Northwest US
                                    Gender: Male
                                    Nature: Docile
                                    Posts: 45
                                    Does the script's page need to be put in any particular location, or just make a new page and go?

                                    Nevermind, this was a dumb question.
                                    Reply With Quote
                                      #43   Link to this post, but load the entire thread.  
                                    Old October 16th, 2017 (8:56 PM).
                                    Tea-Rex's Avatar
                                    Tea-Rex Tea-Rex is offline
                                       
                                      Join Date: Oct 2016
                                      Location: Australia
                                      Gender: Male
                                      Nature: Modest
                                      Posts: 36
                                      I'm having trouble with applying the canlose feature into the custom script. The code I have is below and if possible can someone please tell me if I've done something wrong.

                                      Spoiler:
                                      p0 = createPokemon("PIKACHU", 20)
                                      p0.pbLearnMove(:THUNDERBOLT)
                                      p0.pbLearnMove(:ELECTROBALL)
                                      p0.pbLearnMove(:QUICKATTACK)
                                      p0.pbLearnMove(:IRONTAIL)
                                      p0.setItem(:ELECTRIUMZ2)
                                      p0.makeMale
                                      party = [p0]
                                      trainer = createTrainer(211, "Ash",
                                      party)
                                      canlose = true
                                      result = customTrainerBattle(trainer,
                                      "That was a great battle.")
                                      pbSet(1, result == BR_WIN ? 0 : 1)
                                      Reply With Quote
                                        #44   Link to this post, but load the entire thread.  
                                      Old April 20th, 2018 (7:40 PM). Edited April 20th, 2018 by pokemonspecialist.
                                      pokemonspecialist's Avatar
                                      pokemonspecialist pokemonspecialist is offline
                                         
                                        Join Date: Sep 2017
                                        Posts: 56
                                        Thanks man.
                                        Everything worked for me but can you tell me how to give an item to a Pokemon?
                                        Thanks for the help mate.
                                        __________________

                                        Reply With Quote
                                          #45   Link to this post, but load the entire thread.  
                                        Old August 8th, 2018 (2:15 PM).
                                        joaom7 joaom7 is offline
                                           
                                          Join Date: Aug 2018
                                          Posts: 15
                                          Im having a problem with it!
                                          It shows this, "Error in the script Custom Script, in 60 in line 'SyntaxError' "
                                          What can I do?
                                          Reply With Quote
                                            #46   Link to this post, but load the entire thread.  
                                          Old August 16th, 2018 (4:14 AM).
                                          AshKetchum000's Avatar
                                          AshKetchum000 AshKetchum000 is offline
                                          Pokemon Mystic Quartz [Soon(TM)]
                                             
                                            Join Date: Aug 2017
                                            Location: In My Home..
                                            Age: 14
                                            Gender: Male
                                            Nature: Lonely
                                            Posts: 41
                                            Quote:
                                            Originally Posted by joaom7 View Post
                                            I´m having a problem with it!
                                            It shows this, "Error in the script Custom Script, in 60 in line 'SyntaxError' "
                                            What can I do?
                                            Are you still there? Can you please look at those scripts where you pasted this?

                                            When you have opened the section in which they are, Press CTRL + G and type 60 then Press Enter, Now, Just Type # in the first of that line. Save it, It should work now. (Cuz it also happened with me. :D )
                                            __________________

                                            ^ Join this Discord server (Click the image) and Let the battle begin!
                                            -----------------------------------------------------------------------------------
                                            "Never Give up until everything is finished", Ash
                                            Reply With Quote
                                              #47   Link to this post, but load the entire thread.  
                                            Old August 16th, 2018 (5:36 AM).
                                            joaom7 joaom7 is offline
                                               
                                              Join Date: Aug 2018
                                              Posts: 15
                                              Thanks it worked!
                                              Reply With Quote
                                                #48   Link to this post, but load the entire thread.  
                                              Old August 17th, 2018 (4:34 AM).
                                              AshKetchum000's Avatar
                                              AshKetchum000 AshKetchum000 is offline
                                              Pokemon Mystic Quartz [Soon(TM)]
                                                 
                                                Join Date: Aug 2017
                                                Location: In My Home..
                                                Age: 14
                                                Gender: Male
                                                Nature: Lonely
                                                Posts: 41
                                                Quote:
                                                Originally Posted by joaom7 View Post
                                                Thanks it worked!
                                                Np. Just Enjoy ;)
                                                __________________

                                                ^ Join this Discord server (Click the image) and Let the battle begin!
                                                -----------------------------------------------------------------------------------
                                                "Never Give up until everything is finished", Ash
                                                Reply With Quote
                                                  #49   Link to this post, but load the entire thread.  
                                                Old 4 Weeks Ago (1:17 PM).
                                                Juno and Ice's Avatar
                                                Juno and Ice Juno and Ice is offline
                                                   
                                                  Join Date: May 2018
                                                  Gender: Male
                                                  Posts: 64
                                                  Is there anyway to change Pokémon forms with this script?
                                                  Reply With Quote
                                                  Reply

                                                  Quick Reply

                                                  Join the conversation!

                                                  Create an account to post a reply in this thread, participate in other discussions, and more!

                                                  Create a PokéCommunity Account
                                                  Ad Content
                                                  Thread Tools

                                                  Posting Rules
                                                  You may not post new threads
                                                  You may not post replies
                                                  You may not post attachments
                                                  You may not edit your posts

                                                  BB code is On
                                                  Smilies are On
                                                  [IMG] code is On
                                                  HTML code is Off

                                                  Forum Jump


                                                  All times are GMT -8. The time now is 10:57 PM.