• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • 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.

[Question] (Scripting) How to add a new metadata property to maps

  • 1
    Posts
    2
    Years
    • Seen May 22, 2022
    Hello! I have been trying for a while to add a new metadata property to my maps to determine if the character can sleep or not there (I created an item called sleeping bag).
    The main problem is that even if the property appears, its value is not working, it always seems to be nil.
    If I edit it with the editor, it changhes to nil after saving data. If I edit the PBS file, it is still nil in-game, and the line disapears after using the editor.

    These are the changes I have already done:
    1. Editing MapMetadata Script
    2. Update Compiler_CompilePBS to add the new property to the Hash
    3. Update EditorScreens script

    In case it is necessary, here are the updated parts of the code:

    MapMetadata
    Spoiler:

    Compiler:
    Spoiler:

    EditorScreens:
    Spoiler:

    To be honest, I do not quite remember if I edited something else and forgot to write it here. I have been trying a lot of things to solve this, but I couldn't and I had to register here to look for some help. Please, let me know if you have any idea about something I may have missed.

    PD: I am using essentials v19.1
     
    Okay, from what I'm seeing, you defined sleeping bag metadata but I don't see how it actually uses the sleeping bag item.
     
    def pbSleepingBagCheck
    if !map_metadata || !map_metadata.can_sleep
    pbMessage(_INTL("Can't use that here."))
    return false
    end
    return true
    end

    add this in Item_utilities
     
    Back
    Top