Pokémon Essentials All questions and discussion about Pokémon Essentials, the Pokémon game kit for RPG Maker XP, go in here. Also contains links to the latest downloads and the Essentials Wiki.

Reply
 
Thread Tools
  #1    
Old June 21st, 2012 (5:54 PM).
Rayd12smitty's Avatar
Rayd12smitty Rayd12smitty is offline
Shadow Maker
     
    Join Date: Dec 2011
    Gender: Male
    Posts: 647
    Sorry guys. i know this is like the fourth question I've posted this week. How do you make a default name for the player. So when you don't enter anything, it will set your name to something specific, in my case Ray for the male, and Kelsey for female.
    __________________
    Reply With Quote

    Relevant Advertising!

      #2    
    Old June 21st, 2012 (10:03 PM).
    Nickalooose Nickalooose is offline
    --------------------
       
      Join Date: Mar 2008
      Gender: Female
      Posts: 1,309
      http://pokemonessentials.wikia.com/wiki/Player#Naming_the_player

      Use a conditional branch to seek wether you are boy or a girl, I should imagine the switch should suffice... Bookmark this Wiki.
      Reply With Quote
        #3    
      Old June 22nd, 2012 (5:30 AM).
      FL's Avatar
      FL FL is offline
      Pokémon Island Creator
         
        Join Date: Sep 2010
        Gender: Male
        Posts: 1,695
        The wikia haven't the answer. In current system you can only put a default random name OR put a default name without option to change it. Untested solution: In PokemonUtilities change
        Code:
        def pbTrainerName(name=nil)
         if $PokemonGlobal.playerID<0
          pbChangePlayer(0)
         end
         trainertype=pbGetPlayerTrainerType
         trname=name
         if trname==nil
          trname=pbEnterText("Your name?",0,7)
          gender=pbGetTrainerTypeGender(trainertype) 
          if trname==""
           trname=getRandomNameEx(gender,nil,1,7)
          end
         end
         $Trainer=PokeBattle_Trainer.new(trname,trainertype)
         $PokemonBag=PokemonBag.new
         $PokemonTemp.begunNewGame=true
        end
        to
        Code:
        def pbTrainerName(name=nil, force=true)
         if $PokemonGlobal.playerID<0
          pbChangePlayer(0)
         end
         trainertype=pbGetPlayerTrainerType
         trname=name
         if trname==nil || !force
          minlength=(force) ? 1 : 0
          trname=pbEnterText("Your name?",minlength,7)
          gender=pbGetTrainerTypeGender(trainertype) 
          if trname==""
           trname= (trname!=nil && !force) ? name : getRandomNameEx(gender,nil,1,7) 
          end
         end
         $Trainer=PokeBattle_Trainer.new(trname,trainertype)
         $PokemonBag=PokemonBag.new
         $PokemonTemp.begunNewGame=true
        end
        Call pbTrainerName("Ray",false) or pbTrainerName("Kelsey",false) based on player gender.
        With this change, if you just call 'pbTrainerName' it can't be cancelled and gives you a random name. If you wish the old pbTrainerName call, just use 'pbTrainerName(nil,false)'.
        I sugest Maruno to put this on next release.
        __________________
        Reply With Quote
          #4    
        Old June 22nd, 2012 (7:09 AM).
        Rayd12smitty's Avatar
        Rayd12smitty Rayd12smitty is offline
        Shadow Maker
           
          Join Date: Dec 2011
          Gender: Male
          Posts: 647
          Thanks so much. I looked for over an hour on the wiki and couldn't find it
          __________________
          Reply With Quote
            #5    
          Old June 22nd, 2012 (7:22 AM).
          Maruno's Avatar
          Maruno Maruno is offline
          Lead Dev of Pokémon Essentials
             
            Join Date: Jan 2008
            Location: England
            Posts: 5,171
            I think the question is better interpreted as: "How does one change what the default names are for the player?" - that is, how can you set the name to something in particular rather than have it use the player's username on their computer (or a random jumble of letters)? It's a slight but important difference.

            The answer is to use the following script lines in the Intro event:

            Code:
            pbTrainerName(_I("Ray"))
            Code:
            newname=pbEnterText(_I("Your name?"),0,7,$Trainer.name)
            $Trainer.name=newname if newname && newname!=""
            This sets the default name, and then lets the player edit it (the default name is shown to start with - to show blankness to start with, delete the red part). If they input a blank name, it remains as the default name.

            If you keep the red part of the code, this is pretty much exactly what FL's answer does, but without needing any script changes.
            __________________
            Go to the Pokémon Essentials Wiki

            | Downloads | Tutorials | Fangames |
            | All Animations Project |

            Follow me on Twitter: @maruno42


            Reply With Quote
              #6    
            Old June 22nd, 2012 (7:48 AM). Edited June 22nd, 2012 by Rayd12smitty.
            Rayd12smitty's Avatar
            Rayd12smitty Rayd12smitty is offline
            Shadow Maker
               
              Join Date: Dec 2011
              Gender: Male
              Posts: 647
              Quote:
              Originally Posted by Maruno View Post
              I think the question is better interpreted as: "How does one change what the default names are for the player?" - that is, how can you set the name to something in particular rather than have it use the player's username on their computer (or a random jumble of letters)? It's a slight but important difference.

              The answer is to use the following script lines in the Intro event:

              Code:
              pbTrainerName(_I("Ray"))
              Code:
              newname=pbEnterText(_I("Your name?"),0,7,$Trainer.name)
              $Trainer.name=newname if newname && newname!=""
              This sets the default name, and then lets the player edit it (the default name is shown to start with - to show blankness to start with, delete the red part). If they input a blank name, it remains as the default name.

              If you keep the red part of the code, this is pretty much exactly what FL's answer does, but without needing any script changes.
              Ok, thank you. This does seem easier. I haven't had time to try either way yet, but if it is coming from you I'm sure it will work. Thanks

              Quote:
              Originally Posted by FL . View Post
              The wikia haven't the answer. In current system you can only put a default random name OR put a default name without option to change it. Untested solution: In PokemonUtilities change
              Code:
              def pbTrainerName(name=nil)
               if $PokemonGlobal.playerID<0
                pbChangePlayer(0)
               end
               trainertype=pbGetPlayerTrainerType
               trname=name
               if trname==nil
                trname=pbEnterText("Your name?",0,7)
                gender=pbGetTrainerTypeGender(trainertype) 
                if trname==""
                 trname=getRandomNameEx(gender,nil,1,7)
                end
               end
               $Trainer=PokeBattle_Trainer.new(trname,trainertype)
               $PokemonBag=PokemonBag.new
               $PokemonTemp.begunNewGame=true
              end
              to
              Code:
              def pbTrainerName(name=nil, force=true)
               if $PokemonGlobal.playerID<0
                pbChangePlayer(0)
               end
               trainertype=pbGetPlayerTrainerType
               trname=name
               if trname==nil || !force
                minlength=(force) ? 1 : 0
                trname=pbEnterText("Your name?",minlength,7)
                gender=pbGetTrainerTypeGender(trainertype) 
                if trname==""
                 trname= (trname!=nil && !force) ? name : getRandomNameEx(gender,nil,1,7) 
                end
               end
               $Trainer=PokeBattle_Trainer.new(trname,trainertype)
               $PokemonBag=PokemonBag.new
               $PokemonTemp.begunNewGame=true
              end
              Call pbTrainerName("Ray",false) or pbTrainerName("Kelsey",false) based on player gender.
              With this change, if you just call 'pbTrainerName' it can't be cancelled and gives you a random name. If you wish the old pbTrainerName call, just use 'pbTrainerName(nil,false)'.
              I sugest Maruno to put this on next release.
              Thank you. I just tried this method first and it worked great. I'm sorry for being so unknowing but how do I make a conditional branch based on your characters gender. I know this was probably stupid but i tried a conditional branch based on $Trainer.gender=0 and it just got an error. Sorry and thanks a head of time
              __________________
              Reply With Quote
                #7    
              Old June 22nd, 2012 (12:39 PM).
              Maruno's Avatar
              Maruno Maruno is offline
              Lead Dev of Pokémon Essentials
                 
                Join Date: Jan 2008
                Location: England
                Posts: 5,171
                A single equals sign makes the first thing have the value of the second thing. Double equals signs checks whether the first thing is the same as the second thing.

                Use $Trainer.gender==0 as the argument of your Conditional Branch.
                __________________
                Go to the Pokémon Essentials Wiki

                | Downloads | Tutorials | Fangames |
                | All Animations Project |

                Follow me on Twitter: @maruno42


                Reply With Quote
                  #8    
                Old June 22nd, 2012 (2:12 PM).
                Rayd12smitty's Avatar
                Rayd12smitty Rayd12smitty is offline
                Shadow Maker
                   
                  Join Date: Dec 2011
                  Gender: Male
                  Posts: 647
                  Thank you that worked great
                  __________________
                  Reply With Quote
                  Reply
                  Quick Reply

                  Sponsored Links
                  Thread Tools

                  Posting Rules
                  You may not post new threads
                  You may not post replies
                  You may not post attachments
                  You may not edit your posts

                  BB code is On
                  Smilies are On
                  [IMG] code is On
                  HTML code is Off

                  Forum Jump


                  All times are GMT -8. The time now is 6:11 AM.