• 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.

Adding more Metadata?

BadSamaritan

Gone Fishin'
148
Posts
14
Years
  • Seen Jun 8, 2023
------------------------------------------------------
 
Last edited:

Nickalooose

--------------------
1,309
Posts
16
Years
  • Seen Dec 28, 2023
Code:
def Kernel.pbUpdateVehicle
  meta=pbGetMetadata(0,MetadataPlayerA+$PokemonGlobal.playerID)
  if meta
    if $PokemonGlobal.diving
      $game_player.character_name=meta[5] && meta[5]!="" ? meta[5] : meta[1] # Diving graphic
    elsif $PokemonGlobal.surfing
      $game_player.character_name=meta[3] && meta[3]!="" ? meta[3] : meta[1] # Surfing graphic
    elsif $PokemonGlobal.bicycle
      $game_player.character_name=meta[2] && meta[2]!="" ? meta[2] : meta[1] # Bicycle graphic
    else
      $game_player.character_name=meta[1] # Regular graphic
    end
  end
end
This is where your new code will go... Copy this and change to accommodate.
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
This kind of information isn't written down anywhere because (practically) no one will ever need to know how to do what you're asking, so it's pointless writing it down formally. And what you're asking is very much a multi-faceted beast, of which Nickalooose's response is just one small part.

You want to clone the Dive feature. This involves three main aspects:
  • Transfer between the ground map and the corresponding sky map when using a field move.
  • Change the player's graphic whilst flying.
  • Make "the player is flying" an actual state the player can be in (like "the player is surfing" already is).
Now, the first two points would ideally require metadata, namely a new map-specific metadata FlyMap (the analogue of DiveMap), and a tweak to the global metadata PlayerA to include an extra player charset which depicts them flying.

This sounds complicated. Well, it should - you're wanting to change some of the data structure. Fortunately, thanks to some of my more recent work on Essentials, it may well not be as complex nor time-consuming as it could be.

Hop into the script section PokemonMap and look around line 275 and the next 75 lines after it. It'll look like what's below, once you've added in the red parts:
Code:
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

MetadataOutdoor             = 1
MetadataShowArea            = 2
MetadataBicycle             = 3
MetadataBicycleAlways       = 4
MetadataHealingSpot         = 5
MetadataWeather             = 6
MetadataMapPosition         = 7
MetadataDiveMap             = 8
MetadataDarkMap             = 9
MetadataSafariMap           = 10
MetadataSnapEdges           = 11
MetadataDungeon             = 12
MetadataBattleBack          = 13
MetadataMapWildBattleBGM    = 14
MetadataMapTrainerBattleBGM = 15
MetadataMapWildVictoryME    = 16
MetadataMapTrainerVictoryME = 17
MetadataMapSize             = 18
[COLOR=Red]MetadataFlightMap           = 19[/COLOR]



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[COLOR=Red]s[/COLOR]",:PBTrainers],
     "PlayerB"=>[MetadataPlayerB,"esssssss[COLOR=Red]s[/COLOR]",:PBTrainers],
     "PlayerC"=>[MetadataPlayerC,"esssssss[COLOR=Red]s[/COLOR]",:PBTrainers],
     "PlayerD"=>[MetadataPlayerD,"esssssss[COLOR=Red]s[/COLOR]",:PBTrainers],
     "PlayerE"=>[MetadataPlayerE,"esssssss[COLOR=Red]s[/COLOR]",:PBTrainers],
     "PlayerF"=>[MetadataPlayerF,"esssssss[COLOR=Red]s[/COLOR]",:PBTrainers],
     "PlayerG"=>[MetadataPlayerG,"esssssss[COLOR=Red]s[/COLOR]",:PBTrainers],
     "PlayerH"=>[MetadataPlayerH,"esssssss[COLOR=Red]s[/COLOR]",:PBTrainers]
  }
  NonGlobalTypes={
     "Outdoor"=>[MetadataOutdoor,"b"],
     "ShowArea"=>[MetadataShowArea,"b"],
     "Bicycle"=>[MetadataBicycle,"b"],
     "BicycleAlways"=>[MetadataBicycleAlways,"b"],
     "HealingSpot"=>[MetadataHealingSpot,"uuu"],
     "Weather"=>[MetadataWeather,"eu",["","Rain","Storm","Snow","Sandstorm","Sunny"]],
     "MapPosition"=>[MetadataMapPosition,"uuu"],
     "DiveMap"=>[MetadataDiveMap,"u"],
     "DarkMap"=>[MetadataDarkMap,"b"],
     "SafariMap"=>[MetadataSafariMap,"b"],
     "SnapEdges"=>[MetadataSnapEdges,"b"],
     "Dungeon"=>[MetadataDungeon,"b"],
     "BattleBack"=>[MetadataBattleBack,"s"],
     "WildBattleBGM"=>[MetadataMapWildBattleBGM,"s"],
     "TrainerBattleBGM"=>[MetadataMapTrainerBattleBGM,"s"],
     "WildVictoryME"=>[MetadataMapWildVictoryME,"s"],
     "TrainerVictoryME"=>[MetadataMapTrainerVictoryME,"s"],
     "MapSize"=>[MetadataMapSize,"us"],
     [COLOR=Red]"FlightMap"=>[MetadataFlightMap,"u"],[/COLOR]
  }
