• 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] Dynamic Map Name

5
Posts
13
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:
    296
    Posts
    9
    Years
  • 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
     
    5
    Posts
    13
    Years
    • Seen Dec 6, 2016
    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