The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Pokémon Essentials
Register New Account FAQ/Rules Chat Blogs Mark Forums Read

Notices

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  
Unread June 22nd, 2012, 01:54 AM
Rayd12smitty's Avatar
Rayd12smitty
Shadow Maker
 
Join Date: Dec 2011
Gender: Male
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
  #2  
Unread June 22nd, 2012, 06:03 AM
Nickalooose
--------------------
 
Join Date: Mar 2008
Gender: Female
http://pokemonessentials.wikia.com/w...ing_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  
Unread June 22nd, 2012, 01:30 PM
FL .'s Avatar
FL .
Pokémon Island Creator
 
Join Date: Sep 2010
Gender: Male
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  
Unread June 22nd, 2012, 03:09 PM
Rayd12smitty's Avatar
Rayd12smitty
Shadow Maker
 
Join Date: Dec 2011
Gender: Male
Thanks so much. I looked for over an hour on the wiki and couldn't find it
__________________

Reply With Quote
  #5  
Unread June 22nd, 2012, 03:22 PM
Maruno's Avatar
Maruno
Lead Dev of Pokémon Essentials
 
Join Date: Jan 2008
Location: England
Gender: Male
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.
__________________
Reply With Quote
  #6  
Unread June 22nd, 2012, 03:48 PM
Rayd12smitty's Avatar
Rayd12smitty
Shadow Maker
 
Join Date: Dec 2011
Gender: Male
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
__________________


Last edited by Rayd12smitty; June 22nd, 2012 at 06:27 PM. Reason: Your double post has been automatically merged.
Reply With Quote
  #7  
Unread June 22nd, 2012, 08:39 PM
Maruno's Avatar
Maruno
Lead Dev of Pokémon Essentials
 
Join Date: Jan 2008
Location: England
Gender: Male
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.
__________________
Reply With Quote
  #8  
Unread June 22nd, 2012, 10:12 PM
Rayd12smitty's Avatar
Rayd12smitty
Shadow Maker
 
Join Date: Dec 2011
Gender: Male
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 UTC. The time now is 01:54 AM.


Style by Perdition Haze, artwork by Sa-Dui.
Like our Facebook Page Follow us on TwitterMessage Board Statistics | © 2002 - 2013 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to Pokémon USA, Inc. and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company, Pokémon USA, Inc., The Pokémon Company International, or Wizards of the Coast. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2013 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User posts belong to the user.