• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Scottie, Todd, Serena, Kris - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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] Dynamic Map Name

  • 5
    Posts
    14
    Years
    • Seen Dec 6, 2016
    For player's house, everyone knows that "\PN's house" is the solution.

    However, the string is located in another variable, for example v[12], "\V[12]'s house" or "\v[12]'s house" don't work.
    I've already set the variable 12 via pbSet(12,pbEnterNPCName("Rival's name?",1,7,"Blue","trchar004"))

    Because I haven't had 5 posts, I can't post any link. There is no image, but the problems are:
    1. Pokemons are obtained in \V[12]'s house
    2. Saved game says that player is in \V[12]'s house

    I've tried googling this and I've still got no answer.
    Please help me.
     
    Last edited by a moderator:
    For player's house, everyone knows that "\PN's house" is the solution.

    However, the string is located in another variable, for example v[12], "\V[12]'s house" or "\v[12]'s house" don't work.
    I've already set the variable 12 via pbSet(12,pbEnterNPCName("Rival's name?",1,7,"Blue","trchar004"))

    Because I haven't had 5 posts, I can't post any link. There is no image, but the problems are:
    1. Pokemons are obtained in \V[12]'s house
    2. Saved game says that player is in \V[12]'s house

    I've tried googling this and I've still got no answer.
    Please help me.
    If I understand the request properly, you have to go into this script section:
    Code:
    class Game_Map
      def name
        ret=pbGetMessage(MessageTypes::MapNames,self.map_id)
        if $Trainer
          ret.gsub!(/\\PN/,$Trainer.name)
        end
        return ret
      end
    end
    And, before return ret, you have to add this:
    Code:
    if $game_variables
     ret.gsub!(/\\v[12]/,pbGet(12))
    end
     
    Thanks for the reply, Folle64.
    Yeah, you got what I need.

    But, as gsub is a Regex, I modified it into /\\v\[12\]/
     
    Back
    Top