# Stat based outcomes

**URL:** <https://forum.choiceofgames.com/t/stat-based-outcomes/11529>\
**Category:** ChoiceScript Help\
**Created:** [August 23, 2015, 6:37pm UTC](https://forum.choiceofgames.com/t/stat-based-outcomes/11529 "2015-08-23T18:37:43Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Storyvector](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@Storyvector](https://forum.choiceofgames.com/u/Storyvector)\
**Post date:** [August 23, 2015, 6:37pm UTC](https://forum.choiceofgames.com/t/stat-based-outcomes/11529/1 "2015-08-23T18:37:43Z")

</div>

Basically, I want the player to have a different outcome of a choice depending on the stat.

I found a way to do this by…  
\*if (Strength \> 40) #Knock him out`

```
You knock him out.
*finish

```

\*if (Strength \< 40) #Knock him out

```
You fail at knocking him out
*finish

```

(These are just examples btw. Not from my game)  
Once I quicktest it, it says  
“Invalid expression, couldn’t extract another token”  
Help

---

<div class="post-metadata">

**Author:** ![faewkless](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/faewkless/32/137305_2.png) [@faewkless](https://forum.choiceofgames.com/u/faewkless)\
**Post date:** [August 23, 2015, 6:49pm UTC](https://forum.choiceofgames.com/t/stat-based-outcomes/11529/2 "2015-08-23T18:49:20Z")

</div>

I changed your title for if others get the same problem,also wouldnt this work.

```
*choice
 #Knock them out
  *if (strength<40)
           Blank
  *if (strength>40)
           Other Blank
```

---

<div class="post-metadata">

**Author:** ![seabean](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/seabean/32/96835_2.png) [@seabean](https://forum.choiceofgames.com/u/seabean)\
**Post date:** [August 23, 2015, 6:51pm UTC](https://forum.choiceofgames.com/t/stat-based-outcomes/11529/3 "2015-08-23T18:51:15Z")

</div>

You don’t need to make multiple choices. Change it to something like this:

```
 #Knock him out
    *if (Strength >= 40)
         You knock him out.
         *finish
    *else
         You fail at knocking him out.
         *finish
```

---

<div class="post-metadata">

**Author:** ![Storyvector](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@Storyvector](https://forum.choiceofgames.com/u/Storyvector)\
**Post date:** [August 23, 2015, 6:57pm UTC](https://forum.choiceofgames.com/t/stat-based-outcomes/11529/4 "2015-08-23T18:57:24Z")

</div>

Is your suggestion and faewkless’s basically the same thing

---

<div class="post-metadata">

**Author:** ![Lordirish](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/lordirish/32/238051_2.png) [@Lordirish](https://forum.choiceofgames.com/u/Lordirish)\
**Post date:** [August 23, 2015, 7:00pm UTC](https://forum.choiceofgames.com/t/stat-based-outcomes/11529/5 "2015-08-23T19:00:30Z")

</div>

There are always more then one to code it, but they both have the same effect.

---

<div class="post-metadata">

**Author:** ![mrwolf2](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@mrwolf2](https://forum.choiceofgames.com/u/mrwolf2)\
**Post date:** [August 23, 2015, 7:01pm UTC](https://forum.choiceofgames.com/t/stat-based-outcomes/11529/6 "2015-08-23T19:01:00Z")

</div>

I think that if you us feawkless way you have no option when you have the value of 40. You only got the higher and lower symbol \< and \>.  
The = is equal,  
so either \>40 and \<= 40  
or \>=40 and \<40.

---

<div class="post-metadata">

**Author:** ![Storyvector](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@Storyvector](https://forum.choiceofgames.com/u/Storyvector)\
**Post date:** [August 23, 2015, 7:08pm UTC](https://forum.choiceofgames.com/t/stat-based-outcomes/11529/7 "2015-08-23T19:08:12Z")

</div>

Which would you use?

---

<div class="post-metadata">

**Author:** ![mrwolf2](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@mrwolf2](https://forum.choiceofgames.com/u/mrwolf2)\
**Post date:** [August 23, 2015, 7:17pm UTC](https://forum.choiceofgames.com/t/stat-based-outcomes/11529/8 "2015-08-23T19:17:39Z")

</div>

Well, if the question was directed towards me, I am mostly writing as feawkless wrote, but both are possible, especially if you are working with two options.

Also, just wondering, in what program do you write it? Only asking because when I started writing I wrote in notepad, but I should have been using notepad++ because it’s a lot easier. (just a friendly tip)

---

<div class="post-metadata">

**Author:** ![Storyvector](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@Storyvector](https://forum.choiceofgames.com/u/Storyvector)\
**Post date:** [August 23, 2015, 7:36pm UTC](https://forum.choiceofgames.com/t/stat-based-outcomes/11529/9 "2015-08-23T19:36:17Z")

</div>

I use notepad. I don’t have an option to use notepad++ when I click, open with…

---

<div class="post-metadata">

**Author:** ![mrwolf2](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@mrwolf2](https://forum.choiceofgames.com/u/mrwolf2)\
**Post date:** [August 23, 2015, 7:49pm UTC](https://forum.choiceofgames.com/t/stat-based-outcomes/11529/10 "2015-08-23T19:49:46Z")

</div>

True, you need to download notepad++ first, but it’s a free source program, so you can download it for free.

Biggest plus of it I found was that it was spell check and lining so you can see if you spacing is correct, which will come in handy (also, it’s easier to use the tab instead of space bar, you can’t use both or it will give an error).

---

<div class="post-metadata">

**Author:** ![Storyvector](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@Storyvector](https://forum.choiceofgames.com/u/Storyvector)\
**Post date:** [August 23, 2015, 8:00pm UTC](https://forum.choiceofgames.com/t/stat-based-outcomes/11529/11 "2015-08-23T20:00:41Z")

</div>

Just installed it and it looks awesome. Btw, I thought you said it had spell check?

---

<div class="post-metadata">

**Author:** ![mrwolf2](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@mrwolf2](https://forum.choiceofgames.com/u/mrwolf2)\
**Post date:** [August 23, 2015, 8:10pm UTC](https://forum.choiceofgames.com/t/stat-based-outcomes/11529/12 "2015-08-23T20:10:57Z")

</div>

Yeah, should be. If it doesn’t start automatically try alt + A

Or go to plugins, dspellcheck

If it’s not installed go to plugins, plugin manager, and install dspellcheck

---

<div class="post-metadata">

**Author:** ![Storyvector](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@Storyvector](https://forum.choiceofgames.com/u/Storyvector)\
**Post date:** [August 23, 2015, 8:20pm UTC](https://forum.choiceofgames.com/t/stat-based-outcomes/11529/13 "2015-08-23T20:20:16Z")

</div>

Okay, I got it. Thanks for the help.

---

<div class="post-metadata">

**Author:** ![mrwolf2](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@mrwolf2](https://forum.choiceofgames.com/u/mrwolf2)\
**Post date:** [August 23, 2015, 8:33pm UTC](https://forum.choiceofgames.com/t/stat-based-outcomes/11529/14 "2015-08-23T20:33:58Z")

</div>

Your very welcome, and good luck with your writing. Also, ctrl + f and ctrl + g are handy to know.
