# Choice locking out

**URL:** <https://forum.choiceofgames.com/t/choice-locking-out/40324>\
**Category:** ChoiceScript Help\
**Created:** [June 25, 2018, 2:22am UTC](https://forum.choiceofgames.com/t/choice-locking-out/40324 "2018-06-25T02:22:10Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tevin](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/tevin/32/99011_2.png) [@Tevin](https://forum.choiceofgames.com/u/Tevin)\
**Post date:** [June 25, 2018, 2:22am UTC](https://forum.choiceofgames.com/t/choice-locking-out/40324/1 "2018-06-25T02:22:11Z")

</div>

Hello, I am extremely new to choicescript, I just downloaded it two days ago, and although I’ve already 364 lines in I’ve found myself stumped. I really hope no one has posted this question before because I searched it up on here but couldn’t find it, but I suspect it is just hard to phrase. If it has been posted before I am very sorry.

Basically, I want to make a choice that only appears and can be chosen if you have previously chosen a specific background. In this example, I want an option for someone who has chosen to be an orphan to be able to join a gang.

I have already figured out stat checking, but I do not know how to stat check before a choice to lock it out instead of after you have already chosen it.

If I am being to vague, I got this idea from a gangster choice game where choosing to be poor later gave an extra choice when being pursued by police. I can’t seem to emulate this with my current code, and I really want to keep writing.

My code looks like this, basically I need to find a way to lock out the gang choice and the rich life choice (It is very long because I have a lot of choices at every chance, I am very sorry if it seems overwhelming but I cut out the stat changes for you all):  
\*label criminal  
Interesting. But most of the people in this city got into some type of criminal activity during their teenage years, and seeing where you’ve ended up,I’d say you’re no exception. What type of stuff did you get into?  
\*choice  
#I ended up transporting drugs  
(Speed+ intelligence+ money+) A courier? I guess that’s as good a start as any. You’d need to learn some speed and how to not look suspicious.

```
	*goto graduate
#I got into dealing stolen goods 
	(intelligence++ Money+) A dealer is a great start. You must've learned a lot.
	
	*goto graduate
#I started shaking down people  
	(Strength++ money+) Basic, but just as effective as any other.
	
	*goto graduate
#I became a con artist 
	(Charisma+ intelligence money+) You probably learned some charm and some brains for your schemes then.
	
	*goto graduate
#I joined a teenage fight club 
	(Endurance+ Stamina+ money+) In those days you would've just learned how to take hits since no one knew any real thing about streetfighting back then. Nice experience too.
	
	*goto graduate
#Me and some other orphans started a gang 
	*If orphan true
	(Streets+) Now that's what I like to hear! You'll definitely go far in this life.

	*goto gang
#I didn't need to be a criminal since I came from a wealthy family. Instead, I spent my time at high-class partys and schmoozing other wealthy people. 
	(Cops+) Spoiled much? But it don't matter none now. Lucky bastard.

	*goto rich life
```

---

<div class="post-metadata">

**Author:** ![EclecticEccentric](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/eclecticeccentric/32/112816_2.png) [@EclecticEccentric](https://forum.choiceofgames.com/u/EclecticEccentric)\
**Post date:** [June 25, 2018, 2:29am UTC](https://forum.choiceofgames.com/t/choice-locking-out/40324/2 "2018-06-25T02:29:02Z")

</div>

You can use the `*if` command before choices to hide or display a choice as you see fit:

```choicescript
*choice
    *if (stat>50)
        #Do this thing.
            *goto result

```

Or you could use the `*selectable_if` command which grays out the choice:

```choicescript
*choice
    *selectable_if (stat>50) #Do this thing.
        *goto result

```

> [@Tevin](#):
>
> ```choicescript
> rich life
> 
> ```

Also, spaces do not work in labels, so this part of your code will not work.

---

<div class="post-metadata">

**Author:** ![Hex](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/hex/32/98250_2.png) [@Hex](https://forum.choiceofgames.com/u/Hex)\
**Post date:** [June 25, 2018, 2:31am UTC](https://forum.choiceofgames.com/t/choice-locking-out/40324/3 "2018-06-25T02:31:41Z")

</div>

It might help to put page breaks before the the goto command. Keep an eye on the spacing between things. I usually have a blank one line gap between choices. For some reason the site format won’t let me show my own coding properly so, I can’t really give a proper example.

For more information:  
[http://choicescriptdev.wikia.com/wiki/Category:Tutorials](http://choicescriptdev.wikia.com/wiki/Category:Tutorials)

---

<div class="post-metadata">

**Author:** ![Tevin](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/tevin/32/99011_2.png) [@Tevin](https://forum.choiceofgames.com/u/Tevin)\
**Post date:** [June 25, 2018, 2:31am UTC](https://forum.choiceofgames.com/t/choice-locking-out/40324/4 "2018-06-25T02:31:52Z")

</div>

Thank you very, very much. I was extremely stressed out, I very much appreciate this. I’m sorry for wasting your time with this, thank you.

---

<div class="post-metadata">

**Author:** ![Tevin](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/tevin/32/99011_2.png) [@Tevin](https://forum.choiceofgames.com/u/Tevin)\
**Post date:** [June 25, 2018, 2:34am UTC](https://forum.choiceofgames.com/t/choice-locking-out/40324/5 "2018-06-25T02:34:46Z")

</div>

Actually, I did see your example before you edited it.Thanks. Also, should I mark this as solved now?

---

<div class="post-metadata">

**Author:** ![Hex](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/hex/32/98250_2.png) [@Hex](https://forum.choiceofgames.com/u/Hex)\
**Post date:** [June 25, 2018, 2:36am UTC](https://forum.choiceofgames.com/t/choice-locking-out/40324/6 "2018-06-25T02:36:16Z")

</div>

You can, if you want. But I strongly recommend saving that link to the site explanation. It’s far from a perfectly clear account, but it’s very useful to have as a frame of reference.

---

<div class="post-metadata">

**Author:** ![Tevin](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/tevin/32/99011_2.png) [@Tevin](https://forum.choiceofgames.com/u/Tevin)\
**Post date:** [June 25, 2018, 2:44am UTC](https://forum.choiceofgames.com/t/choice-locking-out/40324/7 "2018-06-25T02:44:34Z")

</div>

I had no idea there was even a wiki. i wrote 12,740 words before I had to stop without knowing that. I have a feeling I’m going to have to start again.

---

<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:** [June 25, 2018, 3:02am UTC](https://forum.choiceofgames.com/t/choice-locking-out/40324/8 "2018-06-25T03:02:25Z")

</div>

Well, there’s a saying, “The starting place is a place for doing mistakes,” or something.  
`¯\_(ツ)_/¯`

---

<div class="post-metadata">

**Author:** ![Vendetta](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/vendetta/32/533_2.png) [@Vendetta](https://forum.choiceofgames.com/u/Vendetta)\
**Post date:** [June 25, 2018, 7:21am UTC](https://forum.choiceofgames.com/t/choice-locking-out/40324/9 "2018-06-25T07:21:07Z")

</div>

The best place to start [is here](https://forum.choiceofgames.com/t/master-list-links-for-beginners/21872).

While you’re still in the teething stages you should consider downloading and checking out [CSIDE](https://forum.choiceofgames.com/t/cside-the-choicescript-ide/27622). It has some built-in beginner tutorials and example code for precisely the sort of thing you’re still trying to figure out for yourself, as well as lots of other handy features. For instance (with the right setting turned on) double-clicking a command line in your code will automatically launch your default browser (or open a new tab) and take you straight to the Wiki page for that particular command.

---

<div class="post-metadata">

**Author:** ![Tevin](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/tevin/32/99011_2.png) [@Tevin](https://forum.choiceofgames.com/u/Tevin)\
**Post date:** [June 25, 2018, 7:23am UTC](https://forum.choiceofgames.com/t/choice-locking-out/40324/10 "2018-06-25T07:23:13Z")

</div>

Thank you.

You’re name is quite coincidental. I was just thinking about Def jam: Vendetta when you commented.
