• 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!
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

Changing Player Character

  • 12
    Posts
    11
    Years
    • Seen Dec 31, 2013
    Is it possible to change the player character midway through a game?

    Ex: Playing as Red with a Pikachu up to Cerulean City, and then switching to Blue with a different sprite and party of Pokemon.

    I'd like to be able to have two plots going on in one game, changing between the two players at certain points. Is this even possible?
     
    yes it is simple to do this
    you have just add an new charcter
    (go to pbs -metadata-add a new player(like the other two players )
    than you can later change the charkater in the game with this code
    Comment:initializes player 2 (PlayerC)
    script:pbChangePlayer(2)
    sorry for the bad explanation
    if you still don't understand it please ask me common
     
    Like the linkthehero said:
    Simply add "pbChangePlayer(x)" as a script command in the event you want to switch characters in, where x is the ID of the 2nd character, as defined in metadata.txt.
    Metadata.txt is also where you change which sprites, backsprites and overworlds a player-character should have and so forth.
     
    Bear in mind that just changing the player's character will not change their money/party/storage boxes/badges/etc. You'll need to alternate between two sets of those things as you alternate between characters.
     
    Bear in mind that just changing the player's character will not change their money/party/storage boxes/badges/etc. You'll need to alternate between two sets of those things as you alternate between characters.

    Hmm, good to know. How would I code that alternation? I could make a "rule" of the game be that you only use certain pokemon as certain characters, but leaving that up to the player doesn't feel very professional...
     
    Hmm, good to know. How would I code that alternation? I could make a "rule" of the game be that you only use certain pokemon as certain characters, but leaving that up to the player doesn't feel very professional...

    I have to agree, because in my game, I would like to the player to have the choice to ACTIVELY switch between characters (since my game follows a traditional RPG, rather than a generic Pokemon game) at will, and doing so would also allow them to switch to the other characters current party. Because currently, the only way that you can switch between characters is if you make an event for it, and you just trigger it, I am quite interested in this to be honest. A custom menu option for this should be very useful without relying on events and stuff.
     
    I have character switching in my game, but it's temporary (you can't save the game while you're the other character). Here's what I did in my case; I made two methods, one for storing the current player character "state" in a global variable, and another for restoring that state. State meaning party/money/etc. Storing simply means writing the state in the said global variable and restoring reading the state and writing it back in the $Trainer variable.

    Now this only works if the switch is temporary. If you'd like to be able to save the game while you're the other character, you could do something like this.

    Spoiler:


    Here, I put the 'players' array in the Game_System class, because the variable $game_system gets saved automatically when you save the game, meaning that the 'players' array will also get saved. You'll need to extend the Game_System class with this variable.

    Now, say we want to become another character, Blue.

    Spoiler:


    That's how you could do it. And, becoming Red again.

    Spoiler:


    Hope this helps!
     
    I have character switching in my game, but it's temporary (you can't save the game while you're the other character). Here's what I did in my case; I made two methods, one for storing the current player character "state" in a global variable, and another for restoring that state. State meaning party/money/etc. Storing simply means writing the state in the said global variable and restoring reading the state and writing it back in the $Trainer variable.

    Now this only works if the switch is temporary. If you'd like to be able to save the game while you're the other character, you could do something like this.

    Spoiler:


    Here, I put the 'players' array in the Game_System class, because the variable $game_system gets saved automatically when you save the game, meaning that the 'players' array will also get saved. You'll need to extend the Game_System class with this variable.

    Now, say we want to become another character, Blue.

    Spoiler:


    That's how you could do it. And, becoming Red again.

    Spoiler:


    Hope this helps!

    As helpful as this is, I have one question: where in Game_System would you put it? Would you apply it to a specific line? Or would you just add at the end of script after "end?"
     
    As helpful as this is, I have one question: where in Game_System would you put it? Would you apply it to a specific line? Or would you just add at the end of script after "end?"

    So, in the script Game_System, in class Game_System, after the last attr_accessor (line 16) put this

    attr_accessor :players

    And in method initialize, wherever you want between the "def initialize" and "end", put this

    @players = []

    That should be it.
     
    Back
    Top