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.
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
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
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.
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.