Problems with player input name not showing up (Solved)
Posted: Sat Jan 12, 2013 3:51 am
Ok, my partner and I are kind of total newbies at this, so we're hoping to get some help here. Basically, we want the player to not have a name (just show up as 'Player' in her name box) for a few scenes, then an NPC asks her "what's your name?" and the player is prompted to type in their chosen name. That all worked fine actually, the tutorials online are great! However, we're having a problem getting her name to change from "Player" to the name that the player actually types in. Here is our code so far:
Everything works fine - "n" says the player's chosen name and everything, but the player tag isn't being renamed. Any help will be greatly appreciated - thanks!
Code: Select all
$ a = DynamicCharacter("Player")
define n = Character('Naki', color="#0000FF")
define u = Character('???', color="#000000")
define y = Character('Ayame', color="#FF00FF")
# The game starts here.
label start:
scene bg confront
show Aisha Happy
$ Player="Player"
a "Well, I finally made it...."
((More scenes here))
a "Oh, right! My name is...."
$ player_name = renpy.input("What is your name?")
$ player_name = player_name.strip()
if player_name == "":
$ player_name="Aisha"
$ Player="[player_name]"
a "%(player_name)s. It's nice to meet you."