# Inputting name code?

**URL:** <https://forum.choiceofgames.com/t/inputting-name-code/873>\
**Category:** ChoiceScript Help\
**Created:** [November 11, 2012, 10:17pm UTC](https://forum.choiceofgames.com/t/inputting-name-code/873 "2012-11-11T22:17:21Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![SweetKiss](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/sweetkiss/32/846_2.png) [@SweetKiss](https://forum.choiceofgames.com/u/SweetKiss)\
**Post date:** [November 11, 2012, 10:17pm UTC](https://forum.choiceofgames.com/t/inputting-name-code/873/1 "2012-11-11T22:17:21Z")

</div>

I keep having trouble figuring out how to input a name into the story, I mean I don’t want the reader to be nameless …

So I’ve read that I need to put: \*input\_text name (as a choice)  
And so when I write ${name} in a paragraph, I get an error message saying: “Line 3: Non-existent variable ‘name’.”

Can someone please help? I’m new to this, and have tried looking this up already and find no solutions.

If I make no sense, can someone please tell me the code for naming? Thanks!

---

<div class="post-metadata">

**Author:** ![Headhunter180](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/headhunter180/32/805_2.png) [@Headhunter180](https://forum.choiceofgames.com/u/Headhunter180)\
**Post date:** [November 11, 2012, 10:21pm UTC](https://forum.choiceofgames.com/t/inputting-name-code/873/2 "2012-11-11T22:21:19Z")

</div>

Pretty sure you have to put  
{text\_name} Not {name}  
You want CS to list the name inputed by the player which is the words “text name”  
The text part will always be in something like that bc you want CS to read it as Text not as a variable.

---

<div class="post-metadata">

**Author:** ![irule9344](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/irule9344/32/842_2.png) [@irule9344](https://forum.choiceofgames.com/u/irule9344)\
**Post date:** [November 11, 2012, 10:28pm UTC](https://forum.choiceofgames.com/t/inputting-name-code/873/3 "2012-11-11T22:28:20Z")

</div>

no you have to do ${name} it works perfectly fine for me

---

<div class="post-metadata">

**Author:** ![Headhunter180](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/headhunter180/32/805_2.png) [@Headhunter180](https://forum.choiceofgames.com/u/Headhunter180)\
**Post date:** [November 11, 2012, 10:29pm UTC](https://forum.choiceofgames.com/t/inputting-name-code/873/4 "2012-11-11T22:29:49Z")

</div>

Hmmm, in that case, @SweetKiss did you define it at the beginning? Maybe that’s the problem?

---

<div class="post-metadata">

**Author:** ![irule9344](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/irule9344/32/842_2.png) [@irule9344](https://forum.choiceofgames.com/u/irule9344)\
**Post date:** [November 11, 2012, 10:31pm UTC](https://forum.choiceofgames.com/t/inputting-name-code/873/5 "2012-11-11T22:31:07Z")

</div>

here try is wat i did  
what is your name?  
\*input\_text name.  
hi ${name}.

---

<div class="post-metadata">

**Author:** ![Headhunter180](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/headhunter180/32/805_2.png) [@Headhunter180](https://forum.choiceofgames.com/u/Headhunter180)\
**Post date:** [November 11, 2012, 10:33pm UTC](https://forum.choiceofgames.com/t/inputting-name-code/873/6 "2012-11-11T22:33:43Z")

</div>

Hmmm, now that’s odd, if that’s what @SweetKiss did then it should work, @irule9344 when you defined your variables in the start did you list the name as one?

---

<div class="post-metadata">

**Author:** ![WiReDcHiMpAnZeE](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/wiredchimpanzee/32/6927_2.png) [@WiReDcHiMpAnZeE](https://forum.choiceofgames.com/u/WiReDcHiMpAnZeE)\
**Post date:** [November 11, 2012, 10:37pm UTC](https://forum.choiceofgames.com/t/inputting-name-code/873/7 "2012-11-11T22:37:06Z")

</div>

Did you \*create name and \*set it as players choice?

---

<div class="post-metadata">

**Author:** ![irule9344](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/irule9344/32/842_2.png) [@irule9344](https://forum.choiceofgames.com/u/irule9344)\
**Post date:** [November 11, 2012, 10:58pm UTC](https://forum.choiceofgames.com/t/inputting-name-code/873/8 "2012-11-11T22:58:43Z")

</div>

yeah i did maybe @sweetkiss din’t make a name as stat

---

<div class="post-metadata">

**Author:** ![irule9344](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/irule9344/32/842_2.png) [@irule9344](https://forum.choiceofgames.com/u/irule9344)\
**Post date:** [November 11, 2012, 11:01pm UTC](https://forum.choiceofgames.com/t/inputting-name-code/873/9 "2012-11-11T23:01:29Z")

</div>

@sweetkiss did you put name as a stat and was it in text? if you don’y know what i am saying then you don’t know the scripting lang which means you have to learn that first

---

<div class="post-metadata">

**Author:** ![Headhunter180](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/headhunter180/32/805_2.png) [@Headhunter180](https://forum.choiceofgames.com/u/Headhunter180)\
**Post date:** [November 11, 2012, 11:03pm UTC](https://forum.choiceofgames.com/t/inputting-name-code/873/10 "2012-11-11T23:03:59Z")

</div>

I’m gonna go out on a limb and assume @SweetKiss is either asleep or busy and will get back to us in the morning

---

<div class="post-metadata">

**Author:** ![irule9344](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/irule9344/32/842_2.png) [@irule9344](https://forum.choiceofgames.com/u/irule9344)\
**Post date:** [November 11, 2012, 11:08pm UTC](https://forum.choiceofgames.com/t/inputting-name-code/873/11 "2012-11-11T23:08:46Z")

</div>

anyways headhunter how is your game going rise of a pirate right? i want to play it but can’t find it

---

<div class="post-metadata">

**Author:** ![Headhunter180](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/headhunter180/32/805_2.png) [@Headhunter180](https://forum.choiceofgames.com/u/Headhunter180)\
**Post date:** [November 11, 2012, 11:10pm UTC](https://forum.choiceofgames.com/t/inputting-name-code/873/12 "2012-11-11T23:10:18Z")

</div>

Wait u can’t find it? Hold up one sec.

---

<div class="post-metadata">

**Author:** ![Headhunter180](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/headhunter180/32/805_2.png) [@Headhunter180](https://forum.choiceofgames.com/u/Headhunter180)\
**Post date:** [November 11, 2012, 11:13pm UTC](https://forum.choiceofgames.com/t/inputting-name-code/873/13 "2012-11-11T23:13:16Z")

</div>

@irule9344 I found it it should be on the 3rd page, strange… Anyways it’s going good, a bunch of artwork is being done, i should get the OS for my desktop later this week so we can finally start coding…

---

<div class="post-metadata">

**Author:** ![irule9344](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/irule9344/32/842_2.png) [@irule9344](https://forum.choiceofgames.com/u/irule9344)\
**Post date:** [November 11, 2012, 11:14pm UTC](https://forum.choiceofgames.com/t/inputting-name-code/873/14 "2012-11-11T23:14:28Z")

</div>

thnx i din’t look on the 3rd page was too far lol

---

<div class="post-metadata">

**Author:** ![WiReDcHiMpAnZeE](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/wiredchimpanzee/32/6927_2.png) [@WiReDcHiMpAnZeE](https://forum.choiceofgames.com/u/WiReDcHiMpAnZeE)\
**Post date:** [November 11, 2012, 11:15pm UTC](https://forum.choiceofgames.com/t/inputting-name-code/873/15 "2012-11-11T23:15:04Z")

</div>

Odd im doing rise of the dead… similair names

---

<div class="post-metadata">

**Author:** ![Headhunter180](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/headhunter180/32/805_2.png) [@Headhunter180](https://forum.choiceofgames.com/u/Headhunter180)\
**Post date:** [November 11, 2012, 11:17pm UTC](https://forum.choiceofgames.com/t/inputting-name-code/873/16 "2012-11-11T23:17:51Z")

</div>

Two different genres though, well we might rename it @WiReDcHiMpAnZeE

---

<div class="post-metadata">

**Author:** ![WiReDcHiMpAnZeE](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/wiredchimpanzee/32/6927_2.png) [@WiReDcHiMpAnZeE](https://forum.choiceofgames.com/u/WiReDcHiMpAnZeE)\
**Post date:** [November 11, 2012, 11:32pm UTC](https://forum.choiceofgames.com/t/inputting-name-code/873/17 "2012-11-11T23:32:30Z")

</div>

I was just stating that the names where similair

---

<div class="post-metadata">

**Author:** ![Headhunter180](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/headhunter180/32/805_2.png) [@Headhunter180](https://forum.choiceofgames.com/u/Headhunter180)\
**Post date:** [November 11, 2012, 11:33pm UTC](https://forum.choiceofgames.com/t/inputting-name-code/873/18 "2012-11-11T23:33:34Z")

</div>

I know, you didn’t cause me to want to change it.

---

<div class="post-metadata">

**Author:** ![WiReDcHiMpAnZeE](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/wiredchimpanzee/32/6927_2.png) [@WiReDcHiMpAnZeE](https://forum.choiceofgames.com/u/WiReDcHiMpAnZeE)\
**Post date:** [November 11, 2012, 11:35pm UTC](https://forum.choiceofgames.com/t/inputting-name-code/873/19 "2012-11-11T23:35:26Z")

</div>

Ok

---

<div class="post-metadata">

**Author:** ![AlexCosarca](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/alexcosarca/32/68977_2.png) [@AlexCosarca](https://forum.choiceofgames.com/u/AlexCosarca)\
**Post date:** [November 12, 2012, 8:15am UTC](https://forum.choiceofgames.com/t/inputting-name-code/873/20 "2012-11-12T08:15:19Z")

</div>

@Wiredchimpanzee, you should avoid \*create; try defining variables in mygame.js:

> **[Mygame.js](https://choicescriptdev.fandom.com/wiki/Mygame.js)**
>
> This article is aimed at beginners to ChoiceScript. However, if you have not already done so then the best place to start would be with the very first article in this Introduction To ChoiceScript Game Development series of linked articles: A Basic...

  
Also, @SweetKiss, the reason for that error is you’ve forgotten to actually create the variable named “name” (check the link for Mygame.js to see how it’s done).

[Next page](https://forum.choiceofgames.com/t/inputting-name-code/873.md?page=2)
