• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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
    2
    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? 😭
     
  • 311
    Posts
    4
    Years
    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!
     
  • 2
    Posts
    2
    Years
    • Seen Jan 20, 2022
    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! 👍
     
    Back
    Top