# I hit a snag while doing \*if statements

**URL:** <https://forum.choiceofgames.com/t/i-hit-a-snag-while-doing-if-statements/24101>\
**Category:** ChoiceScript Help\
**Created:** [February 19, 2017, 4:51am UTC](https://forum.choiceofgames.com/t/i-hit-a-snag-while-doing-if-statements/24101 "2017-02-19T04:51:25Z")\
**Posts on this page:** 10\
**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:** [February 19, 2017, 4:51am UTC](https://forum.choiceofgames.com/t/i-hit-a-snag-while-doing-if-statements/24101/1 "2017-02-19T04:51:25Z")

</div>

So after studying all the scripting guides I decided to revamp my code just to make things easier and more organized. However during the process I hit a tiny snag. I’m using quite a bit \*if \*else statements and at this point I know how they work. For some odd reason when I try to use a \> or \< paired with a number it won’t work? I have two variables Intimidation and Persuasion and I’m trying to do a different thing for each.I’m wondering if perhaps the inability in this situation to use the \*else would cause issues? So I did both, one in a slightly unorthodox way, and neither worked. I’ve read through the wonderful guide by R.E Towers, and I just don’t see what I’m doing wrong. Here is both of the coding…

You turn to look back at the three men  
\*if (Persuasion\>7)  
\*goto pers  
\*else  
\*goto intim

\*label pers  
and you force a charming smile on your face.

\*label intim  
and  
\*if (Intimidation\>7)  
\*goto intimzwei

\*label intimzwei  
you take a step, jaw dropping into an angry line.

And then the second

You turn to look back at the three men  
\*if (Persuasion\>7)  
\*goto pers

\*if (Intimidation\>7)  
\*goto intim

\*label pers  
and you force a charming smile on your face.

\*label intim  
and you take a step, jaw dropping into an angry line.

(the indents dont show up but they are indeed there btw.]  
Neither seems to work at this point, both showing up despite specifying to show up only if Intim and Pers is greater than 7 in both of their respective places/times. I’m probably just missing something, I’m known to do that, so I will change it to an opposing pair and see if I can crudely slide by until I actually need those variables.

---

<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:** [February 19, 2017, 6:14am UTC](https://forum.choiceofgames.com/t/i-hit-a-snag-while-doing-if-statements/24101/2 "2017-02-19T06:14:32Z")

</div>

Ok… first thing first, you can block your texts and hit the `</>` button to apply the `unformatted text`  
This will help a lot, especially so we can identify your indentation.

And about your problem, I assume you’re encountering an “ignored \*if command”, right?  
You might want to look at this [thread](https://forum.choiceofgames.com/t/if-if-versus-if-else-elseif/23434) for that one.

---

<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:** [February 19, 2017, 6:25am UTC](https://forum.choiceofgames.com/t/i-hit-a-snag-while-doing-if-statements/24101/3 "2017-02-19T06:25:54Z")

</div>

And about your code

```
You turn to look back at the three men 
*if (Persuasion>7)
   *goto pers
*else 
   *goto intim

*label pers
and you force a charming smile on your face.

*label intim
and
*if (Intimidation>7)
   *goto intimzwei

*label intimzwei
you take a step, jaw dropping into an angry line.

```

In both case, I’ll assume that I have either high [Intimidation] or [Persuasion], right?  
Now, for the first code, let’s say I have high Intimidation. Thus, I don’t pass Persuasion.

This should result in  
`You turn to look back at the three men and you take a step, jaw dropping into an angry line`

However, if I have high Persuasion and don’t pass Intimidation, the code should result in  
`You turn to look back at the three men and you force a charming smile on your face. and you take a step, jaw dropping into an angry line`

* * *

[details=Compare to the second code]```  
You turn to look back at the three men  
\*if (Persuasion\>7)  
\*goto pers

\*if (Intimidation\>7)  
\*goto intim

\*label pers  
and you force a charming smile on your face.

\*label intim  
and you take a step, jaw dropping into an angry line.

```
[/details]
Having a high Persuasion will result me the both `*label` [pers] and [intimzwei]
While having the vice versa will get me directly to the `*label intimzwei` only.

How can this happen? Check my above link :point_up_2: :point_up:
```

---

<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:** [February 19, 2017, 3:33pm UTC](https://forum.choiceofgames.com/t/i-hit-a-snag-while-doing-if-statements/24101/4 "2017-02-19T15:33:25Z")

</div>

Thanks a ton. Once I get some coffee in my I’ll start this endeavor. In the end, changing it to an opposing pair should also make this easier correct?

---

<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:** [February 19, 2017, 3:47pm UTC](https://forum.choiceofgames.com/t/i-hit-a-snag-while-doing-if-statements/24101/5 "2017-02-19T15:47:36Z")

</div>

> [@Arasia\_Valentia](#):
>
> changing it to an opposing pair should also make this easier correct?

Well, if the PC can’t be both Persuasive and Intimidating enough, I think there’s no hurt in doing that

---

<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:** [February 19, 2017, 4:22pm UTC](https://forum.choiceofgames.com/t/i-hit-a-snag-while-doing-if-statements/24101/6 "2017-02-19T16:22:07Z")

</div>

So i got it working, but for some alien reason my percents keep getting effed up. Normally when I have a percent I do this

\*set Persuasion%+5

for some unknown reason no matter which I choose the intimidation goes up to 92% and persuasion down to 8%. None of my other percents thus far have done that and they are all formatted the same. Why would that be?

---

<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:** [February 19, 2017, 4:25pm UTC](https://forum.choiceofgames.com/t/i-hit-a-snag-while-doing-if-statements/24101/7 "2017-02-19T16:25:04Z")

</div>

Well, what I can think of:

1. This [Persuasion] variable, is actually [Intimidation] opposed to “fake” [Persuasion] variable.
2. The `*set` commands might be similar and no difference of it at all of your choice options.

You might want to take a look back to the variable and your choices.  
And is it okay declaring `*set Persuasion%+5` without a space?

---

<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:** [February 19, 2017, 4:25pm UTC](https://forum.choiceofgames.com/t/i-hit-a-snag-while-doing-if-statements/24101/8 "2017-02-19T16:25:54Z")

</div>

Huh when I fixed the percent it went back to displaying both and I am now using \*elseif this is strange. Ill take another look at the thread.

---

<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:** [February 19, 2017, 4:26pm UTC](https://forum.choiceofgames.com/t/i-hit-a-snag-while-doing-if-statements/24101/9 "2017-02-19T16:26:41Z")

</div>

You might yet to update the game files 😜

---

<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:** [February 19, 2017, 4:33pm UTC](https://forum.choiceofgames.com/t/i-hit-a-snag-while-doing-if-statements/24101/10 "2017-02-19T16:33:18Z")

</div>

Reading the thread a second time helped. All good! Thanks for your help.
