• 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

233
Posts
5
Years
    • Seen Oct 9, 2023
    Hi everyone, I've made a mostly plug-and-play script that allows you to add multiple player characters to your game, each with their own distinct character data, like Pokemon, Bag, money, etc. I've detailed everything I can at the top of the script itself, so if you have any questions then that would be a great place to look first before asking me.

    To install this script, go to the GitHub repo linked below, then click on "Code > Download ZIP". From the ZIP file, extract the "Plugins" folder into your project's root folder.

    Make sure to RESTART YOUR SAVE before testing.

    Compatible with Essentials v21.1, v21, v20.1, v20 (see bottom of post for v20.1/v20 version)

    Latest Script (Edited October 8, 2023):
    v5.0.0: https://github.com/usabhinav/multiple-protagonists

    Pictures:
    DvNbfYQ.png


    UuoTTBz.png


    Changelog:
    https://pastebin.com/bmUvhN8K

    Legacy v20.1/v20 Version:
    https://github.com/usabhinav/multiple-protagonists/releases/tag/v4.1.1

    If you notice any bugs, please don't hesitate to tell me! I want to make this as bug-free as possible. I hope you find this script useful!

    Please credit: NettoHikari
     
    Last edited:
    1,805
    Posts
    7
    Years
  • what? Essentials already supports up to 8 player chars. So unless this is a different gender select screen, this should be labeled as a tutorial.
     
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    what? Essentials already supports up to 8 player chars. So unless this is a different gender select screen, this should be labeled as a tutorial.

    I'll let NettoHikari comment, but I guess the contribution here is having a separate location, bag, etc etc for each player?


    About this:

    Code:
    # Any maps that have \\PN in the name (a placeholder for the player's name) have
    # a strange bug of replacing it later than necessary. If you have any maps with
    # \\PN in it, this can be fixed by replacing the following:
    #
    # ret.gsub!(/\\PN/,$Trainer.name)# Find this
    #
    # with:
    #
    # ret=ret.gsub(/\\PN/,$Trainer.name) # Replace it with this
    I'm a bit confused by the description. I would describe the first bit of code as replacing the map's name earlier than necessary… Well actually I'd guess the problem is that the first code permanently replaces the map's name the first time it's run, but actually that doesn't sound too bad. I reckon you'd want to add \PN0 through \PN7 commands so that I can have "Red's House" (via \PN or \PN0) and "Blue's House" (via \PN1) assuming that the names of characters 1 and 2 are Red and Blue respectively.

    Anyway, I haven't actually tried using it yet so my intuition could be wrong, feel free to tell me that I'm confused about what's going on :)
     
    233
    Posts
    5
    Years
    • Seen Oct 9, 2023
    This is amazing! I can already visualize how it could be used in a game. It could be fun making it work with Asynchronous co-op multiplayer
    One question though, is there a way to make trainers battle each other?
    Thank you! I could definitely look into "Asynchronous co-op multiplayer", see how that works out. As for trainers battling each other, that is a really cool suggestion! I might add that in a future version of the script.

    what? Essentials already supports up to 8 player chars. So unless this is a different gender select screen, this should be labeled as a tutorial.
    As mgriffin stated, this script does more than just changing the visual appearance of the player - it actually creates entirely separate characters, and makes the process of switching between them as simple as possible. In fact, I'm pretty sure I said it in the initial post, "add up to 8 player characters to your game, each with their own distinct character data, like Pokemon, Bag, money, etc".

    I'm a bit confused by the description. I would describe the first bit of code as replacing the map's name earlier than necessary… Well actually I'd guess the problem is that the first code permanently replaces the map's name the first time it's run, but actually that doesn't sound too bad. I reckon you'd want to add \PN0 through \PN7 commands so that I can have "Red's House" (via \PN or \PN0) and "Blue's House" (via \PN1) assuming that the names of characters 1 and 2 are Red and Blue respectively.
    Sorry about being unclear, I just meant that the name of the house sort of constantly changes. Like if a player named Red steps into a house named "\PN's House", the name would show as "Red's House," and if later another character named Blue comes in, the name would still show "Red's House", UNTIL you save, close and open the game again, in which case it will then turn into "Blue's House". Even then, the "fix" doesn't actually make it so that the map's name is permanent, so I could try implementing your suggestion to add \PN0 - \PN7. I hope that made things a little more clear, if not though then don't worry about it XD
    I agree with you though, it seems pretty trivial, I only included it cuz it was in the tutorial I based my script off of, and I figured at least it's there if someone wants it.
     
    178
    Posts
    10
    Years
  • Thank you! I could definitely look into "Asynchronous co-op multiplayer", see how that works out. As for trainers battling each other, that is a really cool suggestion! I might add that in a future version of the script.

    The co-op thing is not really that necessary, but it could be fun for a game focused in, well, co-op. Although I don't recall any fangame that really uses that.

    It may not work with your script at all, about trainers battling each other, but this might help as a research?
    Also there's this script for making a custom trainer inside an event without having to mess with the PBS.
    Sadly I don't know anything about scripting, so I can only point out the places that might be useful.
     
    Last edited:
    233
    Posts
    5
    Years
    • Seen Oct 9, 2023
    The co-op thing is not really that necessary, but it could be fun for a game focused in, well, co-op. Although I don't recall any fangame that really uses that.

    It may not work with your script at all, about trainers battling each other, but this might help as a research?
    Also there's this script for making a custom trainer inside an event without having to mess with the PBS.
    Sadly I don't know anything about scripting, so I can only point out the places that might be useful.

    Yeah, I've never seen co op in any fangames I know of as well. Thanks for the links to those other scripts, I'll start looking more into allowing the player to battle other characters.
     
    Last edited:
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    The co-op thing is not really that necessary, but it could be fun for a game focused in, well, co-op.
    Yeah, I've never seen co op in any fangames I know of as well.

    Sorry to slightly hijack this thread, but I'd be very interested in hearing proposals for how this could work, and would be willing to do the bulk of the coding for a suggestion that I like.
     
    233
    Posts
    5
    Years
    • Seen Oct 9, 2023
    Sorry to slightly hijack this thread, but I'd be very interested in hearing proposals for how this could work, and would be willing to do the bulk of the coding for a suggestion that I like.

    Actually, while making this, I was also considering making a separate co-op script that would allow two characters playing side-by-side with each other - essentially like having two connected games running at once. I don't think it's really all that relevant to this script, though, but if you want to try something like that, then go ahead.
     
    44
    Posts
    8
    Years
    • Seen Apr 14, 2019
    Sorry to slightly hijack this thread, but I'd be very interested in hearing proposals for how this could work, and would be willing to do the bulk of the coding for a suggestion that I like.

    Actually, while making this, I was also considering making a separate co-op script that would allow two characters playing side-by-side with each other - essentially like having two connected games running at once. I don't think it's really all that relevant to this script, though, but if you want to try something like that, then go ahead.

    If you want something practical that could be applied to a large variety of fan games... Piggyback off the current partner system, maybe? Like, basically give control of the partner trainer that you can already use to another person. It could even use the variable bag/money/etc established in this to allow them to use items, buy stuff, etc.
     
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    If you want something practical that could be applied to a large variety of fan games... Piggyback off the current partner system, maybe? Like, basically give control of the partner trainer that you can already use to another person. It could even use the variable bag/money/etc established in this to allow them to use items, buy stuff, etc.

    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!
     
    178
    Posts
    10
    Years
  • 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!

    The only way I can see it working in a pokémon game would be if it was kinda like the game "A Way Out" where both players could do separate things from each other (as far as I know, I never played the game).

    If we only get the focus on a single screen it would be a mess because, as a developer perspective, we would need to track what each player are doing. What if they think about talking to different NPCs at the same time? And like you stated, what about battles? Would they play their own battles? Would it be a double battle? Aside from the battle issue, the talking with NPC thing could be remedied, thinking about a single screen, if there was a way to retain the screen size with maybe half the size for everything aside from battle sprites and then having speach ballons pop-up above NPC in a way that they wouldn't cover half of the screen (to still give freedom for the other player to explore the room). This is just an idea.

    With the tools we have now, I can only think about the player 1 giving the control for the player 2 when it switches to the second character and then in double battles it would be co-op.
     
    233
    Posts
    5
    Years
    • Seen Oct 9, 2023
    With the tools we have now, I can only think about the player 1 giving the control for the player 2 when it switches to the second character and then in double battles it would be co-op.

    I like this idea as well, and I think I can add such a feature in a future update. This also made me realize that I should probably add a function to allow registering other protagonists as partner trainers, even for non co-op battles.

    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!

    Personally, I still think a split-screen style between two characters would be the way to go for a complete co-op script, though it will be way more complicated and time-consuming than this script. I would be very interested to see this become a reality, but it's up to you.

    If you want something practical that could be applied to a large variety of fan games... Piggyback off the current partner system, maybe? Like, basically give control of the partner trainer that you can already use to another person. It could even use the variable bag/money/etc established in this to allow them to use items, buy stuff, etc.

    This pretty much sounds like my earlier suggestion, except the second character is a registered partner to the first character. Unfortunately, the current partner system doesn't really help much in the way of keeping track of two separate player entities, though, so it can't just be "piggybacked" off of.
     
    Last edited:
    39
    Posts
    17
    Years
    • Seen Feb 28, 2024
    This is a really cool script! I actually have a couple questions about it, maybe the solutions are simple, maybe they aren't.

    Is it possible to, after a certain point in time in the game (After a switch is set?) Combine the trainers PC Boxes or Bags? Or, if that's not possible, would it be possible to send Pokemon or items from one character to another? Obviously this isn't something I would available all the time, as it would pretty much defeat the purpose, but I like the idea of being able to make your final party out of members of all of the different teams.

    Other then that, other features that I think would be great you've already touched on, though again I'm unsure of how difficult they would be to do (Fighting the other protagonists and registering them as a partner.)

    I'm also really interested in the idea of a co-op game, as I know friends who would love to do that. I agree with you that split screen or on two different computers in the same world would be the most reasonable way to do this - maybe there could also be a way to have one trainer follow the other automatically as a partner, and if they are in that state all battles would become double battles? Something like that, just an idea anyway.

    Anyway, just wanted to post that I really like your script.
     
    178
    Posts
    10
    Years
  • there could also be a way to have one trainer follow the other automatically as a partner, and if they are in that state all battles would become double battles? Something like that, just an idea anyway.
    There's already a script for that: https://www.pokecommunity.com/showthread.php?t=342862
    It's quite old, but it seems to still for essentials 17.1 and my guess would be that it still works with 17.2.
     
    233
    Posts
    5
    Years
    • Seen Oct 9, 2023
    Is it possible to, after a certain point in time in the game (After a switch is set?) Combine the trainers PC Boxes or Bags? Or, if that's not possible, would it be possible to send Pokemon or items from one character to another? Obviously this isn't something I would available all the time, as it would pretty much defeat the purpose, but I like the idea of being able to make your final party out of members of all of the different teams.
    I'm not entirely sure what you mean by combining the different characters' parties and bags, but I think you're right in that it would kind of defeat the purpose of playing as separate characters. As for trading between characters... It's another thing I never thought of, actually. I think it does sound interesting, but it might be difficult to set up, since I'd need a way to let the player control both characters' trade screens or something like that - I could definitely look into it, though.

    Anyway, just wanted to post that I really like your script.
    Thank you :)
     
    233
    Posts
    5
    Years
    • Seen Oct 9, 2023
    One question though, is there a way to make trainers battle each other?
    Other then that, other features that I think would be great you've already touched on, though again I'm unsure of how difficult they would be to do (Fighting the other protagonists and registering them as a partner.)
    Finally got to it! I've now updated the script to allow registering/battling other characters, including the player themselves! I've put the necessary parameters in the script guide itself, but it uses the same functions: pbRegisterPartner, pbTrainerBattle, and pbDoubleTrainerBattle.
     

    Pokeminer20

    PDM20, Coder of Chaos!
    412
    Posts
    10
    Years
  • Finally got to it! I've now updated the script to allow registering/battling other characters, including the player themselves! I've put the necessary parameters in the script guide itself, but it uses the same functions: pbRegisterPartner, pbTrainerBattle, and pbDoubleTrainerBattle.

    after returning here and remembering what Maruno said about V18, this script will be so hype
     
    4
    Posts
    5
    Years
    • Seen Dec 7, 2023
    I followed the instructions and this happened.
    deviantart.com/suprgamrm/art/Error-813785874
     
    233
    Posts
    5
    Years
    • Seen Oct 9, 2023
    I followed the instructions and this happened.
    deviantart.com/suprgamrm/art/Error-813785874

    It looks like you didn't delete your old save file and start a new one after installing this, which I said to do near the top of the script.
     
    Last edited:
    Back
    Top