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

Multiple Protagonists

115
Posts
9
Years
    • Seen Nov 17, 2023
    Yeah, that's one option, but how would it work in practice? If the partner can wander around on their own then it would be a bit weird to teleport them into double battles. And what happens if the partner walks into the line of sight for an NPC? There's all sorts of other things that I'd want someone to have a good idea about how to solve too. I don't think you can simply take the single player game and add a second player in there.

    But if someone has a convincing idea, then I might be willing to turn it into a reality. I'm very interested in seeing a two-player co-op Pokémon experience, even if I have to make it myself!

    I realize this post is months old, but I thought up a compelling idea for a co-op system.

    It involves the partner system, where player 1 leads and player 2 automatically follows, but both players can also split off and play on their own as well. This means it would require a splitscreen set up, or at least 2 separate windows of the game, one for each player.

    Party Up
    Spoiler:


    Independent Play and Scenarios for Gameplay
    Spoiler:


    Given the scenarios mentioned above, here's an example of how interacting with other players could work:
    Either player can talk to each other, which will bring up a menu asking "What would you like to do with [Player 2]?" with the options of party up/leave party, battle, share dex info, etc. When one player selects certain options, the second player gets some text that says "[Player 1]" has requested [insert action here]. Yes/No?"

    Note 1: Since battles are generally limited to 6 Pokemon per team, each player may need to either choose 3 of the 6 in their Pokemon party to use in battle, or have a hard limit of 3 Pokemon in each player's party max. Alternatively, automatically pulling the first 3 Pokemon from each player's party into the battle could work too.

    Note 2: If both players are playing independently, and one player is in battle, the other player will get a dialogue box of "Player is busy, try again later" when trying to interact with them. This also applies to trainers, items, and NPC's if one player is in the process of interacting with them.

    Note 3: While I initially thought it might be a good idea to allow both players to phase through each other when playing independently, I realized that it would look really awkward if for example Player 1 is idling in front of the Pokecenter nurse and Player 2 walks inside them to talk to the nurse. For that reason (and I'm sure there's other scenarios where this would look weird), players should be solid to each other when playing independently.

    I realize this probably looks like a ton of work, but what do you think? Is it feasible?
     
    Last edited:
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    I realize this post is months old, but I thought up a compelling idea for a co-op system.
    Better late than never! But yeah, in all seriousness I'm still wanting to thrash out this idea :)

    Your proposal sounds somewhat more ambitious than what I was planning, it seems like you're thinking about how to adapt Essentials so that it any game could support co-op (with a little work on the events), whereas I'm simply thinking of creating a single game (more like a demo, really) to demonstrate the concepts. The main difference is that I'm assuming that we'll design the routes around co-op, cut features that don't work nicely, etc.

    Here's some thoughts on your ideas, anything I don't reply to specifically I agree with :)

    It involves the partner system, where player 1 leads and player 2 automatically follows, but both players can also split off and play on their own as well. This means it would require a splitscreen set up, or at least 2 separate windows of the game, one for each player.

    Party Up
    Players can party up with each other by having one player interact with the other. So for example, if player 1 talks to player 2, a menu will open up for player 1 with these options: LEADER, JOIN PARTY. They do what you'd expect. LEADER causes dialogue to show up for player 2 that asks them if they want player 1 to lead them. JOIN PARTY asks player 2 if they want to follow player 1.

    While partied up, both players will fight in trainer battles, which will always be double battles. There could even be a check that sees if a trainer has 1 pokemon, and if so, to clone that pokemon to prevent the double battle from becoming a 2v1. Wild battles will also be forced into double battle scenarios.

    Either player can choose to leave the party at any time by interacting with the other player. In the case of the leader, they would have to turn around and interact with the follower. Because the follower is almost always facing the leader, they can press the interact button to leave the party at any time. Some sort of dialogue box would come up and ask "Are you sure you want to leave the party? yes/no".
    Multiple windows is what I had in mind for playing over the internet. I probably wouldn't bother implementing split-screen because having two windows is a decent workaround.

    I'm not sold on partying up because I don't think it would be fun to give up control of your player. But I do love the idea of double battles, so what if the second player can turn a single battle into a double battle by interacting with their partner while the partner is in the "!" animation/dialogue of the NPC trainer?

    That said, it could be a useful tool for cut scenes because otherwise any movement-based events could end up looking weird; e.g. imagine one of the players is standing in front of Oak's lab when the other activates the "Wait!" cut scene, Oak is going to walk through that first player.

    When players are not partied up, each of them can play the game through as you'd normally expect. However, there's a few checks that need to be in place to balance things out.

    Scenario 1: Trainers. Player 1 already fought a trainer solo, but Player 2 did not. Trainers will need a check to see who defeated them, and if one of the two players have not, to challenge said player if they spot them.

    Scenario 2: Same as Scenario 1, only this time, both players are partied up. In this case, if at least one player has not fought the trainer yet, the trainer will challenge both players.
    I think I prefer NPC trainers only battling once, because that way if the players split up to do different things it's easier for whichever finishes first to catch up with the other (because they get to "skip" all the battles), and also this lets the party clear mandatory battles more quickly, e.g. on Nugget Bridge player 1 could battle the first, third, and fifth trainers, while player 2 battles the others.

    Scenario 3: Item pick ups. When partied up, if the leader picks up an item, the follower will also get said item. When playing independently, each item will need a check, like trainers, that tracks which player picked the item up already. If player 1 picks up the item, it will disappear for them, but player 2 will still be able to pick up said item. Maybe there could also be an option for players to give each other any number of items when interacting while partied up.

    Scenario 4: Same as Scenario 3, but only one of two players picked up an item, and the player who did not pick up the item is now leading. In this case, I think only the player that hasn't picked the item up yet should get it. Otherwise you could easily create a loophole that allows duplication of rare items.
    I guess for consistency with my opinion on NPC trainers I'd make items be one-shot across both players too, but I'm not particularly invested in that implementation. I definitely like the idea of being able to trade items with your partner. I'd probably go so far as to allow player 2 to buy Pokéballs for player 1 if they've run out in a wild battle. I doubt it will come up in the typical play through, but I would feel pretty clever if I thought of that when playing!

    Scenario 8: Saving. Both players should have access to saving, and if one player saves, it should save for the other player as well. Allowing players to save independently could work, but might be messy. If players are playing independently and one player is either in a dialogue or in battle, the save dialogue could tell the player attempting to save that the other player is busy, please wait.
    I like the shared saves. If need be you could restrict saving to only when both players are in a Pokémon Center to ensure that no weirdness can occur.

    Scenario 10: Trading. This would probably be easiest to do at Pokecenters, either by having both players party up and enter a trade room together, or just having each player enter the trade room at any Pokecenter and linking up that way. Battling should be able to happen anywhere though, just by talking to the second player should give you the option to battle them. That brings us to the last scenario...
    Another option is to let the players share the Pokémon Storage PC. Did you have a reason for wanting to prevent trades at any time?

    Scenario 11: PvP battling. Co op players will have the option to battle each other. These battles should not reward Pokemon exp to prevent grinding off each other. Selecting the "Run" option during battle will give players the option to forfeit. If either player's Pokemon party is fainted at the end of the battle, they will white out as expected. In the case of a draw scenario due to self-destruct, etc, both players will be partied up when they white out and are sent to the Pokecenter.
    I guess with my implementation of items only being on the ground once this means that you could PvP your partner, white them out, and steal the item(s) they were about to pick up! I… am okay with that >:D

    As for whiting out in general, I think I'd let the player wait for their partner to show up and heal them rather than go back to the Pokémon Center, if they want.

    Note 1: Since battles are generally limited to 6 Pokemon per team, each player may need to either choose 3 of the 6 in their Pokemon party to use in battle, or have a hard limit of 3 Pokemon in each player's party max. Alternatively, automatically pulling the first 3 Pokemon from each player's party into the battle could work too.
    Yeah, choosing or automatically using the first three sounds like a good idea. The other option is to give each NPC trainer a second team that they use for double battles which could have to up twelve Pokémon. The other benefit of different teams is that you could deliberately give them Pokémon/movesets that are good in doubles.

    Note 3: While I initially thought it might be a good idea to allow both players to phase through each other when playing independently, I realized that it would look really awkward if for example Player 1 is idling in front of the Pokecenter nurse and Player 2 walks inside them to talk to the nurse. For that reason (and I'm sure there's other scenarios where this would look weird), players should be solid to each other when playing independently.
    Agreed! Solid players could also have benefits for puzzles, and for making mandatory trainers.
     
    115
    Posts
    9
    Years
    • Seen Nov 17, 2023
    Better late than never! But yeah, in all seriousness I'm still wanting to thrash out this idea :)

    Your proposal sounds somewhat more ambitious than what I was planning, it seems like you're thinking about how to adapt Essentials so that it any game could support co-op (with a little work on the events), whereas I'm simply thinking of creating a single game (more like a demo, really) to demonstrate the concepts. The main difference is that I'm assuming that we'll design the routes around co-op, cut features that don't work nicely, etc.

    The thing is, most of this stuff is addressing problems that will inevitably come up when designing a co-op experience anyway. Yes, it's more of an add-on/kit type of thing for Essentials, but I figured that designing things more generically would allow others to more easily create their own co-op experiences too. I'm not a big fan of keeping useful resources to myself, or limiting them to the scope of one game when others can benefit from it too.

    Multiple windows is what I had in mind for playing over the internet. I probably wouldn't bother implementing split-screen because having two windows is a decent workaround.

    I'm not sold on partying up because I don't think it would be fun to give up control of your player. But I do love the idea of double battles, so what if the second player can turn a single battle into a double battle by interacting with their partner while the partner is in the "!" animation/dialogue of the NPC trainer?

    That said, it could be a useful tool for cut scenes because otherwise any movement-based events could end up looking weird; e.g. imagine one of the players is standing in front of Oak's lab when the other activates the "Wait!" cut scene, Oak is going to walk through that first player.

    I mean, as long as each player has the option for independent control, partying up isn't a huge deal breaker for me, nor is the difference between splitscreen vs two windows. I just thought partying up would be easier to work with since it already exists for NPC's in Essentials. Interacting with the co-op player when they're on the brink of starting a battle is a fine alternative though.

    I think I prefer NPC trainers only battling once, because that way if the players split up to do different things it's easier for whichever finishes first to catch up with the other (because they get to "skip" all the battles), and also this lets the party clear mandatory battles more quickly, e.g. on Nugget Bridge player 1 could battle the first, third, and fifth trainers, while player 2 battles the others.

    You raise some good points. I'm more concerned with players potentially missing out on experience points and money if they're busy with wild battles/looking for Pokemon to catch while the other player hogs all the trainers for themselves.

    I guess for consistency with my opinion on NPC trainers I'd make items be one-shot across both players too, but I'm not particularly invested in that implementation. I definitely like the idea of being able to trade items with your partner. I'd probably go so far as to allow player 2 to buy Pokéballs for player 1 if they've run out in a wild battle. I doubt it will come up in the typical play through, but I would feel pretty clever if I thought of that when playing!

    While I'm fine with this for common items like potions and berries, I can see this being a problem for rare/valuable items like the Masterball. Also, how would Key Items work? Is player 2 just out of luck if player 1 gets the bike first?

    I like the shared saves. If need be you could restrict saving to only when both players are in a Pokémon Center to ensure that no weirdness can occur.

    I think that as long as players aren't in battle, they should be able to save. If one player is currently grinding through a long cave/dungeon or a route with no Pokecenter nearby, the other player may have to wait a while before saving. Also, it's pretty common for players to save before fighting a boss like a legendary or the elite four, and in both instances there won't be a Pokecenter available.

    Another option is to let the players share the Pokémon Storage PC. Did you have a reason for wanting to prevent trades at any time?

    I suppose there's no reason to prevent players from trading at any time, but I can see griefing occur if both players get to share one PC. Imagine working so hard to catch a legendary Pokemon (maybe even a shiny!), just to have your partner log into the PC immediately after the battle to release it back into the wild >:(

    There would undoubtedly also be instances of players "stealing" each other's Pokemon to use it for themselves, such as the caught legendary I gave in the prior example. Even with honor rules, you know it's still going to happen.

    I guess with my implementation of items only being on the ground once this means that you could PvP your partner, white them out, and steal the item(s) they were about to pick up! I… am okay with that >:D

    Again, that's fine for common items, but might cause issues for rarer items. See what I said about items/key items above.

    As for whiting out in general, I think I'd let the player wait for their partner to show up and heal them rather than go back to the Pokémon Center, if they want.

    I think it should be up to the white out victim, because if their co-op partner is occupied with something at the moment, they're not going to want to wait and would rather take the L and go back to the Pokecenter. Inversely, if the white out occurs in the deepest part of a dungeon/cave, the co-op partner may not want to deal with navigating all the way out to their co-op buddy.

    Yeah, choosing or automatically using the first three sounds like a good idea. The other option is to give each NPC trainer a second team that they use for double battles which could have to up twelve Pokémon. The other benefit of different teams is that you could deliberately give them Pokémon/movesets that are good in doubles.

    Having up to 12 Pokemon might be interesting for bosses like gym leaders, but most common trainers shouldn't have more than 6. Fighting Youngster Joey's 12 Rattatas could get exhausting after a while.
     
    Last edited:
    50
    Posts
    4
    Years
    • Seen Oct 17, 2023
    Sorry for bothering, but there is one thing that I either can't find or I'm not sure about.

    I'm using variables How do I restore the original character? I mean the character that is chosen at the beginning of the game.
     
    233
    Posts
    5
    Years
    • Seen Oct 9, 2023
    I assume you used something like "pbSwitchCharacter(1)" to switch to your other character? You simply use "pbSwitchCharacter(0)" in a Script command to return to your starting character.
     
    15
    Posts
    4
    Years
  • Hello! I've been making a fangame with this script for the past month- it's so cool and I found an awesome way to implement it in the story.
    However, my only problem is the lack of trading options. Maybe sharing the same PC? Even if its as simple as making the two trainers share a daycare slot so that you can transfer Pokemon over to the other player that way, and I could just call the daycare a Pokemon transporter or something. Anything at all would be a huge help. I'm not going for co-op with two players, moreso co-op with yourself, where each trainer has access to only certain areas in the game. Imagine the Kanto and Johto areas of GSC split between two players up until all badges have been collected. It's not exactly that, I'm using all original maps and things, but that's probably a good way to describe it. And for all intents and purposes, it's coming out great- just this one issue. If anyone can help me find a solution I would be so very thankful! :)
     
    11
    Posts
    9
    Years
  • I had a compatibility problem with the following pokémon system. When the second protagonist catches the Pokémon this error occurs:

    Multiple Protagonists


    I created a fix for this problem, and here is my suggestion:

    Look for line 1559 of Following_Pokemon, it should be this one:

    Multiple Protagonists


    Add in the line just above the term begin, and in the line just below the term rescue, and just below rescue put an end, as in the image:

    Multiple Protagonists


    The code:
    Code:
          if Input.trigger?(Input::C) # try to talk to pokemon
            begin
              $PokemonTemp.dependentEvents.talk_to_pokemon
            rescue
              # Nothing happens if the protagonist 
              # doesn't have a dependent yet but has already 
              # activated the switch
            end
          end

    The comment is not necessary, but I put it to explain the reason for this try/catch in this function.

    Hope this helps.
     
    233
    Posts
    5
    Years
    • Seen Oct 9, 2023
    Hello! I've been making a fangame with this script for the past month- it's so cool and I found an awesome way to implement it in the story.
    However, my only problem is the lack of trading options. Maybe sharing the same PC? Even if its as simple as making the two trainers share a daycare slot so that you can transfer Pokemon over to the other player that way, and I could just call the daycare a Pokemon transporter or something. Anything at all would be a huge help. I'm not going for co-op with two players, moreso co-op with yourself, where each trainer has access to only certain areas in the game. Imagine the Kanto and Johto areas of GSC split between two players up until all badges have been collected. It's not exactly that, I'm using all original maps and things, but that's probably a good way to describe it. And for all intents and purposes, it's coming out great- just this one issue. If anyone can help me find a solution I would be so very thankful! :)

    Thank you! I've actually had more character interaction functionality on my TODO list for a while now, but I've been so bogged down by school work that I haven't had a chance to look at it haha. My idea for trading was to have a screen where two characters can trade one at a time, or something like that. I'd rather not have them share a PC storage because I want the characters to feel as individual as possible. Anyways, once summer *officially* starts for me, I'll have more time to look into this and release an update!

    I really like your script, thank you very much!

    :)

    I had a compatibility problem with the following pokémon system. When the second protagonist catches the Pokémon this error occurs:

    Multiple Protagonists


    I created a fix for this problem, and here is my suggestion:

    Look for line 1559 of Following_Pokemon, it should be this one:

    Multiple Protagonists


    Add in the line just above the term begin, and in the line just below the term rescue, and just below rescue put an end, as in the image:

    Multiple Protagonists


    The code:
    Code:
          if Input.trigger?(Input::C) # try to talk to pokemon
            begin
              $PokemonTemp.dependentEvents.talk_to_pokemon
            rescue
              # Nothing happens if the protagonist 
              # doesn't have a dependent yet but has already 
              # activated the switch
            end
          end

    The comment is not necessary, but I put it to explain the reason for this try/catch in this function.

    Hope this helps.

    Thanks for finding this and posting a solution! I'll also see if there's anything I can change in my script so that users don't have to worry about making a manual change if they have both scripts.
     
    233
    Posts
    5
    Years
    • Seen Oct 9, 2023
    I've actually had more character interaction functionality on my TODO list for a while now, but I've been so bogged down by school work that I haven't had a chance to look at it haha. My idea for trading was to have a screen where two characters can trade one at a time, or something like that.

    ...

    I'll also see if there's anything I can change in my script so that users don't have to worry about making a manual change if they have both scripts.

    I have made trading functions and a fix for the compatibility issue with the Follow Pokemon script. This script is now updated to v2.0!
     
    233
    Posts
    5
    Years
    • Seen Oct 9, 2023
    For anyone getting an error involving gsubPN and compiling trainer events, I have updated lines 100-102 in the Installation guide to fix that.

    EDIT: Fixed an error where \PN0 wouldn't work until pbSwitchCharacter was called at least once in-game.
     
    Last edited:
    15
    Posts
    4
    Years
  • Thanks for all the work on your updates! This script is so lovely.

    Just wondering- is there a way to make a conditional event script that allows for differentiating based on which player character is being used? For example, in the game I'm working on protagonist 1 has many different outfit combinations that can be accessed from a mirror at home. But protagonist 2 is only going to have one costume. So my plan would be that a conditional checks which protagonist is being used, and if its the first one, it allows for changing the outfit, and if it's the second one it displays text saying something like "Lookin' good!" Is there any way to have the game run that check? Thanks again for such an awesome script!
     
    233
    Posts
    5
    Years
    • Seen Oct 9, 2023
    Thanks for all the work on your updates! This script is so lovely.

    Just wondering- is there a way to make a conditional event script that allows for differentiating based on which player character is being used? For example, in the game I'm working on protagonist 1 has many different outfit combinations that can be accessed from a mirror at home. But protagonist 2 is only going to have one costume. So my plan would be that a conditional checks which protagonist is being used, and if its the first one, it allows for changing the outfit, and if it's the second one it displays text saying something like "Lookin' good!" Is there any way to have the game run that check? Thanks again for such an awesome script!

    Yes! The variables "$PokemonGlobal.playerID" and "$Trainer.metaID" keep track of the current character ID. Your conditional branch event can start with this:
    Code:
    @>Conditional Branch: Script: $PokemonGlobal.playerID == 0
      @>
    : Else
      @>Conditional Branch: Script: $PokemonGlobal.playerID == 1
        @>
      : Branch End
    : Branch End
     
    233
    Posts
    5
    Years
    • Seen Oct 9, 2023
    I have made trading functions and a fix for the compatibility issue with the Follow Pokemon script. This script is now updated to v2.0!

    Woops, turns out my "fix" for the compatibility issue was incorrect. I've updated the script to include the correct fix (don't need to install it from the Installation guide this time).
     
    15
    Posts
    4
    Years
  • Thanks for the help! :)
    One last question. Do you know if there's a way to register the costume of one character and apply it to another event? For example, in my game the second protagonist will come across the first protagonist at a certain point of time, but the first has all these costume options. Would you happen to know a script that could remember which costume protagonist 1 is using and apply it to an event?
     
    233
    Posts
    5
    Years
    • Seen Oct 9, 2023
    Thanks for the help! :)
    One last question. Do you know if there's a way to register the costume of one character and apply it to another event? For example, in my game the second protagonist will come across the first protagonist at a certain point of time, but the first has all these costume options. Would you happen to know a script that could remember which costume protagonist 1 is using and apply it to an event?

    When you say "costume" are you talking about the default Essentials mechanic of outfits? If so then there's a tutorial on how that works here: (broken link removed) . The variable "$Trainer.outfit" stores the outfit for each character. If you're using another costume script that doesn't store its data in PokeBattle_Trainer, then you probably need to add it to my script yourself using the Script Compatibility guide on line 335 (if you do this, make sure to restart your save when testing your changes).

    EDIT: Oh, I think I missed the point of your question. If you want to access what Protagonist 1 is wearing WHILE Protagonist 2 is the current player, the variable that stores that is:
    Code:
    getTrainerFromCharacter(0).outfit
    where 0 is the character ID. In general, if you need to access the data of any other protagonist, you can use the following format:
    Code:
    $PokemonGlobal.mainCharacters[id][PBCharacterData::Data]
    where "id" is the character ID and "Data" is the name of whatever data you need to access (found in module PBCharacterData). The outfit variable I wrote above is just shorthand for the following:
    Code:
    $PokemonGlobal.mainCharacters[0][PBCharacterData::Trainer].outfit
     
    Last edited:
    15
    Posts
    4
    Years
  • Sorry I worded that confusingly! Yes I meant the essentials 'outfit' function, i forgot the word it used for a moment, lol.
    I'm fairly familiar with applying the outfits to the player character, I'm just not sure how to apply them to another event.
    I tried the getTrainerFromCharacter(0).outfit but I'm not sure how to make that then update an NPC's event graphic.
     
    233
    Posts
    5
    Years
    • Seen Oct 9, 2023
    You can check this "getTrainerFromCharacter(0).outfit" in a Conditional Branch event, and depending on the outfit number (0 is default), have the event change its graphic by going to Set Move Route and clicking "Change Event Graphic".
     
    233
    Posts
    5
    Years
    • Seen Oct 9, 2023
    Fixed an error that only seemed to occur to people who have never played a fangame using Essentials (thus have never had a save folder associated with Essentials).
     
    Back
    Top