Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

True Pokemon Starter Kit

poccil

Sponsor

Nim the Dialga:

The meaning of the additional effect chance field depends on the function code for the move (field 4).  For example, moves that deal just damage have a function code of 00.
 
Thanks, but I didn't see the function codes on that page. All I see are these:
Name          Type        Damage Accuracy PP  Effect Target    Flags

Am I missing something?
 

poccil

Sponsor

The function code for a move is found before the description of a move's effect.  For example: "A7: Burns opponent." The function code here is "A7".
 
I see it now. thanks! :D


oh I've got an interesting question. You know how you can have a multi double battle against two trainers if two trainers spot you at once? Well I want to have an event battle (meaning it doesn't happen by the player being "spotted") against two trainers (like in d/p the battle against two galaxy admins near where you fight the legend). Is there any way to call that? I've used "pbtrainerbattle" for calling a battle against one trainer but I've looked at the code and I have not seen a similar thing for calling a battle against two trainers.


If it helps here's the video of the event.
http://youtube.com/watch?v=JKZv5so57ko
Currently it's just a single against one trainer but I want to make it a double with a partner against two trainers.
 

poccil

Sponsor

Nim the Dialga:

Put the code below at the bottom of the script section PokemonTrainers.  It includes a method that does what you need.
Code:
def pbMissingTrainer(trainerid, trainername, trainerparty)
        traineridstring="#{trainerid}"
        traineridstring=getConstantName(PBTrainers,trainerid) rescue nil
        if $DEBUG
         Kernel.pbMessage(_INTL("Can't find trainer ({1}, {2}) in Trainer data file.\1",traineridstring,trainername))
         if Kernel.pbConfirmMessage(_INTL("Would you like to add this Trainer now?"))
            pbNewTrainer(trainerid,trainername,trainerparty)
         end
        else
         raise _INTL("Can't find trainer ({1}, {2})",traineridstring,trainername)
        end
end

def pbDoubleTrainerBattle(
   trainerid1, trainername1, trainerparty1, endspeech1,
   trainerid2, trainername2, trainerparty2, endspeech2, 
   canlose=false
)
 trainer1=pbLoadTrainer(trainerid1,trainername1,trainerparty1)
 if !trainer1
  pbMissingTrainer(trainerid1,trainername1,trainerparty1)
 end
 trainer2=pbLoadTrainer(trainerid2,trainername2,trainerparty2)
 if !trainer2
  pbMissingTrainer(trainerid2,trainername2,trainerparty2)
 end
 if !trainer1 || !trainer2
  return false
 end
 currentlevels=[]
 for i in $Trainer.party
  currentlevels.push(i.level)
 end
 if $PokemonMap.partner
      othertrainer=PokeBattle_Trainer.new(
        $PokemonMap.partner[1],
        $PokemonMap.partner[0])
      othertrainer.id=$PokemonMap.partner[2]
      othertrainer.party=$PokemonMap.partner[3]
      playerparty=[]
      for i in othertrainer.party; i.heal; end
      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
 combinedParty=[]
 combinedParty2=[]
 if trainer1[2].length>3
  raise _INTL("Opponent 1's party has more than three Pokemon, which is not allowed")
 end
 if trainer2[2].length>3
  raise _INTL("Opponent 2's party has more than three Pokemon, which is not allowed")
 end
 for i in 0...trainer1[2].length
  combinedParty[i]=trainer1[2][i]
 end
 for i in 0...trainer2[2].length
  combinedParty[3+i]=trainer2[2][i]
 end
 for i in 0...6
  combinedParty2[i]=combinedParty[i].clone if combinedParty[i]
 end
 scene=PokeBattle_Scene.new
 battle=PokeBattle_Battle.new(scene,
         playerparty,
         combinedParty,
         playertrainer,
         [trainer1[0],trainer2[0]]
 )
 trainerbgm=pbGetTrainerBattleBGM([trainer1[0],trainer2[0]])
 battle.fullparty1=fullparty1
 battle.doublebattle=true
 battle.endspeech=endspeech1
 battle.endspeech2=endspeech2
 battle.items=[trainer1[1],trainer2[1]]
 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
     return true
 end
 battle.internalbattle=true
 pbPrepareBattle(battle)
 playingBGS=$game_system.getPlayingBGS
 playingBGM=$game_system.getPlayingBGM
 $game_system.bgm_pause
 $game_system.bgs_pause
 restorebgm=true
 decision=0
 pbBattleAnimation(trainerbgm) { 
   pbSceneStandby {
    decision=battle.pbStartBattle
   }
   if $PokemonMap.partner
    for i in $Trainer.party; i.heal; end
   end
   if decision==2
    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
     restorebgm=false
    end
   else
    pbEvolutionCheck(currentlevels)
    if decision==1
     for pkmn in $Trainer.party
      Kernel.pbPickup(pkmn)
     end
    end
   end
 }
 if restorebgm
  $game_system.bgm_resume(playingBGM)
  $game_system.bgs_resume(playingBGS)
 end 
 $PokemonGlobal.nextBattleBGM=nil
 $PokemonGlobal.nextBattleME=nil
 $PokemonEncounters.clearStepCount
 Input.update
 return (decision==1)
end

The documentation follows:

To invoke a battle against two different Trainers, use the pbDoubleTrainerBattle function.

Code:
@> Conditional Branch: Script: pbDoubleTrainerBattle(PBTrainers::CAMPER,"Andrew",0,"ABC",PBTrainers::CAMPER,"Andrew",0,"DEF")
  @> -- Event commands to be run when the player wins
  @>
 : Else
  @> -- Event commands to be run when the player loses.  For example:
  @> Exit Event Processing
  @>
 : Branch End
The function's parameters are as follows:

    * Parameter 1: Trainer 1's Trainer type.
    * Parameter 2: Trainer 1's name. The Trainer type and Trainer name must be found in the Trainer data file.
    * Parameter 3. For Trainer 1, a number to distinguish Trainers with the same Trainer type and Trainer name. Specify 0 if there is only one such Trainer.
    * Parameter 4: Dialogue that Trainer 1 says when the player wins. This parameter should be wrapped in _I() (with a capital i), to support localization.
    * Parameter 5: Trainer 2's Trainer type.
    * Parameter 6: Trainer 2's name. The Trainer type and Trainer name must be found in the Trainer data file.
    * Parameter 7. For Trainer 2, a number to distinguish Trainers with the same Trainer type and Trainer name. Specify 0 if there is only one such Trainer.
    * Parameter 8: Dialogue that Trainer 2 says when the player wins. This parameter should be wrapped in _I() (with a capital i), to support localization.
    * Parameter 9: Optional. If true, the game will continue where the battle began even if the player loses the battle.

The important thing to note here is that each Trainer mentioned must have three or fewer Pokemon.

A Forgotten Legend:

Please explain further: where is the problem occurring, what kind of switch, and so on?  What you gave is not clear.
 
Thanks a ton! It works! :D

@ A Forgotten Legend: If your problem is what I think it might be, all commands that happen after a battle is over go inside the battle's conditional branch.
 
There is no branch. ^^

When you put a switch operation after the battle`s coding it erases the switch when you start the game.  I'm trying to do something similar to the rival battles at the beginning of the games.
 
Just so you know, all trainers battle calling codes should be conditional branches, so that things will be handled properly if the player loses. Although I'm pretty sure this is true, I will admit that I don't know anywhere near as much as poccil and that I could be wrong.
 
I am a complete noob at starter kit so this is gonna be a really stupid question to everyone else but,

How do you put in battles? I've looked at the notes for pokemon essentials, but I still can't figure it out.

I would mostly like instructions for wild battles and trainer battles. Event battles would be nice, but I'm not nearly at that level yet...  :sad:

Thanks so much,
vavalar
 
They're already programmed in sorta.

anywhere you place the grass tile can have wild battles, if you add a new map you must edit "game's folder/PBS/encounters.txt" in order for that area to have wild battles. For info on how to do this and/or how to put wild pokemon in caves, water, etc, look at "notes.html" in the game's folder.

for trainer battles, edit "trainernames.txt" and "trainers.txt" (see notes.html for more info on how to do this.). Then copy a trainer event and change it to be the trainer you want (character graphic, code, etc). And one last thing -  the name of the trainer event matters. name it "Trainer(#)" with # being a number which is the trainer's maximum vision (in tile spaces).
 
Hi everyone!

Wow Poccil your kit is awesome.

I'm currently using it to make rather a large game encompassing 4 continents, ad was wondering how to add new badges, seeing as it says in the notes that it is possible to do.

Hoping you can help!

Hijack74  :)
 
Nim the Dialga":lku8x3de said:
They're already programmed in sorta.

anywhere you place the grass tile can have wild battles, if you add a new map you must edit "game's folder/PBS/encounters.txt" in order for that area to have wild battles. For info on how to do this and/or how to put wild pokemon in caves, water, etc, look at "notes.html" in the game's folder.

for trainer battles, edit "trainernames.txt" and "trainers.txt" (see notes.html for more info on how to do this.). Then copy a trainer event and change it to be the trainer you want (character graphic, code, etc). And one last thing -  the name of the trainer event matters. name it "Trainer(#)" with # being a number which is the trainer's maximum vision (in tile spaces).

I'm still confused. Is there any scripts I need to have put in the script editor. cause when I made a trainer event and walked up to it, nothing happened...
 
Your best bet is to copy a trainer event that came with the game and change it to your trainer. The comment commands DO MATTER! In fact, those are what make it a trainer event.
If you are using a trainer with "vision", leave the comments there and change them to be the trainer you want. If you are using a gym leader or other special type trainer that you talk to to battle, then delete the comments and use the other code that's there. Note that if the comments are there, NO OTHER COMMANDS IN THE EVENT WILL BE EXECUTED!
 
I used one of the pre-made trainers. Ive done the name trainer(#). Ive put in the exact commands in the exact order shown in notes.html. But still nothing happens. your probably ticked off at me right now but I still dont get it. Is there any other commands I need to have in the event other than comments? I am just totally lost! *sigh*  :sad:
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top