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

[Scripting Question] How to edit custom metadata type from debug's metadata editor?

  • 15
    Posts
    6
    Years
    • Seen Aug 22, 2021
    I want to be able to set/change map specific data so I added a custom Metadata type.
    Changes made to the script Misc_Data
    Code:
    #===============================================================================
    # Global and map metadata
    #===============================================================================
    MetadataHome             = 1
    ...
    MetadataMapSize             = 19
    MetadataEnvironment         = 20
    MetadataDefaultTerrain      = 21 #My Change
    
    module PokemonMetadata
      GlobalTypes = {
    ...
      }
      NonGlobalTypes = {
    ...
         "MapSize"          => [MetadataMapSize,             "us"],
         "Environment"      => [MetadataEnvironment,         "e", :PBEnvironment],
         "DefaultTerrain"   => [MetadataDefaultTerrain,      "e", :PBDefaultTerrain] #My Change
      }
    end

    I added a custom script PBDefaultTerrain which has the same format as PBEnvironment
    Code:
    begin
      module PBDefaultTerrain
        None        = 0
        ElectricT   = 1
        GrassyT     = 2
        MistyT      = 3
        PsychicT    = 4
    
        def self.maxValue; return 4; end
      end
    
    rescue Exception
      if $!.is_a?(SystemExit) || "#{$!.class}"=="Reset"
        raise $!
      end
    end

    Calling the method pbGetMetadata($game_map.map_id,MetadataDefaultTerrain) returns an integer and I've testing that everything works as intended.

    My question is what other script changes do I need to make to be able to edit my added metadata type using debug inside the information editor. The list of metadata that you can edit ends with Environment and follows the order of defined metadata. The only way I can define "DefaultTerrain" is manually typing it out in the metadata PBS which while doable, is very prone to misspelling and overall slower. (DefaultTerrain = ElectricT) I tried looking through the editor scripts but didn't find a clear solution. Maybe it has something to do with how I defined the metadata because there are strings that have an unclear purpose [MetadataMapSize, "us"] <- "us" in this example. I used "e" hoping to be able to edit in the same manner as PBEnvironment.

    It's fine if this doesn't get resolved but it would be helpful for quality of life purposes.

    If anyone's curious why I added a new metadata type called default terrain
    Spoiler:
     
    Back
    Top