Inhibitors - a way to reverse gains

Something that’s a massive pain in Episode coding is that you can gain but you can’t lose .
If you, like me, want to make a story that you can repeat and make different choices, but you use gains to keep track of these choices, it’s really irritating.

I’ve been using this solution, which I’m going to call gaining inhibitors. It’s a bit clunky, and I think the best approach is probably just using goto instead of gain to avoid the problem completely, but maybe there are situations where that isn’t ideal. In that situation, you could use this instead!

label colour_choice
#this bit will allow you to move on once you’ve tried all the colours
if (red_finished and blue_finished and green_finished){
goto end
}else{
}

NARRATOR
Pick a colour!
choice “Red”{

if (red_finished){
You have already done this path!
goto colour_choice
}else{
gain red
}

}“Blue”{

if (blue_finished){
You have already done this path!
goto colour_choice
}else{
gain blue
}

}“Green”{

if (green_finished){
You have already done this path!
goto colour_choice
}else{
gain green
}

}

#this part directs you to the paths, by first checking for a colour and then checking if the colour is active or if you’ve done it already
if (red){
if (red and red_finished){
}else{
goto red
}
}elif (blue){
if (blue and blue_finished){
}else{
goto blue
}
}elif (green){
if (green and green_finished){
}else{
goto green
}
}

label red
NARRATOR
The red path goes here
gain red_finished
goto colour_choice

label blue
NARRATOR
The blue path goes here
gain blue_finished
goto colour_choice

label green
NARRATOR
The green path goes here
gain green_finished
goto colour_choice

label end
NARRATOR
This is the end of the story! You can only get here after making all 3 colour choices.

The inhibitors are the red_finished, blue_finished and green_finished tags, which are used to override the origianal red, blue and green tags. Even though just totally separating the paths with one “goto” and no convergence is much cleaner, this could maybe help if you’re coming up close to the character limit and need to streamline by adding convergence.

To be honest, I like sealing off previously chosen choices anyway, so even if I did just use a goto I would still add a gain at the end of each path which blocks you from replaying it.

Hope this helps someone!

5 Likes

bookmarked!

1 Like

When I want readers to gain and lose, I use points instead of gains.

2 Likes

It actually had a mistake in it but hopefully it’s fixed now!

Thanks! I might look into that too, I didn’t think of that

1 Like

that’s a good idea! another way I like to do this is by stating the negative (this basically only shows options for which a certain flag has not been gained). it would look something like this…

    NARR
Let's play a game...

label choose_color

if (RED and BLUE and GREEN) {

    NARR
You picked all the colors. Thanks for playing!

} else {

}

    NARR
Pick a color!

choice
“Red” if ([NOT RED]) {
gain RED

    NARR
You picked red.

goto choose_color

} “Blue” if ([NOT BLUE]) {
gain BLUE

    NARR
You picked blue.

goto choose_color

} “Green” if ([NOT GREEN]) {
gain GREEN

    NARR
You picked green.

goto choose_color

}

    NARR
The end.
1 Like

Ah thanks! that’s also helpful, I might use this.

1 Like

Bump!

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