# Help with option creation!

**URL:** <https://forum.choiceofgames.com/t/help-with-option-creation/17809>\
**Category:** Game Development\
**Created:** [May 28, 2016, 3:36am UTC](https://forum.choiceofgames.com/t/help-with-option-creation/17809 "2016-05-28T03:36:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elite](https://avatars.discourse-cdn.com/v4/letter/e/6f9a4e/32.png) [@Elite](https://forum.choiceofgames.com/u/Elite)\
**Post date:** [May 28, 2016, 3:36am UTC](https://forum.choiceofgames.com/t/help-with-option-creation/17809/1 "2016-05-28T03:36:00Z")

</div>

I’m trying to write some introductions, but when the PC might already know one of said characters, it’s difficult and I don’t actually know how to write it. I tried to make the game list different options depending on who you chose as an RO or even if you chose an RO. This is what I wrote, but it doesn’t seem like it works. Hopefully, this helps clarify what I’m trying to do.

Who do you want to get to know?

```
	*choice
		*if (Relationship_i) #%{relationship}, I already know them and we're dating.
		*if (Relationship_i)
			*if (Relationship="Mark")
				#Jess
					*goto Jess
				#Reed
					*goto Reed
			*if (Relationship="Jess")
				#Mark
					*goto Mark
				#Reed
					*goto Reed
			*if (Relationship="Reed")
				#Mark
					*goto Mark
				#Jess
					*goto Jess
		*else
			#Mark
				*label Mark
				*finish
			#Reed
				*label Reed
				*finish
			#Jess
				*label Jess
				*finish

```

Legend:  
Relationship: Who you are in a relationship with.  
Relationship\_i: Detects whether you are in a relationship or not.  
Mark, Reed, and Jess: The ROs.

---

<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:** [May 28, 2016, 4:46am UTC](https://forum.choiceofgames.com/t/help-with-option-creation/17809/2 "2016-05-28T04:46:00Z")

</div>

I am sure someone better can solve this for you but I will give it a go, of course this is one of many ways I could handles this but hope it helps.  
So we have Jess and Mark and lets say Susan

```
*create mark false
*create jess false
*create sussan false

During the story we dated Susan
*set susan true

You walk up on a small group gathered around the punch bowl.
*line_break
*gosub relation_check
*goto the_rest_of_the_story

*label relation_check
*if (mark)
 "Hey Mark." 
 *return
*if (jess)
 "Hey Jess"
 *return
*if (susan)
 "You still mad at me Susan?"
 *return
```

---

<div class="post-metadata">

**Author:** ![Sashira](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/sashira/32/2899_2.png) [@Sashira](https://forum.choiceofgames.com/u/Sashira)\
**Post date:** [May 28, 2016, 6:48am UTC](https://forum.choiceofgames.com/t/help-with-option-creation/17809/3 "2016-05-28T06:48:38Z")

</div>

The label and the finish after the \*else are what’s breaking your code. \*finish goes only at the end of a scene; \*label is what a \*goto lands at. Normally a \*goto after the other commands in an \*else would be what you’d want. However, you can’t have \*else commands in choice options, so you need to find a way to restate it as an \*if statement. In this case:  
`*if not (Relationship_i)`

You don’t actually need a Relationship\_i variable, though, unless you’re using it for something more complicated down the road. When you created the variable relationship, you had to set it something, like “none”. So you can use:  
`*if relationship="none"`  
`*if relationship!="none"`  
to determine whether there is a first/any partner.

Also, you could omit the need for the repetition in the else statement by hiding only the options for current ROs. Like this:  
`*if relationship!="Mark" #Mark *goto Mark`  
(except spaced right, the forum software is messing with me.)

So in full, that’s four options total:  
`Who do you want to get to know? *choice *if relationship!="none" #${relationship.}, I already know them and we're dating. *goto romantic_talk *if relationship!="Mark" #Mark *goto mark *if relationship!="Jess" #Jess *goto jess *if relationship!="Susan" #Susan *goto susan`

---

<div class="post-metadata">

**Author:** ![Elite](https://avatars.discourse-cdn.com/v4/letter/e/6f9a4e/32.png) [@Elite](https://forum.choiceofgames.com/u/Elite)\
**Post date:** [May 28, 2016, 8:05am UTC](https://forum.choiceofgames.com/t/help-with-option-creation/17809/4 "2016-05-28T08:05:27Z")

</div>

I tried taking out the else statement and using the Relationship=“None” suggestion, but the real problem is getting the options to show. I’m trying to make it so that if you are in a relationship with one of the three, they don’t show up as an option and instead show up in the \*if Relationship\_i=true option. If it helps, here is the error message I’m getting: It is illegal to fall out of a \*choice statement; you must \*goto or \*finish before the end of the indented block. I get that after the \*if (relationship=“Mark”) command.

---

<div class="post-metadata">

**Author:** ![m3ales](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/m3ales/32/12528_2.png) [@m3ales](https://forum.choiceofgames.com/u/m3ales)\
**Post date:** [May 28, 2016, 8:27am UTC](https://forum.choiceofgames.com/t/help-with-option-creation/17809/5 "2016-05-28T08:27:31Z")

</div>

It’s got to do with how you’ve handled the first if. Logically choicescript doesn’t understand why you have two duplicate if blocks on the same indentation.

```
*create Relationship_i true
*create Relationship "Jess"
*choice
        *if (Relationship_i)
            #${Relationship}, I already know them and we're dating.
                I'm already dating ${Relationship}
                
                
                *goto ${Relationship}
            *if (Relationship="Mark")
                #Jess
                    *goto Jess
                #Reed
                    *goto Reed
            *if (Relationship="Jess")
                #Mark
                    *goto Mark
                #Reed
                    *goto Reed
            *if (Relationship="Reed")
                #Mark
                    *goto Mark
                #Jess
                    *goto Jess
        *else
            #Mark
                *label Mark
                Mark
                *finish
            #Reed
                *label Reed
                Reed
                *finish
            #Jess
                *label Jess
                Jess
                *finish

```

This works for me. (I’ve just added a few debug statements to check it was working)

EDIT: Actually I think it’s probably the fact that you didnt have a \*goto in your first if statement. So you could fix it by just adding a goto to your first if, but I think it’s a better idea to have it all under one if.

---

<div class="post-metadata">

**Author:** ![Wraith](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/wraith/32/241294_2.png) [@Wraith](https://forum.choiceofgames.com/u/Wraith)\
**Post date:** [May 28, 2016, 8:30am UTC](https://forum.choiceofgames.com/t/help-with-option-creation/17809/6 "2016-05-28T08:30:21Z")

</div>

Relationships can sometimes be tricky. I try my luck ~

`*if (Relationship_i) #${relationship}, I already know them and we're dating.
*fake_choice
    *if Relationship_i
        *if (Relationship = "Mark")
            #Jess
                *goto Jess
            #Reed
                *goto Reed
        *if (Relationship = "Jess")
            #Mark
                *goto Mark
            #Reed
                *goto Reed
        *if (Relationship = "Reed")
            #Mark
                *goto Mark
            #Jess
                *goto Jess
    *if (((Relationship != "Mark") and (Relationship != "Jess")) and (Relationship != "Reed"))
        #Mark
            *label Mark
            *finish
        #Reed
            *label Reed
            *finish
        #Jess
            *label Jess
            *finish`

I think that the second one should work… if not, tell me and I’ll try again.

---

<div class="post-metadata">

**Author:** ![Elite](https://avatars.discourse-cdn.com/v4/letter/e/6f9a4e/32.png) [@Elite](https://forum.choiceofgames.com/u/Elite)\
**Post date:** [May 28, 2016, 8:39am UTC](https://forum.choiceofgames.com/t/help-with-option-creation/17809/7 "2016-05-28T08:39:44Z")

</div>

@m3ales’ one worked, but I did test this one and quicktest said it expected an option instead of a fake\_choice.

---

<div class="post-metadata">

**Author:** ![Elite](https://avatars.discourse-cdn.com/v4/letter/e/6f9a4e/32.png) [@Elite](https://forum.choiceofgames.com/u/Elite)\
**Post date:** [May 28, 2016, 8:50am UTC](https://forum.choiceofgames.com/t/help-with-option-creation/17809/8 "2016-05-28T08:50:12Z")

</div>

This one worked, thanks so much, this pissed me off a lot. 😅
