- 220
- Posts
- 10
- Years
- Portugal
- Seen Apr 15, 2024
Adding more player characters
This is an old script from the Essentials Wiki before its shut Down.
This is for Essentials v17.2.
NOT TESTED!
Currently, in essentials, you can only add a max of 8 player characters. But with this script you can add more, i think that if we using all the alphabetic letters, it will possably have a total of 26.
For example: If you wish to add all the pokemon player characters from Kanto to Alola, including unova 2 protagonists, it will have a total of 16 unique player characters.
But you must do a screen event with one or two pages to add all those characters so the players can choose from.
The Script:
NOTE: Changes are in Blue color. To search for lines inside a particular script use: Ctrl + F. To search in all scripts use: Ctrl + Shift + F.
1- In Editor_MapConnectionEditor add:
Spoiler:
Code:
GLOBALMETADATA=[
["Home",MapCoordsFacingProperty,
_INTL("Map ID and X and Y coordinates of where the player goes if no Pokémon Center was entered after a loss.")],
["WildBattleBGM",BGMProperty,
_INTL("Default BGM for wild Pokémon battles.")],
["TrainerBattleBGM",BGMProperty,
_INTL("Default BGM for Trainer battles.")],
["WildVictoryME",MEProperty,
_INTL("Default ME played after winning a wild Pokémon battle.")],
["TrainerVictoryME",MEProperty,
_INTL("Default ME played after winning a Trainer battle.")],
["SurfBGM",BGMProperty,
_INTL("BGM played while surfing.")],
["BicycleBGM",BGMProperty,
_INTL("BGM played while on a bicycle.")],
["PlayerA",PlayerProperty,
_INTL("Specifies player A.")],
["PlayerB",PlayerProperty,
_INTL("Specifies player B.")],
["PlayerC",PlayerProperty,
_INTL("Specifies player C.")],
["PlayerD",PlayerProperty,
_INTL("Specifies player D.")],
["PlayerE",PlayerProperty,
_INTL("Specifies player E.")],
["PlayerF",PlayerProperty,
_INTL("Specifies player F.")],
["PlayerG",PlayerProperty,
_INTL("Specifies player G.")],
["PlayerH",PlayerProperty,
_INTL("Specifies player H.")][COLOR="DeepSkyBlue"],
["PlayerI",PlayerProperty,
_INTL("Specifies player I.")],
["PlayerJ",PlayerProperty,
_INTL("Specifies player J.")][/COLOR]
]
NOTE: Pay attention to the commas! And add more alphabetic numbers. Where it says: Species player H = 8, I = 9 and so on.
2- In PSystem_Utilities change:
Spoiler:
Code:
def pbChangePlayer(id)
return false if id<0 || [COLOR="DeepSkyBlue"]id>=8[/COLOR]
meta = pbGetMetadata(0,MetadataPlayerA+id)
return false if !meta
$Trainer.trainertype = meta[0] if $Trainer
$game_player.character_name = meta[1]
$game_player.character_hue = 0
$PokemonGlobal.playerID = id
$Trainer.metaID = id if $Trainer
end
def pbGetPlayerGraphic
id = $PokemonGlobal.playerID
return "" if id<0 || [COLOR="DeepSkyBlue"]id>=8[/COLOR]
meta = pbGetMetadata(0,MetadataPlayerA+id)
return "" if !meta
return pbPlayerSpriteFile(meta[0])
end
def pbGetPlayerTrainerType
id = $PokemonGlobal.playerID
return 0 if id<0 || [COLOR="DeepSkyBlue"]id>=8[/COLOR]
meta = pbGetMetadata(0,MetadataPlayerA+id)
return 0 if !meta
return meta[0]
end
NOTE: Change the blue part to your number of player characters. 8 is the current max for essentials.
3- In MiscData add:
Spoiler:
Code:
#===============================================================================
# Global and map metadata
#===============================================================================
MetadataHome = 1
MetadataWildBattleBGM = 2
MetadataTrainerBattleBGM = 3
MetadataWildVictoryME = 4
MetadataTrainerVictoryME = 5
MetadataSurfBGM = 6
MetadataBicycleBGM = 7
MetadataPlayerA = 8
MetadataPlayerB = 9
MetadataPlayerC = 10
MetadataPlayerD = 11
MetadataPlayerE = 12
MetadataPlayerF = 13
MetadataPlayerG = 14
MetadataPlayerH = 15
[COLOR="DeepSkyBlue"]MetadataPlayerI = 16
MetadataPlayerJ = 17[/COLOR]
NOTE: Pay attention to the commas! And add more alphabetic numbers. Same as before.
Spoiler:
Code:
module PokemonMetadata
GlobalTypes = {
"Home" => [MetadataHome,"uuuu"],
"WildBattleBGM" => [MetadataWildBattleBGM,"s"],
"TrainerBattleBGM" => [MetadataTrainerBattleBGM,"s"],
"WildVictoryME" => [MetadataWildVictoryME,"s"],
"TrainerVictoryME" => [MetadataTrainerVictoryME,"s"],
"SurfBGM" => [MetadataSurfBGM,"s"],
"BicycleBGM" => [MetadataBicycleBGM,"s"],
"PlayerA" => [MetadataPlayerA,"esssssss",:PBTrainers],
"PlayerB" => [MetadataPlayerB,"esssssss",:PBTrainers],
"PlayerC" => [MetadataPlayerC,"esssssss",:PBTrainers],
"PlayerD" => [MetadataPlayerD,"esssssss",:PBTrainers],
"PlayerE" => [MetadataPlayerE,"esssssss",:PBTrainers],
"PlayerF" => [MetadataPlayerF,"esssssss",:PBTrainers],
"PlayerG" => [MetadataPlayerG,"esssssss",:PBTrainers],
"PlayerH" => [MetadataPlayerH,"esssssss",:PBTrainers][COLOR="DeepSkyBlue"],
"PlayerI" => [MetadataPlayerI,"essssss",:PBTrainers],
"PlayerJ" => [MetadataPlayerJ,"essssss",:PBTrainers][/COLOR]
}
NOTE: Pay attention to the commas! And add more alphabetic numbers. Same as before.
4- In the essentials folder: PBS, edit the file: metadata:
PlayerA=POKEMONTRAINER_Red,trchar000,boy_bike,boy_surf,boy_run,boy_surf,boy_fish_offset,xxx
PlayerB=POKEMONTRAINER_Leaf,trchar001,girl_bike,girl_surf,girl_run,girl_surf,girl_fish_offset,xxx
This are the examples for male and female player characters from essentials. To add more, just add this sample lines and change the aplabetic numbers and all the overworld sprites, ID, gender, etc.
5- In the essentials folder: PBS, edit the file: trainertypes:
# See the documentation on the wiki to learn how to edit this file.
#-------------------------------
0,POKEMONTRAINER_Red,Pokémon Trainer,60,,,,Male,,
1,POKEMONTRAINER_Leaf,Pokémon Trainer,60,,,,Female,,
Note: Change the numbers ID, trainer internal name/class, gender, etc.
6- In the essentials folder: Graphics/Characters, add your new overworld sprites.
Make sure that the sprites names matches the ones from the PBS metadata file.
That's all, Give credit to me when using this: Richard PT.
Last edited: