# How to fix mini-game

Hey, I’m a new episode creator, and I am working on my first project! I wrote this script to work for the mini game I put in my story, but there’s something wrong with the way it runs when I do a play through during one kind of scenario. I have been googling different things, but haven’t found anything that really seemed to help, or even make sense… I was wondering if someone might know about this and how to fix this problem… So, first run through, I checked to see if the outcome of getting the wrong numbers, or a wrong number, would trigger the goto the beginning… and it did, it worked perfectly fine. I did another run through and tried it while getting all the numbers right, and the outcome worked perfectly fine. I did a run through while getting the wrong numbers the first round, then getting the right numbers the second round… and it gave me the wrong numbers outcome the second round as well as the first… I’m not quite sure how to fix this problem, I’m kind of just learning as I go… but I’m sure there’s probably a simple solution, I just don’t know what it would be lol…

Here is the code:

label lockergame

@overlay 5764771250438144_LOCK rotates 360 anchor point 0.5 0.5 in 3
NARRATOR
| bold , color:red |Try to open your locker using your locker combination
| bold | What is the first number in the sequence?

choice [timed:top:5:10]
“21”{

gain WRONG_NUMBER
}“11”{

gain RIGHT_NUMBER
}“10”{

gain WRONG_NUMBER
}

@overlay 5764771250438144_LOCK rotates 180 anchor point 0.5 0.5 in 3

``````    NARRATOR
| bold | What is the second number?
``````

choice [timed:top:5:8]
“0”{

gain RIGHT_NUMBER
}“10”{

gain WRONG_NUMBER
}“8”{

gain WRONG_NUMBER
}

@overlay 5764771250438144_LOCK rotates 90 anchor point 0.5 0.5 in 3

``````    NARRATOR
| bold | The third?
``````

choice [timed:top:5:7]
“7”{

gain WRONG_NUMBER
}“25”{

gain WRONG_NUMBER
}“27”{

gain RIGHT_NUMBER
}

@overlay 5764771250438144_LOCK rotates 180 anchor point 0.5 0.5 in 3

``````    NARRATOR
| bold | And the last?
``````

choice [timed:top:5:15]
“25”{

gain WRONG_NUMBER
}“15”{

gain WRONG_NUMBER
}“5”{

gain RIGHT_NUMBER
}

@overlay 5764771250438144_LOCK rotates 360 anchor point 0.5 0.5 in 3

if (WRONG_NUMBER){

``````    NARRATOR
| bold, color:red | Oops!
| bold, color:red | Try again...
``````

goto lockergame
}

if (RIGHT_NUMBER){

EXT. BLUE - DAY with OPEN LOCKER

@overlay 5764771250438144_OPEN LOCKER shifts to -169 -15 in zone 1
@overlay 5764771250438144_OPEN LOCKER scales to 3.787 3.787

``````    NARRATOR (ADORA)
Sweet! I got it!
``````

}

If you could solve this for me, I would be forever greatful! Thank you!

2 Likes
1 Like

Make a character named LOCKER and then try using this code:

label lockergame
@LOCKER =0
@overlay 5764771250438144_LOCK rotates 360 anchor point 0.5 0.5 in 3

NARRATOR
| bold , color:red |Try to open your locker using your locker combination.
| bold | What is the first number in the sequence?

choice [timed:top:5:10]
“21”{
}“11”{
@LOCKER +1
}“10”{
}

@overlay 5764771250438144_LOCK rotates 180 anchor point 0.5 0.5 in 3

``````    NARRATOR
| bold | What is the second number?
``````

choice [timed:top:5:8]
“0”{
@LOCKER +1
}“10”{
}“8”{
}

@overlay 5764771250438144_LOCK rotates 90 anchor point 0.5 0.5 in 3

``````    NARRATOR
| bold | The third?
``````

choice [timed:top:5:7]
“7”{
}“25”{
}“27”{
@LOCKER +1
}

@overlay 5764771250438144_LOCK rotates 180 anchor point 0.5 0.5 in 3

``````    NARRATOR
| bold | And the last?
``````

choice [timed:top:5:15]
“25”{
}“15”{
}“5”{
@LOCKER +1
}

@overlay 5764771250438144_LOCK rotates 360 anchor point 0.5 0.5 in 3

if (LOCKER=4){
EXT. BLUE - DAY with OPEN LOCKER

@overlay 5764771250438144_OPEN LOCKER shifts to -169 -15 in zone 1
@overlay 5764771250438144_OPEN LOCKER scales to 3.787 3.787

``````    NARRATOR (ADORA)
Sweet! I got it!
``````

} else {

``````    NARRATOR
| bold, color:red | Oops!
| bold, color:red | Try again...
``````

goto lockergame
}

2 Likes

YES! This worked! Thank you so much! <3

1 Like

if you want to use gains you would need to name every single gain differently. The problem of your coding was that you used the same gain multiple times.

But when you gain something it cant be ungained… the app will remember the gain till the end of the story.

The way you have it reader can easily got both gains which will then mix up the end result.

Points are more suitable for this and I see you hot the solution with them already.

I just wanted to explain what was the problem.

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