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

Double battle versus 1 pokemon

  • 67
    Posts
    13
    Years
    We all got the idea of double Wild battles etc. but I am trying to force a double battle against 1 Wild/Trainer Pokemon. Like using your first 2 pokemon against one Legendary Pokemon. (Similar to the encounter against shadow Lugia in Gales of Darkness where you use two Pokemon against Verrich's one Lugia.)
    For my game I try to do similar but then teaming up with a partner trainer and challenge Archie using only Kyogre. But I keep getting an error and can't figure it out. :-S

    Any ideas?
     
    Could you post the error you're getting just so we can see what issue it is you're having? Can't really do anything to help if we don't have the full picture.
     
    Yes, sure!
    [PokeCommunity.com] Double battle versus 1 pokemon


    So basically it mentions PokeBattle_Battle (ln. 2099) and PokemonTrainers (lns. 428-430) Logically there is a def that states that the opponent must have at least 2 or more Pokemon in order to call for a double battle, but I have been scanning thru all the Double defs. but can't find where to turn this off. I want to be able to do double battles even against a trainer with just one pokemon. (or one Legendary wild pokemon as an encounter)
     
    I believe I've got this working. Yet I still have to run some tests, and really need some sleep now. So I'll update this post tomorrow (Monday) with the required code changes (for both trainers and wild encounters).
     
    That would be awesome! I have been checking the script and run tests for weeks but couldn't find this one trigger that keeps blocking this feature...
    I have looked all over the forum and the essentials wiki and was surprised that there weren't any mentions about it before. (Although I couldn't find them) Thought it would be a quite general question to game-makers... :-)
     
    To allow 2v1 against other trainers (this still requires the player to have 2 Pokémon on them) do the following:
    - In PokemonTrainers find "battle.doublebattle=doublebattle" and remove the part which comes after it ("battle.pbDoubleBattleAllowed?() : false")
    - In PokeBattle_Battle find the following section and add the red parts (it's just above "Initialize opponent in single battles")

    Code:
            if sendout1<0 || sendout2<0
    [COLOR="Red"]#[/COLOR]          raise _INTL("Opponent doesn't have two unfainted Pokémon")
    [COLOR="red"]#[/COLOR]        end
    [COLOR="red"]          sendout2 = nil
              pbDisplayBrief(_INTL("{1} sent\r\nout {2}!",@opponent.fullname,@party2[sendout1].name))
              @battlers[1].pbInitialize(@party2[sendout1],sendout1,false)
              @battlers[3].pbInitBlank
              @battlers[3].fainted = true
              pbSendOut(1,@party2[sendout1])
            else[/COLOR]
              pbDisplayBrief(_INTL("{1} sent\r\nout {2} and {3}!",
                @opponent.fullname,@party2[sendout1].name,@party2[sendout2].name))
              @battlers[1].pbInitialize(@party2[sendout1],sendout1,false)
              @battlers[3].pbInitialize(@party2[sendout2],sendout2,false)
              pbSendOut(1,@party2[sendout1])
              pbSendOut(3,@party2[sendout2])
    [COLOR="red"]        end[/COLOR]

    That should do the trick. If it causes any bugs/crashes, then let me know.
     
    Hey Badhaas, thanks heaps for the scripting adjustment! It certainly removed some kinda lock on 2v1 battles. However almost there... Now it send an error at the time that the opponent actually have to send out the one pokemon he has.
    It shows this message at this screenshot:

    [PokeCommunity.com] Double battle versus 1 pokemon


    I've tried to adjust several other scripts around it, but can't get it past here. Any suggestions?
     
    Sorry, I forgot to add that part XD

    To fix it find "attr_reader :fainted" in the PokeBattle_Battler script, and replace it with "attr_accessor :fainted"

    Note: It's possible that the game starts giving an AI error (related to stealth rock), or only the first Pokémon acting during battle (if $). I got this after applying these changes, yet its a bug in essentials itself rather than these script changes. To fix it go to the PokeBattle_AI script; search for "StealthRock]>0" and replace it by "StealthRock]==true".
     
    Last edited:
    Any idea how to do this in Essentials 15.1? Where the Dynamic battle option is in effect? If I try to redo the above I get a syntax error
     
    Back
    Top