# First time coding EVER, need help

**URL:** <https://forum.choiceofgames.com/t/first-time-coding-ever-need-help/333>\
**Category:** ChoiceScript Help\
**Created:** [January 29, 2012, 2:31am UTC](https://forum.choiceofgames.com/t/first-time-coding-ever-need-help/333 "2012-01-29T02:31:44Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![bokbok](https://avatars.discourse-cdn.com/v4/letter/b/90db22/32.png) [@bokbok](https://forum.choiceofgames.com/u/bokbok)\
**Post date:** [January 29, 2012, 2:31am UTC](https://forum.choiceofgames.com/t/first-time-coding-ever-need-help/333/1 "2012-01-29T02:31:44Z")

</div>

well i am very confused with this but i am determined to finish atleast one game.  
things i cant figure out:  
how to add a new scene and where it gets placed  
how to make an option add stats  
how to give a name choice  
how to have different options send to different scenes  
everything else

screenshots would be very helpful

---

<div class="post-metadata">

**Author:** ![ScarletGeisha](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/scarletgeisha/32/444_2.png) [@ScarletGeisha](https://forum.choiceofgames.com/u/ScarletGeisha)\
**Post date:** [January 29, 2012, 3:01am UTC](https://forum.choiceofgames.com/t/first-time-coding-ever-need-help/333/2 "2012-01-29T03:01:31Z")

</div>

Have you looked at the tutorial on the main site yet?

---

<div class="post-metadata">

**Author:** ![bokbok](https://avatars.discourse-cdn.com/v4/letter/b/90db22/32.png) [@bokbok](https://forum.choiceofgames.com/u/bokbok)\
**Post date:** [January 29, 2012, 3:16am UTC](https://forum.choiceofgames.com/t/first-time-coding-ever-need-help/333/3 "2012-01-29T03:16:02Z")

</div>

yes i have but i dont like the examples or the way they explain things. I still cant figure out how to have a different option go to a different chapter

I want each finish to go to a different scene, but i cant figure out how

here is my mygame

nav = new SceneNavigator([  
----“startup”  
----,“militarybrothers”  
----,“militaryfriend”  
----,“militaryrival”  
----,“militaryalone”  
----,“variables”  
----,“gosub”  
----,“ending”  
----,“death”

]);

---

<div class="post-metadata">

**Author:** ![ScarletGeisha](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/scarletgeisha/32/444_2.png) [@ScarletGeisha](https://forum.choiceofgames.com/u/ScarletGeisha)\
**Post date:** [January 29, 2012, 3:32am UTC](https://forum.choiceofgames.com/t/first-time-coding-ever-need-help/333/4 "2012-01-29T03:32:35Z")

</div>

Ah. You’re doing the nav right. But to move between chapters, you should add this command:  
\*finish

If you still have problems with it, or if there are choices leading to different chapters, add this:  
\*goto\_scene

So it would look like this:  
\*finish  
\*goto\_scene militarybrothers

To make an option add to stats, you can use either use the + or equal signs. For example, you have a Fun stat. If you want to set Fun to 3, you can either use the equal:  
\*set fun = 3

Or addition:  
\*set fun +3

To give a name choice, make sure you first have a name stat. Let’s call the stat “name”.  
\*input\_text name

---

<div class="post-metadata">

**Author:** ![bokbok](https://avatars.discourse-cdn.com/v4/letter/b/90db22/32.png) [@bokbok](https://forum.choiceofgames.com/u/bokbok)\
**Post date:** [January 29, 2012, 4:01am UTC](https://forum.choiceofgames.com/t/first-time-coding-ever-need-help/333/5 "2012-01-29T04:01:38Z")

</div>

the \*goto\_scene militaryfriend command did not work

edit: nvm got it to work 🙂

---

<div class="post-metadata">

**Author:** ![bokbok](https://avatars.discourse-cdn.com/v4/letter/b/90db22/32.png) [@bokbok](https://forum.choiceofgames.com/u/bokbok)\
**Post date:** [January 29, 2012, 4:12am UTC](https://forum.choiceofgames.com/t/first-time-coding-ever-need-help/333/6 "2012-01-29T04:12:09Z")

</div>

now how would i get that name to repeat throughout the story

---

<div class="post-metadata">

**Author:** ![ScarletGeisha](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/scarletgeisha/32/444_2.png) [@ScarletGeisha](https://forum.choiceofgames.com/u/ScarletGeisha)\
**Post date:** [January 29, 2012, 4:17am UTC](https://forum.choiceofgames.com/t/first-time-coding-ever-need-help/333/7 "2012-01-29T04:17:53Z")

</div>

Assuming the stat is called “name”, use:  
${name}

---

<div class="post-metadata">

**Author:** ![bokbok](https://avatars.discourse-cdn.com/v4/letter/b/90db22/32.png) [@bokbok](https://forum.choiceofgames.com/u/bokbok)\
**Post date:** [January 29, 2012, 4:30am UTC](https://forum.choiceofgames.com/t/first-time-coding-ever-need-help/333/8 "2012-01-29T04:30:38Z")

</div>

how do i make the stat “name”

---

<div class="post-metadata">

**Author:** ![ScarletGeisha](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/scarletgeisha/32/444_2.png) [@ScarletGeisha](https://forum.choiceofgames.com/u/ScarletGeisha)\
**Post date:** [January 29, 2012, 4:43am UTC](https://forum.choiceofgames.com/t/first-time-coding-ever-need-help/333/9 "2012-01-29T04:43:42Z")

</div>

In your mygame.js file, you will see the lines “stats = {” and “debugStats = {”

Under those two, add “name:” and a default value. If you wish to leave the default value as a blank, you can add this behind: " "

That’s a pair of quotation marks with a space in between. I’m not sure if it has any effect, but make sure the arrangement of the values under stats and debugStats are the same just in case.

---

<div class="post-metadata">

**Author:** ![bokbok](https://avatars.discourse-cdn.com/v4/letter/b/90db22/32.png) [@bokbok](https://forum.choiceofgames.com/u/bokbok)\
**Post date:** [January 29, 2012, 4:51am UTC](https://forum.choiceofgames.com/t/first-time-coding-ever-need-help/333/10 "2012-01-29T04:51:29Z")

</div>

so will it look like this?

“name:” " "

---

<div class="post-metadata">

**Author:** ![bokbok](https://avatars.discourse-cdn.com/v4/letter/b/90db22/32.png) [@bokbok](https://forum.choiceofgames.com/u/bokbok)\
**Post date:** [January 29, 2012, 5:00am UTC](https://forum.choiceofgames.com/t/first-time-coding-ever-need-help/333/11 "2012-01-29T05:00:31Z")

</div>

i have the default name as Egnar and this is what i have

,name: “Egnar”

the ${name} command works fine but if i were to choose to make my own name i get a script error

edit: problem solved through trial and error

---

<div class="post-metadata">

**Author:** ![ScarletGeisha](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/scarletgeisha/32/444_2.png) [@ScarletGeisha](https://forum.choiceofgames.com/u/ScarletGeisha)\
**Post date:** [January 29, 2012, 5:45am UTC](https://forum.choiceofgames.com/t/first-time-coding-ever-need-help/333/12 "2012-01-29T05:45:50Z")

</div>

You should expect to do a lot of trial and error at this stage. I know I did.

---

<div class="post-metadata">

**Author:** ![bokbok](https://avatars.discourse-cdn.com/v4/letter/b/90db22/32.png) [@bokbok](https://forum.choiceofgames.com/u/bokbok)\
**Post date:** [January 29, 2012, 6:18am UTC](https://forum.choiceofgames.com/t/first-time-coding-ever-need-help/333/13 "2012-01-29T06:18:46Z")

</div>

yeah just one thing,

\*finish  
\*goto\_scene militaryfriend

keeps giving me an error, i could go \*goto\_scene only but it wont count as a new chapter

---

<div class="post-metadata">

**Author:** ![ScarletGeisha](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/scarletgeisha/32/444_2.png) [@ScarletGeisha](https://forum.choiceofgames.com/u/ScarletGeisha)\
**Post date:** [January 29, 2012, 6:25am UTC](https://forum.choiceofgames.com/t/first-time-coding-ever-need-help/333/14 "2012-01-29T06:25:33Z")

</div>

Is your txt file name also called “militaryfriend”? Check for spelling errors?

---

<div class="post-metadata">

**Author:** ![bokbok](https://avatars.discourse-cdn.com/v4/letter/b/90db22/32.png) [@bokbok](https://forum.choiceofgames.com/u/bokbok)\
**Post date:** [January 29, 2012, 3:30pm UTC](https://forum.choiceofgames.com/t/first-time-coding-ever-need-help/333/15 "2012-01-29T15:30:41Z")

</div>

its spelled correctly

---

<div class="post-metadata">

**Author:** ![Vendetta](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/vendetta/32/533_2.png) [@Vendetta](https://forum.choiceofgames.com/u/Vendetta)\
**Post date:** [January 31, 2012, 7:33am UTC](https://forum.choiceofgames.com/t/first-time-coding-ever-need-help/333/16 "2012-01-31T07:33:57Z")

</div>

Try removing the \*finish command. That is telling it “this is the end of this scene, move on to the next one in the list” (militaryrival, by the looks?) so your \*goto\_scene line would not even be reached.