end
Convenient, right? So long as you never edit the metadata via the in-game editor again, I think that's all you need to do for this part. If you do want to use the editor, you'll have to add some options to the PokemonEditor script section - search for "DiveMap" and Surf-Fishing for the two areas you'll need to add stuff to (copy the DiveMap entry and Diving entry respectively, putting them both at the end of their arrays).



Now, the third part: cloning the diving functionality. You'll need to make a new boolean in $PokemonGlobal which indicates that the player is in flight, so search for attr_accessor :diving and stick in an attr_accessor :flight next to it. Scroll down to the def initialize and add @flight=false.

Now you want to find (pretty much) every reference to $PokemonGlobal.diving and add in $PokemonGlobal.flight next to it in one way or another as a clone of whatever diving is doing there. Things to pay attention to are:
  • In pbGetEnvironment, you'll probably want to make flight cause the battle environment to be a new environment rather than underwater. If it was cosmetic there wouldn't actually be a problem making it underwater, but the effects of Dive Ball and a couple of move effects depend on the environment. Making a new battle environment is beyond the scope of this question; if you don't want the hassle (or you won't have any battles in the air), you can just ignore the diving reference in this def.
  • In Kernel.pbUpdateVehicle (the method Nickalooose mentioned), you'll want flight to change the player's character_name to meta[8].
  • All the usage-of-diving code is in the script section PokemonHiddenMoves, and it's up to you to copy-paste it and adapt whichever parts are relevant (the move required for flight, the messages, the required badges if any, etc.).

Usage:

The PlayerA= lines in metadata.txt section 0 now have an extra "comma filename" on the end, which is the filename of the player's flight charset. Each ground-based map can now also have a FlightMap=42 line in its metadata section, where the number is the sky map associated with that ground map (as with dive maps, you don't need/shouldn't have this line for sky maps).

The phrase is "intents and purposes", not "intensive purposes", by the way.
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
Well, the instructions are there now, if anyone wants to find them in the future.

I have a side question though, one that could prevent all this massive amount of work...

If I were to add strictly the part Nickalooose mentioned(along with the new $PokemonGlobal.flying parts), BUT instead of a new picture, use the same diving picture, and use the "open" 8 directions to the right of it.......essentially if I could just tell it that when the player's vehicle is "flying" to have the x values of the image+64 or whatever.

Does this sound plausible?
In theory you could do that, but then you'd have to edit the way the auto-animation (the "bobbing") works to make sure it uses the correct frames, which I think is more effort than what I've described.

You can always hardcode the flight charset filenames, though - replace meta[8] with "boyflying", for example. You'd need to make sure you use the appropriate filename for the player's trainer type (i.e. gender).

You can also hardcode the relationships between ground-based maps and sky maps. Doing both these hardcode things means you wouldn't need to muck around with metadata, although it's a bit less user-friendly to work with afterwards. I described how to modify the metadata because, actually, it's not a huge task once you have instructions, and you can more directly copy the Dive code for it.
 
94
Posts
11
Years
  • Seen May 4, 2018
Ohhh, I wanted to do the same, but I had no idea how, so I gave up on it. Thanks so much for this! =D
 
Back
Top