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

[Scripting Question] Pokemon Essentials V18.1 | 3v1 with partners

Foxx_Gaming

Wacky Wahoo Pizza Pasta Man
  • 35
    Posts
    4
    Years
    I'm trying to implement a sort of "boss battle" with the main legendary of my game at the end, and you're supposed to team up with both of your rivals to do it. However, upon loading into the battle, only one of the rivals is registered, and the player sends out 2 pokemon. Instead, I want there to be a trainer on the left (rival A) and a trainer on the right (rival B), and all 3 of them (rivals + player) send out 1 pokemon each against the legendary. Could someone help me figure out a way to do this through either scripting (assuming it'd have something to do with scripting) or events?
     
    A month later and I'm still trying to figure this out. Help would be much appreciated!

    Just a quick response, I can give you details later if you wish.
    The problem is that you can register only one partner in base Essentials.

    There is no choice other than edit the scripts.
    The idea is: everytime you see a $PokemonGlobal.partner occurrence in a script, you need to duplicate it for a new $PokemonGlobal.partner2. If you need a third partner you will need to change a lot more things, because the base Essentials allow only up to 3v3. But if you use Pokeminer's script, you can probably adapt to $PokemonGlobal.partner3 and $PokemonGlobal.partner4.

    This is heavy script modification so I suggest you make a backup, and you should not directly modify the function, but rather, copy/paste them to a new dedicated script before modifying them (Ruby allows you to redefine your functions).
     
    Last edited:
    so, when i said it sounds simple, i was getting my wires crossed with global events, not the global script, lol.
    if you could offer a more detailed breakdown, it would be much appreciated. thank you again!
     
    so, when i said it sounds simple, i was getting my wires crossed with global events, not the global script, lol.
    if you could offer a more detailed breakdown, it would be much appreciated. thank you again!

    Disclaimer: actually this is something I implemented myself and I use in my game. It's tested and all. However I had never planned to release this code as a separate resource, so be aware that this code might not work because I may have forgotten some parts!
    (Also I thought it was heavier scripting, but actually it looks quite straightforward...)

    In the file PField_Battle:
    Spoiler:


    And paste this code in a separate script, above Main but below ZUD if you use it. If you don't use ZUD, then what are you doing? you will need to comment the annoted lines.

    Spoiler:


    So when you need to make a battle with a partner, use pbRegisterPartner2() as you would pbRegisterPartner().
     
    Last edited:
    no dice. the event calls for pbRegisterPartner2 and it doesn't crash, but when i'm actually in the battle, only one partner shows up, and i still send out 2 pokemon to compensate.
     
    This was to be expected, sorry ^^"
    I hope you have time because I really don't remember all the changes I made.

    Can you post the complete code of the function:
    Code:
    def pbTrainerBattleCore(*args)
    I think I remember editting a few more things than what I told you.
    Use the [SPOILER_] [/SPOILER_] and [CODE_][/CODE_] environments please (without the underscores).
     
    I'm not quite sure what you mean by "spoiler" and "code" environments, haha. New to all of this "forum" stuff.
    If you would like, we may continue this through another way of contact (discord is my primary source) if that is easier for you. I may not be awake for much longer.
     
    Above the place whre you type your message, you have a series of tools; the very last tool on the right is "Insert a spoiler". If you click it, it will display something like this:

    [SPOILER_][/SPOILER_] (without the underscores)

    Put your cursor between the two halves:

    [SPOILER_]here[/SPOILER_]

    and click "Insert a spoiler" again, you will get:

    [SPOILER_][SPOILER_][/SPOILER_][/SPOILER_] (without the underscores)

    Now replace the two inner "SPOILER_" with "CODE_":

    [SPOILER_][CODE_][/CODE_][/SPOILER_] (without the underscores)

    And paste your code between the two CODE_:

    [SPOILER_][CODE_]Your code goes here[/CODE_][/SPOILER_]

    You have to remove the underscores though. I had to put them so that the site doesn't convert [SPOILER_][CODE_]code[/CODE_][/SPOILER_] into:
    Spoiler:
    and you wouldn't see what I was talking about.
     
    i see now, thanks a bunch. the entire function, right?

    Spoiler:

    hopefully that helps?
     
    i see now, thanks a bunch. the entire function, right?

    So yes I see one mistake, and it's on me ^^

    Find this part of the code:
    Code:
      if $PokemonGlobal.partner && !$PokemonTemp.battleRules["noPartner"] && foeParty.length>=1
        ally = PokeBattle_Trainer.new($PokemonGlobal.partner[1],$PokemonGlobal.partner[0])
        ally.id    = $PokemonGlobal.partner[2]
        ally.party = $PokemonGlobal.partner[3]
        playerTrainers.push(ally)
        playerParty = []
        $Trainer.party.each { |pkmn| playerParty.push(pkmn) }
        playerPartyStarts.push(playerParty.length)
        ally.party.each { |pkmn| playerParty.push(pkmn) }														
      end
    and replace it with:
    Code:
      room_for_partner  = (foeParty.length > 1)
      ally              = nil 
      if !room_for_partner && $PokemonTemp.battleRules["size"] &&
         !["single", "1v1", "1v2", "1v3"].include?($PokemonTemp.battleRules["size"])
        room_for_partner = true
      end
      if $PokemonGlobal.partner && !$PokemonTemp.battleRules["noPartner"] && room_for_partner
        ally = PokeBattle_Trainer.new($PokemonGlobal.partner[1],$PokemonGlobal.partner[0])
        ally.id    = $PokemonGlobal.partner[2]
        ally.party = $PokemonGlobal.partner[3]
        playerTrainers.push(ally)
        playerParty = []
        $Trainer.party.each { |pkmn| playerParty.push(pkmn) }
        playerPartyStarts.push(playerParty.length)
        ally.party.each { |pkmn| playerParty.push(pkmn) }
        setBattleRule("double") if !$PokemonTemp.battleRules["size"]
      end
     
    I too have been searching for a way to get this to work on v20.1 Anyone have any success? I'm no coder, but I've been using this thread as a reference to try and figure it out and feel like I've gotten somewhat close, being able to register two trainers and have them appear in battle. The Pokemon the third partner send out though is a duplicate of the first partner. If anyone's cracked the code, I'd be super grateful to hear about it!
     
    Back
    Top