Thread: [Essentials tutorial] Add More Than 4 Characters in Pokemon Essentials
View Single Post
  #1    
Old December 6th, 2010 (04:37 PM).
KitsuneKouta's Avatar
KitsuneKouta
狐 康太
 
Join Date: Mar 2010
Age: 23
Gender: Male
By default, Essentials only allows you to create 4 selectable characters (labeled A-D, and numbered 0-3). This tutorial will allow you to increase this number to include as many as you want. As a disclaimer, I cannot guarantee consistent results. I have used this method twice, with someone else using it once, and each time the results were different. In an unedited kit, the results were perfect, but in existing projects it's sort of hit and miss, so beware.

First, in PokemonEditor, find

GLOBALMETADATA=[

(it should be on line 2743) and right below it you should see entries for players A - D that look like this:

["PlayerA",PlayerProperty,
_INTL("Specifies player A.")],

Add identical entries starting right below the entry for "PlayerD," but change the letters (it should go up to F if you want 6 characters, Z if you want 26, etc. You could arbitrarily name more if you wanted such as PlayerAA, or AZ, etc., but you probably won't need that many).

In PokemonUtilities there are 3 small edits to make. Look for these lines (around line 1493):

return false if id<0||id>=4
return "" if id<0||id>=4
return 0 if id<0||id>=4

They're not right together, but pretty close. Change the 4s to the number of characters you want (i.e. change the 4s to 6s for 6 characters, 4 to 26 for 26 characters, etc.).Next, in PokemonMap, starting on line 275, there will be some metadata items that look like this:

Code:
MetadataHome=1
 MetadataPlayerA=2
 MetadataPlayerB=3
 MetadataPlayerC=4
 MetadataPlayerD=5
 MetadataStorageCreator=6
 MetadataWildBattleBGM=7
 MetadataTrainerBattleBGM=8
 MetadataWildVictoryME=9
 MetadataTrainerVictoryME=10
 MetadataTextSkin=11
 MetadataSurfBGM=12
 MetadataBicycleBGM=13
Add more entries for the number of characters you want, such as "MetadataPlayerE" or "MetadataPlayerF." Here's an example of how it'd look if you have 6 characters:
Code:
MetadataHome=1
 MetadataPlayerA=2
 MetadataPlayerB=3
 MetadataPlayerC=4
 MetadataPlayerD=5
 MetadataPlayerE=6
 MetadataPlayerF=7
 MetadataStorageCreator=8
 MetadataWildBattleBGM=9
 MetadataTrainerBattleBGM=10
 MetadataWildVictoryME=11
 MetadataTrainerVictoryME=12
 MetadataTextSkin=13
 MetadataSurfBGM=14
 MetadataBicycleBGM=15
Then a little below it find this:
Code:
GlobalTypes={
  "Home"=>[1,"uuuu"],
  "PlayerA"=>[2,"essssss",:PBTrainers],
  "PlayerB"=>[3,"essssss",:PBTrainers],
  "PlayerC"=>[4,"essssss",:PBTrainers],
  "PlayerD"=>[5,"essssss",:PBTrainers],
  "StorageCreator"=>[6,"s"],
  "WildBattleBGM"=>[7,"s"],
  "TrainerBattleBGM"=>[8,"s"],
  "WildVictoryME"=>[9,"s"],
  "TrainerVictoryME"=>[10,"s"],
  "TextSkin"=>[11,"s"],
  "SurfBGM"=>[12,"s"],
  "BicycleBGM"=>[13,"s"]
 }
Then, once again, add more entries according the desired number of characters. An example:
Code:
GlobalTypes={
   "Home"=>[1,"uuuu"],
  "PlayerA"=>[2,"essssss",:PBTrainers],
  "PlayerB"=>[3,"essssss",:PBTrainers],
  "PlayerC"=>[4,"essssss",:PBTrainers],
  "PlayerD"=>[5,"essssss",:PBTrainers],
  "PlayerE"=>[6,"essssss",:PBTrainers],
   "PlayerF"=>[7,"essssss",:PBTrainers],
  "StorageCreator"=>[8,"s"],
  "WildBattleBGM"=>[9,"s"],
  "TrainerBattleBGM"=>[10,"s"],
  "WildVictoryME"=>[11,"s"],
  "TrainerVictoryME"=>[12,"s"],
  "TextSkin"=>[13,"s"],
  "SurfBGM"=>[14,"s"],
  "BicycleBGM"=>[15,"s"]
 } 
Make absolutely sure that you renumber the entries when you add in new ones. (i.e. "BicycleBGM" starts at 13, but in the examples ends up at 15)

It is important to note that only the in-game editor will be able to edit the newly added characters (This is where the results of using these steps varies somewhat. Sometimes they show up, other times they don't. Either way, the new entries are still usable). The external editor that it packaged with Essentials will not work for this, as the new entries won't show up and the old ones will appear to be incorrect, since the values will look like they're in the wrong place. This doesn't effect whether or not it actually works. Also, the external editor's other functions should still be perfectly usable. Just don't use it to edit global metadata entries.

It is recommended to create the new characters in the metadata.txt file, in the event that they don't show up in the in-game editor anyways. To do so, simply copy/paste existing entries and change the values. Example:
Copy the entry
PlayerD=PkMnTRAINER_Female,Crystal,onbike,,Crystal,Crystal,Crystal
and add these directly below it in the txt file with necessary modifications:
PlayerE=PkMnTRAINER_Male,Green,onbike,,Green,Green,Green
PlayerF=PkMnTRAINER_Female,Blue,onbike,,Blue,Blue,Blue


To change the player to one of these new characters, do it just the same as usual with the pbChangePlayer(x) command, using numbers the correspond to characters you added (it starts with 0, so take the alphabetical letters corresponding number and subtract 1, so A is 0, M is 12, and Z is 25).

If you have any problems, let me know, unless it's just the entries not showing up in the in-game editor. There nothing I can do about that, except recommend that you retry the steps, but the new characters should work regardless.
__________________
Creator of the Harvest Moon Tool Kit (HMTK).

Anime/Manga fans can find me on MyAnimeList.net, as KitsuneKouta.
Reply With Quote