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

Wild Battles that can result in Double Battles

Derxwna Kapsyla

Derxwna "The Badman" Kapsyla
  • 437
    Posts
    13
    Years
    With Generation Three, we were introduced to a new concept: Double Battles, trainers that would send out two Pokemon at once. Generation Four added more to this concept in an interesting way - if you had a partner with you at the time, you would get into Wild Double Battles. Generation Five expanded on this even further and allows you to get into Wild Double Battles in certain types of Tall Grass.

    This script will allow players to emulate the style of Wild Double Battles in their RMXP Project. It's a minor modification to an already existing script, and is a simple copy and paste procedure. However, since I do not think that Wild Double's are presently in game (But are scripted in), it would make sense to add it in for projects that want to utilize it.

    Open the Script Editor and go to the Script Section called PokemonField. In here, look for the following lines, starting around line 1468 in an unmodified version of Essentials:
    Code:
              if $PokemonGlobal.partner
                encounter2=$PokemonEncounters.pbEncounteredPokemon(encounterType)
                pbDoubleWildBattle(encounter[0],encounter[1],encounter2[0],encounter2[1])
    What we're gonna do here is make it so you can engage in Wild Double Battles in a certain terrain type, specifically, in this case, Tall Grass. To make this work, you will need to paste the following line of code in next to "if $PokemonGlobal.partner":
    Code:
               || ( pbGetTerrainTag($game_player)==PBTerrain::TallGrass && rand(10)<3 ) && $Trainer.ablePokemonCount>1

    Time to explain exactly what the code does, so there is no doubt left in peoples minds. the " || ( pbGetTerrainTag($game_player)==PBTerrain::TallGrass && rand(10)<3 )", as it would appear, is what allows the Wild Double Battle to be found in the TallGrass Terrain Type. Whatever you have Terrain tagged as Tall Grass (As in, Very Tall Grass), will return a Wild Double battle. The ||, aka the OR, is self explanatory: It tells the code "If condition A OR Condition B is true, return true". In this case, if the player has a partner with them OR they're in tall grass, execute a Wild double battle. That &&, aka the AND, tells the script that it needs to meet these qualifiers as well. After going over the OR, this is an additional part of Condition B, where it literally reads: "If the trainer is in tall grass AND the random number generated is less than 3, execute a wild double battle". The Rand is so you don't always get into a WDB. The value can be changed to whatever you want, rand(50)<25, rand(100)>72. So long as the syntax you use is correct, and the probability is possible, then it'll work.

    Next is the " && $Trainer.ablePokemonCount>1". This part is VERY IMPORTANT. DO NOT FORGET TO ADD IT. This line ensures the game does not generate a WDB when you only have one Pokemon in your party, via in general or only one Pokemon left standing. If you do not add this code, it will make your game crash whenever you go into Double Battle Grass without a second able Pokemon. This statement also is grouped with the Condition B statement, so the full statement reads:
    If If the Player Trainer has a Partner OR (the player trainer is walking in Very Tall Grass, AND the random number is less than 3) AND the player has more than one able Pokemon in their party, execute a Wild Double Battle.
    In the end, the code should look like this:
    Code:
              if $PokemonGlobal.partner || ( pbGetTerrainTag($game_player)==PBTerrain::TallGrass && rand(10)<3 ) && $Trainer.ablePokemonCount>1
                  encounter2=$PokemonEncounters.pbEncounteredPokemon(encounterType)
                  pbDoubleWildBattle(encounter[0],encounter[1],encounter2[0],encounter2[1])
    And that is how you add Wild Double Battles to your Pokemon Fangame in Essentials! I do not take credit for the code, Mugendai is the one who initially made the code for it, but I applied the "$Trainer.ablePokemonCount>1" fix that we forgot to add the first time we made the code.
     
    Nice script, this is definitely a good add-on and maybe should be added to Essentials permanently... However, I think it needs to be adapted more so that the user can still access normal battles instead of double battles, by this I mean, imagine when you first start your journey and you come across 2 level 5 Rattata, for example... But you own a level 2 Pidgey, with 10% HP and your starter with -5 HP... Already you're going to take a beating... I think this needs to be edited a little so that you only receive double battles after a Pokémon in your team reaches a certain level.

    Some people might not care, but other than that, I think this is a good job, well done.
     
    The script still allows for Single Battles, though. Like I said, this only applies to Tall Grass. The terminology here is flawed - what it should be is Really Tall Grass, the grass you end up disappearing in. And still, the full version of the code does Single Battles too. There is an Else statement underneath this:
    Code:
              if $PokemonGlobal.partner || ( pbGetTerrainTag($game_player)==PBTerrain::TallGrass && rand(10)<3 ) && $Trainer.ablePokemonCount>1
                  encounter2=$PokemonEncounters.pbEncounteredPokemon(encounterType)
                  pbDoubleWildBattle(encounter[0],encounter[1],encounter2[0],encounter2[1])
              else
                pbWildBattle(encounter[0],encounter[1])
    if my knowledge is correct, and my experience of a year with this code isn't wrong, Single Battles still work in Really Tall Grass. This is also why the rand(10)<3 is there - 20% of the time you have a chance to get a Double Battle. The other 80% is still a single battle.

    However... I think I misread what you said entirely, no I'm positive I did and now that I know what you said the entire above segment is probably irrelevant. All I can say is: why would a person go about making unavoidable Very Tall Grass right on the route next to the starting town while delibratly using the WDB code. It, very literally, would eschew game balance and make the game much harder and much more frustrating in the early game. However, if the person really wants to, I don't see a reason to stop them...However, if you really want to cover that base, then go for it I guess. Unfortunately, I have no idea how to run a check for the users levels, so I can't be of any help here.
     
    Back
    Top