How to Code This

Hey guys! I have some questions about coding! I’ve seen in a couple stories very interesting things I would like to incorporate into my story like:

In “The Undead” by Azalea, when a choice is given after you’ve clicked it and come back to the choices, the one you chose has been locked because you already chose it. And if you try clicking it, a narrator message would like pop up saying “You’ve already talked to this person.” or, “You already did this” etc.

For me, and my limited knowledge, I thought the only way to lock a choice was to erase everything inside the bracket. So, how then does it get coded in a way where it remembers what the user already chose/did. If I use gain flags, would i have to continuously, copy & paste the same choice code and just edit or… idk how to explain myself :laughing:

I’ve seen the overlay one coded in “The Shadows” by Christina Marie
Another question is how to limit what the user can choose. Like, with overlays, if i place 5 items on the screen how do i only allow them to choose 2 out of the 5? or with choices, if i present them with 5 choices to gain info but only want them to be allowed to choose 2…

sooo many questions :star_struck: I’ve been obssessed with Sci-Fi stories lately haha!

Here you can find answers for your questions.

plus if you want to lock by using <LOCKED> command it would be probably something like this. (it shows lock also and i think choice is grey if i remember correctly)

label choice_1

NARR
Text you want to put here.
choice
<LOCKED>“Locked choice.” {
NARR
This choice is locked, try a different one.
goto choice_1
}
“Normal choice.” {
##whatever you want to put into this choice
}

1 Like

I should have looked here earlier… :sweat_smile: Thank you!

1 Like

Okay so I tested out the code, it’s great but not what I was looking for :frowning:

First, when I click the choice and it goes back to main_choice, the choice that was tapped on disappeared. But what I want is, that after they have selected the choice it becomes locked.

so like…

label main_menu

NARR
What do you want to know?

choice
"What is 2 + 2?" {

NARR
4.

} "Done" {

goto done_choosing

}

label done_choosing

Story continues...

Now in this example what I want is the reader to go back to the choices BUT be unable to choose “What is 2 + 2?” again because now it has been locked AFTER they had already tapped that choice. I still want the option to show but be locked… not just disappear…

in the code example you provided the choice is already locked from the beginning… does that make sense? :pleading_face:

idk if I understood you correctly, but try this then:

INT. BLACK

label main_menu

if (answer_1) {
NARR
What do you want to know?

choice
<LOCKED>“What is 2 + 2?” {
NARR
You already picked that choice.

goto main_menu
} “Done” {

goto done_choosing

}
}
else {
NARR
What do you want to know?

choice
“What is 2 + 2?” {
gain answer_1
NARR
4.
goto main_menu
} “Done” {

goto done_choosing

}
}

label done_choosing
NARR
Story continues…

1 Like

You would probably have to create multiple labels with choices of the same choice, only every different label except for the original one has a choice locked. Then you use gains to redirect them to the label with the choices where the specific one they chose is locked.

I can imagine it’s a lot of coding, though. So I wouldn’t recommend it for more than 3-4 options? :sweat_smile:

1 Like

You can either use points or gains to track locking choices. For each choice you have a locked and unlocked option. You can see examples of the points option, called “Counting Wrong Guesses” and the gain option, called “Locking Choices” in my testing story:
http://episodeinteractive.com/s/4956454320537600

Code for using points:
INT. WALKINCLOSET2 - DAY
@HERO =0
@COUNT =0
@CARTER =0
@REMI =0
label suspect_choice
        NARRATOR
    Okay then, who do you think did it?
choice
"The weaselly guy in red." if (CARTER=0){
@COUNT +1
@CARTER +1
        NARRATOR
    No, wrong, try again.
goto suspect_choice
}
<LOCKED>"The weaselly guy in red." if (CARTER>0){
goto suspect_choice
}
"The girl in the flower dress." if (REMI=0){
@COUNT +1
@REMI +1
        NARRATOR
    No, wrong, try again.
goto suspect_choice
}
<LOCKED>"The girl in the flower dress." if (REMI>0){
goto suspect_choice
}
"The mysterious stranger."{
@COUNT +1
        NARRATOR
    Well duh, so obvious!
goto end_suspect_choice
}

label end_suspect_choice
if (COUNT = 1){
@HERO +2
readerMessage +2 hero points!!!
        NARRATOR
    That was excellent!
}
elif (COUNT = 2){
@HERO +1
readerMessage +1 hero point.
        NARRATOR
    That was okay... I guess.
}
else{
readerMessage That was so bad, I can't even look at you right now.
        NARRATOR
    That was just awful.
}
Code for using gains:
EXT. ABBEY GARDEN - DAY
@zoom reset
@CHARACTER stands screen center
label character_pose
        NARRATOR
    Lets strike a pose. We can't move on until you've tried everything.
choice
"Flirt" if (NOT POSE_FLIRT){
@CHARACTER starts flirt_shy
@pause for 1
gain POSE_FLIRT
}
<LOCKED> "Flirt" if (POSE_FLIRT){}
"Angry" if (NOT POSE_ANGRY){
@CHARACTER starts idle_handsonhips_angry_loop
@pause for 1
gain POSE_ANGRY
}
<LOCKED> "Angry" if (POSE_ANGRY){}
"Happy" if (NOT POSE_HAPPY){
@CHARACTER starts idle_happy_pose
@pause for 1
gain POSE_HAPPY
}
<LOCKED> "Happy" if (POSE_HAPPY){}
"Continue" if (POSE_FLIRT and POSE_ANGRY and POSE_HAPPY){
        NARRATOR
    I think we've been at this long enough. Let's move on with the story
goto story_continue
}
goto character_pose

label story_continue
@pause for 1
#Continue story here.
1 Like

You’re so funny in your coding :joy: “I can’t even look at you right now” :rofl::rofl:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.