Given name and surname display in stat screen

A little conundrum I’m not figuring out. I’ve got a game where the player will have a first and last name they will choose. I want this displayed on one line in the stats screen (like Name). Now, I can easily do this as two variables, and have them listed in the stat screen as First Last (and I know how to do it in the actual game text, so no need there).

How to do it in the stat screen? And how to set the variables properly in the mygame.js file? Checked through the files here and no one seems to have asked that as I can see…unless someone can point me towards it? Help!

http://choicescriptdev.wikia.com/wiki/Concatenation any help?

Hey Stan, your choicescript_stats file doesn’t have to start with *stat_chart - it can start with (for example) ${firstname} ${lastname}.

And to set the vars in mygame, you could have
firstname: “Starting”
,lastname: “Statistics”

which means “Starting Statistics” would show at the top of the stats screen until your reader has the chance to choose a name. :slight_smile:

^ Havenstone (probably) has the best answer for you, and to elaborate, you might do something like this:


Your name is $!{firstname} $!{surname}. 
((^ The $! insures capitalization - very important when it comes to names.))
*stat_chart
  (Yay! Stats!)
  (More Stats!)


But make sure you set {firstname} and {surname} as something (such as ???) at the very beginning of your game, otherwise you will encounter an error if you try to access the stat screen at the very beginning.

You can also initially set the variables for the first name and surname to “” (an empty string) so that before the player picks a name, no name displays on the stat screen at all. IMO that looks a little better than having “Unknown Unknown” or some other placeholder, but it’s a matter of taste. :slight_smile:

Another flavor to taste might be using a generic anonymous starting name pairing like…

John (or Jane) Doe
John/Jane Smith
or
The Stranger

@Caddmuss “J.” “Doe” is an effective gender neutral option when going that route. It’s arguably not as clean looking, but it gets the job done on that front.

Folks, as always, thank you! I’ll fix that today as I’ve finished my first two chapters and on to the third. This one was driving me crazy!