# At a standstill with coding

**URL:** <https://forum.choiceofgames.com/t/at-a-standstill-with-coding/30524>\
**Category:** ChoiceScript Help\
**Created:** [September 11, 2017, 8:33pm UTC](https://forum.choiceofgames.com/t/at-a-standstill-with-coding/30524 "2017-09-11T20:33:48Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arasia\_Valentia](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/arasia_valentia/32/203989_2.png) [@Arasia\_Valentia](https://forum.choiceofgames.com/u/Arasia_Valentia)\
**Post date:** [September 11, 2017, 8:33pm UTC](https://forum.choiceofgames.com/t/at-a-standstill-with-coding/30524/1 "2017-09-11T20:33:48Z")

</div>

So, I’m alive. I’ve been writing super hard core and decided to put everything in my demo out at once. However there is a problem I have encountered. A scene that allows the MC to get a huge star boost isn’t working the way I want. I’m not even sure how I would code it.

Basically if these four generals you speak to are not drunk, then you have a chance to get stat increases. However you must be on good standing with the leader of these generals. My problem is I have three possible outcomes based on 3 different relationship values.

Over 60 is full +5 to all stats

50-60 is +2

Under 50 is none at all.

I’ve tried a lot of things. Making variables true or false. \*if then \*if (blank=blank), etc and it always reverts to the middle one for some reason.

I’ve been using  
\*if (Leifrep\>60)  
\*goto alot  
\*if (Leifrep\>50)  
\*goto kinda  
\*else  
\*goto none

Am I doing it all wrong?

---

<div class="post-metadata">

**Author:** ![RETowers](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/retowers/32/21477_2.png) [@RETowers](https://forum.choiceofgames.com/u/RETowers)\
**Post date:** [September 11, 2017, 8:37pm UTC](https://forum.choiceofgames.com/t/at-a-standstill-with-coding/30524/2 "2017-09-11T20:37:57Z")

</div>

Can you copy paste your actual code? This should work:

```
*if relationship > 60
  *set stats + 5
  *goto blah
*elseif relationship > 50
  *set stats +2
  *goto blah
*else
  *goto blah

```

---

<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:** [September 12, 2017, 4:04am UTC](https://forum.choiceofgames.com/t/at-a-standstill-with-coding/30524/3 "2017-09-12T04:04:49Z")

</div>

Well, since @RETowers already offered the solution, I’ll point out the mistake you made from that code, @Arasia_Valentia. It’ll be good for us to learn from our mistake, right?

> [@Arasia\_Valentia](#):
>
> ```choicescript
> *if (Leifrep>60)
> *goto alot
> *if (Leifrep>50)
> *goto kinda
> *else
> *goto none
> 
> ```

So… hmm… yeah 👓

Is the variable `Leifrep` actually started with a cap? And not `leifrep`?

---

<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:** [September 12, 2017, 6:07am UTC](https://forum.choiceofgames.com/t/at-a-standstill-with-coding/30524/4 "2017-09-12T06:07:52Z")

</div>

Assuming your code is like RETowers, then you are doing it right. In that case, you want to make sure that the stat Leifrep can be greater than 60 or less than 50 at that point. That means checking your earlier options where you have edited that stat value.

---

<div class="post-metadata">

**Author:** ![RETowers](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/retowers/32/21477_2.png) [@RETowers](https://forum.choiceofgames.com/u/RETowers)\
**Post date:** [September 12, 2017, 6:38am UTC](https://forum.choiceofgames.com/t/at-a-standstill-with-coding/30524/5 "2017-09-12T06:38:56Z")

</div>

You can also run randomtest and check to see there are line hits there. If there aren’t, you can be fairly certain that your stats can’t get that high.

---

<div class="post-metadata">

**Author:** ![DUNGEON\_MASTER](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/dungeon_master/32/56675_2.png) [@DUNGEON\_MASTER](https://forum.choiceofgames.com/u/DUNGEON_MASTER)\
**Post date:** [September 12, 2017, 9:23am UTC](https://forum.choiceofgames.com/t/at-a-standstill-with-coding/30524/6 "2017-09-12T09:23:27Z")

</div>

```
*if (Leifrep>59)
   *goto alot
*if ((Leifrep>50) and (Leifrep <60))
   *goto kinda
*else
   *goto none

```

---

<div class="post-metadata">

**Author:** ![Arasia\_Valentia](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/arasia_valentia/32/203989_2.png) [@Arasia\_Valentia](https://forum.choiceofgames.com/u/Arasia_Valentia)\
**Post date:** [September 17, 2017, 12:20am UTC](https://forum.choiceofgames.com/t/at-a-standstill-with-coding/30524/7 "2017-09-17T00:20:58Z")

</div>

Halel, I return. It worked, so thank you all.

---

<div class="post-metadata">

**Author:** ![Jerieth](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/jerieth/32/11242_2.png) [@Jerieth](https://forum.choiceofgames.com/u/Jerieth)\
**Post date:** [September 20, 2017, 6:54pm UTC](https://forum.choiceofgames.com/t/at-a-standstill-with-coding/30524/8 "2017-09-20T18:54:27Z")

</div>

Yeah, remembering the range is very important.

---

<div class="post-metadata">

**Author:** ![DUNGEON\_MASTER](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/dungeon_master/32/56675_2.png) [@DUNGEON\_MASTER](https://forum.choiceofgames.com/u/DUNGEON_MASTER)\
**Post date:** [September 20, 2017, 9:56pm UTC](https://forum.choiceofgames.com/t/at-a-standstill-with-coding/30524/9 "2017-09-20T21:56:18Z")

</div>

> [@Jerieth](#):
>
> Yeah, remembering the range is very important.

yeah 😁

* * *
