FANDOM


More player characters using a game variable
This tutorial was written by Polectron. Please give credit.
Click here for more tutorials!


Sprited

Modified player

In this tutorial we will see how to have as many different players as you want by only updating a variable.

Components:

For this mod we need:

  • A variable i.e: Variable 105
  • The character sprites for walking and running

Code:

This a very simple mod, you only need to edit a few lines of code.

First search for this lines in the section Walk_Run, near line 48:

          # Display running character sprite
          @character_name=meta[5]
        else
          # Display normal character sprite 
          @character_name=meta[1]

Now we are going to replace them with this other lines:

# Display running character sprite
          chrval = $game_variables[105]
          @character_name= chrval.to_s+"r" 
        else
          # Display normal character sprite 
          chrval = $game_variables[105]
          @character_name= chrval.to_s+"n"

Now, change the intro script:

Search for this lines:

script: pbChangePlayer(0)

script: pbChangePlayer(1)

And replace them with this:

script: pbChangePlayer(0) 
script: $game_variables[105] = 0

script: pbChangePlayer(1) 
script: $game_variables[105] = 1

In the next revision of this mod I will include also the modification for the trainer sprite and the sprites for diving and cycling.

Explanation:

For changing between trainers we need to update the variable's value i.e: trainer number: 1, variable value :1

When using this mod, you need the following files (replace X with the variable's value):

  • Walking: Xn.png i.e: 1n.png
  • Runnig: Xr.png i.e: 1r.png

Save this files in the same folder as standard characters.

Use:

Honey bun

Event

To use this mod just create an event that changes the selected variable:

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.