# Need Choice Script help (invalid expression)

**URL:** <https://forum.choiceofgames.com/t/need-choice-script-help-invalid-expression/743>\
**Category:** ChoiceScript Help\
**Created:** [September 10, 2012, 11:40pm UTC](https://forum.choiceofgames.com/t/need-choice-script-help-invalid-expression/743 "2012-09-10T23:40:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trywm](https://avatars.discourse-cdn.com/v4/letter/t/838e76/32.png) [@Trywm](https://forum.choiceofgames.com/u/Trywm)\
**Post date:** [September 10, 2012, 11:40pm UTC](https://forum.choiceofgames.com/t/need-choice-script-help-invalid-expression/743/1 "2012-09-10T23:40:10Z")

</div>

I’m pretty bad with this stuff so I likely am missing something obvious.  
I get this error when I’m testing my game:  
line 25: Invalid expression at char 2, expected NUMBER, STRING, VAR or PARENTHETICAL, was: EQUALITY [=]  
At line 25 I have this \*set VisionArena = true  
In mygame.js I have ,VisionArena: false.  
I usually use firefox because I like it much better, but I also tried IE. No help there.  
Help? I’m awful at coding. Do I need to \*set it? I was under the impressino I didn’t.

---

<div class="post-metadata">

**Author:** ![Farside](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/farside/32/781_2.png) [@Farside](https://forum.choiceofgames.com/u/Farside)\
**Post date:** [September 10, 2012, 11:45pm UTC](https://forum.choiceofgames.com/t/need-choice-script-help-invalid-expression/743/2 "2012-09-10T23:45:18Z")

</div>

Try \*set VisionArena “true”

For some reason you can’t use equalities when using the \*set command, although you can use equalities when using the \*if command.

---

<div class="post-metadata">

**Author:** ![FcA](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fca/32/432_2.png) [@FcA](https://forum.choiceofgames.com/u/FcA)\
**Post date:** [September 10, 2012, 11:54pm UTC](https://forum.choiceofgames.com/t/need-choice-script-help-invalid-expression/743/3 "2012-09-10T23:54:12Z")

</div>

If your variable is numeric:

```
*set energy 20

```

For string (or maybe alphanumeric) variable:

```
*set name "John"

```

For logical:

```
*set visionArena true

```

---

<div class="post-metadata">

**Author:** ![Trywm](https://avatars.discourse-cdn.com/v4/letter/t/838e76/32.png) [@Trywm](https://forum.choiceofgames.com/u/Trywm)\
**Post date:** [September 10, 2012, 11:54pm UTC](https://forum.choiceofgames.com/t/need-choice-script-help-invalid-expression/743/4 "2012-09-10T23:54:56Z")

</div>

Just tried it, doesn’t work. I also tried replacing it with numbers and got this message line 25: Non-existent variable ‘visionarena’.

---

<div class="post-metadata">

**Author:** ![Farside](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/farside/32/781_2.png) [@Farside](https://forum.choiceofgames.com/u/Farside)\
**Post date:** [September 11, 2012, 12:12am UTC](https://forum.choiceofgames.com/t/need-choice-script-help-invalid-expression/743/5 "2012-09-11T00:12:01Z")

</div>

I would check the capitilization of the variable. They have to be the same. If you set the variable as VisionArena in mygame.js, then you have to keep calling it VisionArena, not visionarena.

---

<div class="post-metadata">

**Author:** ![Aritour](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/aritour/32/198441_2.png) [@Aritour](https://forum.choiceofgames.com/u/Aritour)\
**Post date:** [September 11, 2012, 2:16am UTC](https://forum.choiceofgames.com/t/need-choice-script-help-invalid-expression/743/6 "2012-09-11T02:16:30Z")

</div>

You can’t have any capitol letters when declaring stats in the mygame.js

Use `,visionarena: false ` with proper indentation. This also means that when you \*set you will have to use `visionarena`, without the capitilization.

---

<div class="post-metadata">

**Author:** ![CJW](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/cjw/32/111787_2.png) [@CJW](https://forum.choiceofgames.com/u/CJW)\
**Post date:** [September 11, 2012, 10:35am UTC](https://forum.choiceofgames.com/t/need-choice-script-help-invalid-expression/743/7 "2012-09-11T10:35:11Z")

</div>

Indentation doesn’t actually matter in java script files, but yeah it’s good practice to keep it nice and legible. It does sound like the new issue is caused by either a spelling mistake or inconsistent capitalization.

---

<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:** [September 11, 2012, 3:55pm UTC](https://forum.choiceofgames.com/t/need-choice-script-help-invalid-expression/743/8 "2012-09-11T15:55:13Z")

</div>

The best way to avoid those errors would be to name the variable “visionarena” or “vision\_arena” instead of “visionArena”; do not use capital numbers as that will most likely give you errors if you try to modify that set variable. You can use underscores ( \_ ) but try not to use capital/uppercase letters for variables.

---

<div class="post-metadata">

**Author:** ![Trywm](https://avatars.discourse-cdn.com/v4/letter/t/838e76/32.png) [@Trywm](https://forum.choiceofgames.com/u/Trywm)\
**Post date:** [September 11, 2012, 5:24pm UTC](https://forum.choiceofgames.com/t/need-choice-script-help-invalid-expression/743/9 "2012-09-11T17:24:16Z")

</div>

Ah. I’ve got it working. I added \*set visionarena false to the beginning of the text file.  
I thought having it set the default as false would do it, guess not.

D’oh.
