Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Pokémon Essentials

Notices
For all updates, view the main page.

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 (05:54 PM).
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    
Old June 21st, 2012 (10:03 PM).
Nickalooose
--------------------
 
Join Date: Mar 2008
Gender: Female
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 (05:30 AM).
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    
Old June 22nd, 2012 (07:09 AM).
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    
Old June 22nd, 2012 (07:22 AM).
Maruno's Avatar
Maruno
Lead Dev of Pokémon Essentials
 
Join Date: Jan 2008
Location: England
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    
Old June 22nd, 2012 (07:48 AM). Edited June 22nd, 2012 by Rayd12smitty.
Rayd12smitty's Avatar
Rayd12smitty
Shadow Maker
 
Join Date: Dec 2011
Gender: Male
Quote originally posted by Maruno:
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 .:
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
Lead Dev of Pokémon Essentials
 
Join Date: Jan 2008
Location: England
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    
Old June 22nd, 2012 (02: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
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 08:02 AM.