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

[Scripting Question] Allowing Double Battles even with one able Pokemon

  • 2
    Posts
    3
    Years
    • Seen Jan 20, 2022
    Wanna mess around with making a game that exclusively uses Double Battles, just 'cause I really like Double Battles. However, whenever the player goes into a fight with one able Pokemon, Pokemon Essentials automatically turns it into a 1v1.

    It technically isn't an issue with one Pokemon in your party, since I could easily just set up some pre-battle logic to set it to a 1v2 instead. The problems begin to arise when dealing with a party where all but one Pokemon is fainted. If you Revive an extra party member, it doesn't turn it into a 2v2.

    In this specific scenario, locking players out of fights if they only have one able Pokemon would be a terrible solution; in a game centered entirely around Doubles, not only would it be an enormous inconvenience to have to go back and heal when you have only one active Pokemon remaning... but, if the game were like Colosseum and you could only gain new Pokemon from trainer battles*, then the player could easily accidentally softlock themself just by releasing all but one of their Pokemon.
    *My plan for the game was for it to be like Colosseum, where you can only gain new Pokemon from trainer battles


    I've tried looking through Essentials' code myself to try and figure out how to do it myself, but I have no experience with Ruby and am basically a hobbyist with the coding languages that I do know. Between that and the sparse notation in that section of the code, attempting to do it myself without at the very least a point in the right direction seems to be a lost cause.

    I've also tried searching the internet to see if anybody else wanted a solution to this problem, and most of the threads I've checked are either far too old or completely unresolved. One on this very site literally ends with somebody telling the OP to wait for the 1v2 to be added in a future revision..... which, clearly hasn't resolved the issue as all, seeing as this post exists now!

    Which leaves me with one recourse - requesting help from people who are significantly better at reading than me.
    So, uh.
    Help, please? 😭
     
    [PokeCommunity.com] Allowing Double Battles even with one able Pokemon


    This is something I was able to come up with. It uses pbCanDoubleBattle?, which returns true if you have two or more Pokemon. Then it sets the Battle to be a Double battle, or a 1v2 fight. Hopefully this helps!
     
    This is something I was able to come up with. It uses pbCanDoubleBattle?, which returns true if you have two or more Pokemon. Then it sets the Battle to be a Double battle, or a 1v2 fight. Hopefully this helps!

    That wasn't exactly what I was looking for, I'm afraid. Like I said in OP: If you have only one Pokemon that isn't fainted, but use a Revive to get another one mid-fight, you're still stuck in a 1v2. It won't automatically send out your second Pokemon now that it's able to battle, which is what I would prefer to have happen.

    But! It'll still work as a temporary fix while testing stuff out, thinking about it, 'cause of how easy it is to implement. It'll at least help me move along with testing specific encounters with a clearer mind.

    I'm still on the lookout for a true fix... but thanks for gettin' me to rethink my original dismissal of the 1v2/2v2 switch, man! 👍
     
    Sorry if necroposting like this is sacrilegious, but since I couldn't find anywhere else more recent that talks about this, I figured I'd leave it here for anyone who might be looking.

    On Essentials v21, if you open up the Script Editor on RPG Maker, locate the Battle_StartAndEnd section, then use Ctrl+F and look for "Reduce one or both" in green comment text. You should see this underneath:
    if wildBattle?
    PBDebug.log(#{@sideSizes[0]}v#sideSizes[1]} battle-- you should be able to tell already
    Between the "else" and "end" directly underneath, erase or turn the code into comments (type # in front of the line) and replace it simply with "break". If one side only has one Pokemon, it shouldn't force a single battle anymore, that side should just end up in a double with an empty slot. This may or may not have some ramifications I don't realize because as I'm sure you can tell, I am not a coder, but you'll probably be able to figure out 👍

    EDIT: Doing this will result in a bug that prevents you from selecting your move's target in battle. Using Ctrl + G to go to line 374 in Scene_ChooseCommands in the Script Editor, add an "&" between the i in square brackets and ".fainted?" and the error will go away
     
    Last edited:
    Back
    Top