# Displaying the full name in the stat screen after seperately choosing given name and last name

**URL:** <https://forum.choiceofgames.com/t/displaying-the-full-name-in-the-stat-screen-after-seperately-choosing-given-name-and-last-name/35042>\
**Category:** ChoiceScript Help\
**Created:** [February 5, 2018, 2:02pm UTC](https://forum.choiceofgames.com/t/displaying-the-full-name-in-the-stat-screen-after-seperately-choosing-given-name-and-last-name/35042 "2018-02-05T14:02:40Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![needs-to-be-loved](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/needs-to-be-loved/32/47215_2.png) [@needs-to-be-loved](https://forum.choiceofgames.com/u/needs-to-be-loved)\
**Post date:** [February 5, 2018, 2:02pm UTC](https://forum.choiceofgames.com/t/displaying-the-full-name-in-the-stat-screen-after-seperately-choosing-given-name-and-last-name/35042/1 "2018-02-05T14:02:41Z")

</div>

So i was having trouble with displaying the full name in stats section so i came up with a simple code and a simple tutorial on it. I checked the related topics and saw it is explained there but there are not a pre-written code that one can copy past and edit as they will so im posting it here just to give them something to work on and a little understanding on variables.

As choicescript wont recognize two variables in one string, you just need to turn those variables into one variable. All explained below.

P.S: If you find this topic unnecessary, it can be deleted.

```
*comment =========================================================================================================================================
*comment This code will let you give a choice to the reader to choose their given name and last name seperately and then turn it into one variable so you can display the full name in stats section.
*comment =========================================================================================================================================

*comment The part below will go to the top of the startup file.
*comment ------------------------------------------------------------

*create givenname "unknown"
*create lastname "unknown"
*create Name "unknown"

*comment -------------------------------------------------------------

*comment After creating the three variables above, you will need to go to choicescript_stats file and type this simple code below *stat_chart .

*stat_chart
    text Name
    
*comment You won't repeat *stat_chart command. You will probably have that section there. Just type --> text Name below that section. Mind indentation!

*comment Now the code below will set up your name choice so just change the first three options with whatever you want and copy past it.

*comment A little note on this. You can't display the full name by typing --> text ${givenname} ${lastname} in the stats as choicescript won't recognize such comand.
*comment So you're just basically creating a seperate variable "Name" to be able to display characters full name in stats screen.

*comment This should do the trick.

*label input_givenname
*choice
    #Pre-given
        *set givenname "Pre-given"
        *goto givenname_check
    #given_names
        *set givenname "given_names"
        *goto givenname_check
    #Here
        *set givenname "Here"
        *goto givenname_check
    #None of these, let me choose my own given name.
        What's your given name then?
        *input_text givenname
        *set givenname "${givenname}"
        *goto givenname_check
    
*label givenname_check
Your given name is ${givenname} , did i get it correct?
*choice
    #Yes, indeed.
        *goto input_lastname
    #No, how hard it could be to get my name correctly!
        You're right. Im sorry…
        *goto input_givenname
    
*label input_lastname
*choice
    #Pre-given
        *set lastname "Pre-given"
        *goto lastname_check
    #given_lastnames
        *set lastname "given_lastnames"
        *goto lastname_check
    #Here
        *set lastname "Here"
        *goto lastname_check
    #None of these, let me chose my own last name.
        What's your last name then?
        *input_text lastname
        *set lastname "${lastname}"
        *goto lastname_check
    
*label lastname_check
Your last name is ${lastname} , did i get it correct?
*choice
    #Yes, indeed.
        *goto Name_check
    #No, how hard it could be to get my last name correctly!
        You're right. Im sorry…
        *goto input_lastname
    
*label Name_check
Your name is ${givenname} ${lastname} , did i get it correct?
*choice
    #Yes, indeed.
        *set Name "${givenname} ${lastname}"
        *finish
    #No, how hard it could be to get my name correctly!
        You're right. Im sorry…
        *goto input_givenname
        
        
        
*comment You can delete the check sections but you will need to change "goto" commands due to your labels. 
*comment I think it wont be of any harm to double check the choices :) 

```

---

<div class="post-metadata">

**Author:** ![MeltingPenguins](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/meltingpenguins/32/255855_2.png) [@MeltingPenguins](https://forum.choiceofgames.com/u/MeltingPenguins)\
**Post date:** [February 5, 2018, 2:22pm UTC](https://forum.choiceofgames.com/t/displaying-the-full-name-in-the-stat-screen-after-seperately-choosing-given-name-and-last-name/35042/2 "2018-02-05T14:22:19Z")

</div>

Hmmm…  
what exactly was the problem you encountered?  
cause usually

```
$!{first_name} $!{lastname}

```

should work just fine. (whether or not you have a ! after the $ or not)

---

<div class="post-metadata">

**Author:** ![needs-to-be-loved](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/needs-to-be-loved/32/47215_2.png) [@needs-to-be-loved](https://forum.choiceofgames.com/u/needs-to-be-loved)\
**Post date:** [February 5, 2018, 2:26pm UTC](https://forum.choiceofgames.com/t/displaying-the-full-name-in-the-stat-screen-after-seperately-choosing-given-name-and-last-name/35042/3 "2018-02-05T14:26:40Z")

</div>

The problem was to display full name in the stats screen but you cant code it there with ${} or @{} this since choicescript wont recognize it. So instead i turned two variables into one as obviously most people do. I just wanted to post the structure of the code so people can copy past and play around it 🙂

---

<div class="post-metadata">

**Author:** ![MeltingPenguins](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/meltingpenguins/32/255855_2.png) [@MeltingPenguins](https://forum.choiceofgames.com/u/MeltingPenguins)\
**Post date:** [February 5, 2018, 2:37pm UTC](https://forum.choiceofgames.com/t/displaying-the-full-name-in-the-stat-screen-after-seperately-choosing-given-name-and-last-name/35042/4 "2018-02-05T14:37:59Z")

</div>

I think most people do use two variables for the mc’s name…

---

<div class="post-metadata">

**Author:** ![andymwhy](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/andymwhy/32/34396_2.png) [@andymwhy](https://forum.choiceofgames.com/u/andymwhy)\
**Post date:** [February 5, 2018, 2:51pm UTC](https://forum.choiceofgames.com/t/displaying-the-full-name-in-the-stat-screen-after-seperately-choosing-given-name-and-last-name/35042/5 "2018-02-05T14:51:16Z")

</div>

On the stats page, you don’t need to use a stat\_chart to display the text.

Try this:

```
${givenname} ${lastname}

*stat_chart
  percent strength
  number height

```

etc.

It works fine and there is no need to set more variables.

---

<div class="post-metadata">

**Author:** ![Szaal](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/szaal/32/112202_2.png) [@Szaal](https://forum.choiceofgames.com/u/Szaal)\
**Post date:** [February 5, 2018, 3:19pm UTC](https://forum.choiceofgames.com/t/displaying-the-full-name-in-the-stat-screen-after-seperately-choosing-given-name-and-last-name/35042/6 "2018-02-05T15:19:06Z")

</div>

Thanks for the code, @needs-to-be-loved, but as others mentioned, there’s no need to do this.

Yes, you can’t

```
*stat_chart
   text ${givenname} ${lastname}

```

but you can

```
Name : ${givenname} ${lastname}

```

* * *

No offense, but I’m afraid that your code may complicate things that shouldn’t be that complicated.

It’s about creativity, afterall. Sometimes, you don’t even need the `*stat_chart` command in your stats screen.

---

<div class="post-metadata">

**Author:** ![needs-to-be-loved](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/needs-to-be-loved/32/47215_2.png) [@needs-to-be-loved](https://forum.choiceofgames.com/u/needs-to-be-loved)\
**Post date:** [February 5, 2018, 5:33pm UTC](https://forum.choiceofgames.com/t/displaying-the-full-name-in-the-stat-screen-after-seperately-choosing-given-name-and-last-name/35042/7 "2018-02-05T17:33:30Z")

</div>

@MeltingPenguins @andymwhy @Szaal

I didn’t know it and this was the way i could think of. So as there is an easier way, no need to complicate things as you said. I would withdraw the topic but i think i dont have permission to do that. So someone who is able to do that can withdraw it now, there is no need for confusions. And if i can delete it please show how to.

Thanks for all the attention 🙂

---

<div class="post-metadata">

**Author:** ![MeltingPenguins](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/meltingpenguins/32/255855_2.png) [@MeltingPenguins](https://forum.choiceofgames.com/u/MeltingPenguins)\
**Post date:** [February 5, 2018, 5:38pm UTC](https://forum.choiceofgames.com/t/displaying-the-full-name-in-the-stat-screen-after-seperately-choosing-given-name-and-last-name/35042/8 "2018-02-05T17:38:11Z")

</div>

Oh I’d say leave the topic open.  
Other people might have a similar problem in the future, who knows.

---

<div class="post-metadata">

**Author:** ![needs-to-be-loved](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/needs-to-be-loved/32/47215_2.png) [@needs-to-be-loved](https://forum.choiceofgames.com/u/needs-to-be-loved)\
**Post date:** [February 5, 2018, 5:39pm UTC](https://forum.choiceofgames.com/t/displaying-the-full-name-in-the-stat-screen-after-seperately-choosing-given-name-and-last-name/35042/9 "2018-02-05T17:39:09Z")

</div>

Ok then, just leave it like this.
