# I need help in coding

**URL:** <https://forum.choiceofgames.com/t/i-need-help-in-coding/17972>\
**Category:** ChoiceScript Help\
**Created:** [June 3, 2016, 1:23pm UTC](https://forum.choiceofgames.com/t/i-need-help-in-coding/17972 "2016-06-03T13:23:10Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Grim\_Nightcore](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/grim_nightcore/32/13745_2.png) [@Grim\_Nightcore](https://forum.choiceofgames.com/u/Grim_Nightcore)\
**Post date:** [June 4, 2016, 5:40am UTC](https://forum.choiceofgames.com/t/i-need-help-in-coding/17972/21 "2016-06-04T05:40:43Z")

</div>

Thank a lot for the help there is also one thing that keeps bugging me “choicescript\_stats line 21: invalid indent, expected at least one row” this always shows up

---

<div class="post-metadata">

**Author:** ![CitizenShawn](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/citizenshawn/32/1386_2.png) [@CitizenShawn](https://forum.choiceofgames.com/u/CitizenShawn)\
**Post date:** [June 4, 2016, 5:54am UTC](https://forum.choiceofgames.com/t/i-need-help-in-coding/17972/22 "2016-06-04T05:54:59Z")

</div>

I need to see your code to help. Paste it in and then highlight it, and click this button (see image.) The button looks like this: \</\>

```
Your text will look like this.
  with indents.
and without.

```

![](https://global.discourse-cdn.com/choiceofgames/original/2X/0/01188ffc916acc54b8e320c092681aa4ba50037d.PNG)

---

<div class="post-metadata">

**Author:** ![Grim\_Nightcore](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/grim_nightcore/32/13745_2.png) [@Grim\_Nightcore](https://forum.choiceofgames.com/u/Grim_Nightcore)\
**Post date:** [June 4, 2016, 6:00am UTC](https://forum.choiceofgames.com/t/i-need-help-in-coding/17972/23 "2016-06-04T06:00:51Z")

</div>

```
*label stat

*choice

  #Character_Info
    *stat_chart
    text Name
    text Surname
    text Gender
    text Class
    text Wealth
    *goto stat
  #Status
  
    *stat_chart
    
    percent Health
    percent Strength
    percent Leadership
    percent Inteligence
    percent Charisma
    percent Magic
    percent Stealth
    opposed_pair Strong
      Weak
    opposed_pair Mercyful
      Brutal
    *goto stat
  *selectable_if (Relationship="true") #Relationship
  
    *stat_chart
    
    percent Shaun
    percent Jackson
    percent Isaac
    percent Kreed
    percent Kelly
    percent Amber
    *goto stat`indent preformatted text by 4 spaces`
```

---

<div class="post-metadata">

**Author:** ![Grim\_Nightcore](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/grim_nightcore/32/13745_2.png) [@Grim\_Nightcore](https://forum.choiceofgames.com/u/Grim_Nightcore)\
**Post date:** [June 4, 2016, 6:02am UTC](https://forum.choiceofgames.com/t/i-need-help-in-coding/17972/24 "2016-06-04T06:02:52Z")

</div>

```
*label stat

*choice

  #Character_Info
    *stat_chart
    text Name
    text Surname
    text Gender
    text Class
    text Wealth
    *goto stat
  #Status
  
    *stat_chart
    
    percent Health
    percent Strength
    percent Leadership
    percent Inteligence
    percent Charisma
    percent Magic
    percent Stealth
    opposed_pair Strong
      Weak
    opposed_pair Mercyful
      Brutal
    *goto stat
  *selectable_if (Relationship="true") #Relationship
  
    *stat_chart
    
    percent Shaun
    percent Jackson
    percent Isaac
    percent Kreed
    percent Kelly
    percent Amber
    *goto stat
```

---

<div class="post-metadata">

**Author:** ![Grim\_Nightcore](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/grim_nightcore/32/13745_2.png) [@Grim\_Nightcore](https://forum.choiceofgames.com/u/Grim_Nightcore)\
**Post date:** [June 4, 2016, 6:03am UTC](https://forum.choiceofgames.com/t/i-need-help-in-coding/17972/25 "2016-06-04T06:03:12Z")

</div>

Sorry sent it twice by mistake

---

<div class="post-metadata">

**Author:** ![Grim\_Nightcore](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/grim_nightcore/32/13745_2.png) [@Grim\_Nightcore](https://forum.choiceofgames.com/u/Grim_Nightcore)\
**Post date:** [June 4, 2016, 6:17am UTC](https://forum.choiceofgames.com/t/i-need-help-in-coding/17972/26 "2016-06-04T06:17:21Z")

</div>

Honestly I don’t see anything wrong

---

<div class="post-metadata">

**Author:** ![CitizenShawn](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/citizenshawn/32/1386_2.png) [@CitizenShawn](https://forum.choiceofgames.com/u/CitizenShawn)\
**Post date:** [June 4, 2016, 6:23am UTC](https://forum.choiceofgames.com/t/i-need-help-in-coding/17972/27 "2016-06-04T06:23:20Z")

</div>

Try indenting the values under the \*stat\_chart command.

```
*label stat

*choice

  #Character_Info
    *stat_chart
    text Name
    text Surname
    text Gender
    text Class
    text Wealth
    *goto stat
  #Status
  
    *stat_chart
    
      percent Health
      percent Strength
      percent Leadership
      percent Inteligence
      percent Charisma
      percent Magic
      percent Stealth
      opposed_pair Strong
        Weak
      opposed_pair Mercyful
        Brutal
    *goto stat
  *selectable_if (Relationship="true") #Relationship
  
    *stat_chart
```

---

<div class="post-metadata">

**Author:** ![CitizenShawn](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/citizenshawn/32/1386_2.png) [@CitizenShawn](https://forum.choiceofgames.com/u/CitizenShawn)\
**Post date:** [June 4, 2016, 6:24am UTC](https://forum.choiceofgames.com/t/i-need-help-in-coding/17972/28 "2016-06-04T06:24:26Z")

</div>

Oh and delete the blank line underneath \*stat\_chart I don’t think you need it. And make sure you get the first \*stat\_chart too.

---

<div class="post-metadata">

**Author:** ![Grim\_Nightcore](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/grim_nightcore/32/13745_2.png) [@Grim\_Nightcore](https://forum.choiceofgames.com/u/Grim_Nightcore)\
**Post date:** [June 4, 2016, 7:28am UTC](https://forum.choiceofgames.com/t/i-need-help-in-coding/17972/29 "2016-06-04T07:28:09Z")

</div>

Okay I’m done with my baseline already thanks to your help . . . do you know how to put an inventory in the story? because mine is action based and has many fight scenes that needs the items

---

<div class="post-metadata">

**Author:** ![Grim\_Nightcore](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/grim_nightcore/32/13745_2.png) [@Grim\_Nightcore](https://forum.choiceofgames.com/u/Grim_Nightcore)\
**Post date:** [June 4, 2016, 8:37am UTC](https://forum.choiceofgames.com/t/i-need-help-in-coding/17972/30 "2016-06-04T08:37:31Z")

</div>

Is there a possibility that the quick test is wrong?

---

<div class="post-metadata">

**Author:** ![Cecilia\_Rosewood](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/cecilia_rosewood/32/253835_2.png) [@Cecilia\_Rosewood](https://forum.choiceofgames.com/u/Cecilia_Rosewood)\
**Post date:** [June 4, 2016, 8:52am UTC](https://forum.choiceofgames.com/t/i-need-help-in-coding/17972/31 "2016-06-04T08:52:07Z")

</div>

Nope. It’s always _technically_ correct. The line number it calls out for the error might not be the line actually causing the error though. It might be a bit before or after that line, or connected to some variable that didn’t get declared properly somewhere before a part of code.

---

<div class="post-metadata">

**Author:** ![Sashira](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/sashira/32/2899_2.png) [@Sashira](https://forum.choiceofgames.com/u/Sashira)\
**Post date:** [June 4, 2016, 4:50pm UTC](https://forum.choiceofgames.com/t/i-need-help-in-coding/17972/32 "2016-06-04T16:50:39Z")

</div>

This is a good thread on inventory stuff:

> [@Inventory Code Help](https://forum.choiceofgames.com/t/inventory-code-help/9253):
>
> Hey everybody, I try making an inventory in my choicescript\_stats.txt for a long time and cant get it right. everything’s fine and there is not error messege; except when i actually choose the item the inventory remains empty. Here’s the code: \*if (silenced\_pistol) \*set inventory &“Silenced Pistol” \*set comma true \*if (sleepdarts) \*if comma \*set inventory &", " \*set comma true \*set inventory &“Sleep Darts” \*if (taser\_gun) \*if comma \*set inventory &", " \*set comma true \*set inventory…

---

<div class="post-metadata">

**Author:** ![Grim\_Nightcore](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/grim_nightcore/32/13745_2.png) [@Grim\_Nightcore](https://forum.choiceofgames.com/u/Grim_Nightcore)\
**Post date:** [June 5, 2016, 10:14am UTC](https://forum.choiceofgames.com/t/i-need-help-in-coding/17972/33 "2016-06-05T10:14:49Z")

</div>

Is it ok if I tag everyone that helped me in my work?

---

<div class="post-metadata">

**Author:** ![Grim\_Nightcore](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/grim_nightcore/32/13745_2.png) [@Grim\_Nightcore](https://forum.choiceofgames.com/u/Grim_Nightcore)\
**Post date:** [October 10, 2017, 3:51pm UTC](https://forum.choiceofgames.com/t/i-need-help-in-coding/17972/34 "2017-10-10T15:51:51Z")

</div>

Sorry been so long since i came back to choice script i need help once more.

\*label Naming

Let us begin.

We’ll start with your name?  
\*choice  
#Adam  
\*set name “Adam”  
\*goto last\_name  
#Peter  
\*set name “Peter”  
\*goto last\_name  
#Leona  
\*set name “Leona”  
\*goto last\_name  
#April  
\*set name “April”  
\*goto last\_name  
#What the!? those are not my names.  
Oh! Please fogive me.  
\*label input\_name  
Then what is your name?  
\*input\_text name

```
*if ("${name}" != "$!{name}")

  Your name is $!{name}, is that right?
  *choice
    #Yes.
      *set name "$!{name}"
      *goto last_name
    #Uhhh, wait, let me try that again.
      *goto input_name

```

whenever i run it it does not go to the “Your name is $!{name}, is that right?” it skips that part and goes directly to creation of last name how can i fix that?

---

<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:** [October 10, 2017, 3:59pm UTC](https://forum.choiceofgames.com/t/i-need-help-in-coding/17972/35 "2017-10-10T15:59:13Z")

</div>

Because the variable contains string that has its first letter capitalized?  
If you put, let’s say… “Bob” for example, it won’t go through there. However, using “bob” will lead you through that code you mentioned.

You see, in case of name “bob”…

```
"${name}" = "bob"
"$!{name}" = "Bob"
and "$!!{name}" = "BOB"

```

---

<div class="post-metadata">

**Author:** ![Minnow](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Minnow](https://forum.choiceofgames.com/u/Minnow)\
**Post date:** [October 10, 2017, 4:06pm UTC](https://forum.choiceofgames.com/t/i-need-help-in-coding/17972/36 "2017-10-10T16:06:35Z")

</div>

> [@Grim\_Nightcore](#):
>
> \*if (“${name}” != “$!{name}”)
> 
> Your name is $!{name}, is that right?  
> \*choice  
> #Yes.  
> \*set name “$!{name}”  
> \*goto last\_name  
> #Uhhh, wait, let me try that again.  
> \*goto input\_name

Try replacing `*if ("${name}" != "$!{name}")`

with `*if name != "$!{name}"`

---

<div class="post-metadata">

**Author:** ![Grim\_Nightcore](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/grim_nightcore/32/13745_2.png) [@Grim\_Nightcore](https://forum.choiceofgames.com/u/Grim_Nightcore)\
**Post date:** [October 10, 2017, 11:41pm UTC](https://forum.choiceofgames.com/t/i-need-help-in-coding/17972/37 "2017-10-10T23:41:52Z")

</div>

Thanks a lot @Szaal it helped me fix my code i hope i can count on you and the others for help in the future

---

<div class="post-metadata">

**Author:** ![Grim\_Nightcore](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/grim_nightcore/32/13745_2.png) [@Grim\_Nightcore](https://forum.choiceofgames.com/u/Grim_Nightcore)\
**Post date:** [October 11, 2017, 1:00pm UTC](https://forum.choiceofgames.com/t/i-need-help-in-coding/17972/38 "2017-10-11T13:00:24Z")

</div>

What do you use to separate a story into two parts do you use break or something?

---

<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:** [October 11, 2017, 1:28pm UTC](https://forum.choiceofgames.com/t/i-need-help-in-coding/17972/39 "2017-10-11T13:28:17Z")

</div>

Yup. Just slip the `*page_break` command between the parts you want to separate.  
This will create a “Next” button in the actual game.

---

<div class="post-metadata">

**Author:** ![Grim\_Nightcore](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/grim_nightcore/32/13745_2.png) [@Grim\_Nightcore](https://forum.choiceofgames.com/u/Grim_Nightcore)\
**Post date:** [October 12, 2017, 4:23pm UTC](https://forum.choiceofgames.com/t/i-need-help-in-coding/17972/40 "2017-10-12T16:23:10Z")

</div>

RANDOMTEST FAILED: Error: line 107: Not a number: blah blah what does that mean?

[Previous page](https://forum.choiceofgames.com/t/i-need-help-in-coding/17972.md?page=1)

[Next page](https://forum.choiceofgames.com/t/i-need-help-in-coding/17972.md?page=3)
