Error in IF loop - gain doesn't work

Hi everybody,

Just asking some help in my if loop in the greek pool background.
I’ve the same code for another choice and it worked perfectly but for this one it doesn’t and I can’t figure it out.

In the first original choice, there’s 3 possible locations.
The script below occurs when you click you first click on the location “swimming pool”, then you gain swimming_1.

My problem is, the if loop doesn’t “activate” at all and makes the story go directly to the appartment scene.
In case, the swimming pool is the first location selected, my choice inside the if loop should occur.

Any idea ?
If you need the full script please let me know
Thanks again :kissing_closed_eyes:

FIRST CHOICE ON LOCATION
label where_is_ryan

@speechbubble is 178 314 to 100% with tail_top_left
SARA (think_rubchin)
(And now where can I find him or where can I find information about where he is ?)

choice
“Saint John’s hospital” {

@speechbubble is 178 314 to 100% with tail_top_left
SARA (think_rubchin)
(Hopefully he’s working)
SARA (talk_sad_exhausted)
(In the worse case scenario I can ask Greg or even mom)
(I don’t like this idea though)

choice
“Let’s try it” {

@transition fade out white in 2.0

goto label hospital_firstchoice
gain HOSPITAL_FIRSTCHOICE

} “Let me think about the others options” {

goto label where_is_ryan

}

} “Swimming club” {

    SARA (think_rubchin)
(Maybe he's preparing tomorrow training)

@pause for a beat
SARA (idle_awkward_scratch_loop)
(Normally I have to rest today)
(If Peter sees me there, he’s going to kill me)
(But I can try)

choice
“Let’s try it” {

sound off
@transition fade out white in 2.0
goto label swimming_firstchoice
gain swimming_1

} “Let me think about the others options” {

goto label where_is_ryan

}

} “His appartment” {
SARA (think_rubchin)
(It’s the last place I can think of)
(If he’s not there I can ask his roomie)
SARA (idle_awkward_scratch_loop)
(Let’s hope his girlfriend is not there)
SARA (talk_sad_exhausted)
(This woman is very scary when she’s angry)

choice
“Let’s try it” {
sound off
@transition fade out white in 2.0
goto label appartment_choice
gain appartment_firstchoice

} “Let me think about the others options” {

goto label where_is_ryan

}

}

EXT. GREEK GAMES POOLSIDE - DAY with effect LIGHT SNOW

&zoom reset

&COACH PETER spot 1.292 229 66 in zone 1 AND COACH PETER faces right AND COACH PETER is callout_neutral
&SARA spot 1.251 -150 50 in zone 1 at layer 0
@transition fade in white in 4.0

@speechbubble is 172 298 to 100%
NARRATOR
|italic| Seems like Peter gives a swimming lesson ?

&COACH PETER is callout_neutral
@SARA walks to spot 1.251 90 50 in 2.0 AND SARA does it while walk_worried_loop

@speechbubble is 172 298 to 100% with tail_top_left
SARA (talk_unsure)
Hi Peter
&COACH PETER is react_startled_surprised AND SARA is idle_awkward_scratch_loop
@pause for a beat
&COACH PETER faces left

@speechbubble is 172 298 to 100% with tail_top_right
COACH PETER (talk_startled_neutral)
Sarah ? What are you doing here ?
COACH PETER (talk_armscrossed_angry_loop)
You’re supposed to rest today
&COACH PETER is idle_armscrossed_angry_loop

@speechbubble is 172 298 to 100% with tail_top_left
SARA (talk_awkward_loop)
Yeah yeah I remember but I’m not here to swim
&COACH PETER is idle_armscrossed_neutral_loop
SARA (talk_unsure)
I’m here because of Ryan

@speechbubble is 172 298 to 100% with tail_top_right
COACH PETER (talk_shrug_concerned)
Is there something wrong with him ?

@speechbubble is 172 298 to 100% with tail_top_left
SARA (talk_awkward_loop)
I heard he resigned from university
&SARA is idle_awkward_scratch_loop

@speechbubble is 172 298 to 100% with tail_top_right
COACH PETER (talk_startled_neutral)
Really ?
COACH PETER (talk_shrug_concerned)
How come ? I didn’t know

@speechbubble is 172 298 to 100% with tail_top_left
SARA (idle_awkward_scratch_loop)
(Crap)
SARA (talk_unsure)
Do you know if he’s going to resign here as well ?
&SARA is idle_awkward_scratch_loop
@speechbubble is 172 298 to 100% with tail_top_right
COACH PETER (talk_think_neutral)
That’s a good question
COACH PETER (talk_shrug_neutral)
Next time I see him I’ll have a word with him
COACH PETER (talk_doubtful)
Don’t be too happy about it

@speechbubble is 172 298 to 100% with tail_top_left
SARA (talk_unsure)
Yeah, um I need to go

if (swimming_1) {

@speechbubble is 172 298 to 100% with tail_top_left
SARA (talk_unsure)
(But where ?)

choice
“Saint John’s hospital” {

&COACH PETER is think_rubchin
@SARA walks to spot 1.251 -150 50 in 2.0 AND SARA does it while walk_sad_loop
@transition fade out white in 2.0
goto label hospital_firstchoice
gain hospital_secondchoice

}“Ryan’s appartment”{

&COACH PETER is think_rubchin
@SARA walks to spot 1.251 -150 50 in 2.0 AND SARA does it while walk_sad_loop
@transition fade out white in 2.0
goto label appartment_choice
gain swimming_secondchoice

}

} else {

&COACH PETER is think_rubchin
@SARA walks to spot 1.251 -150 50 in 2.0 AND SARA does it while walk_sad_loop
@transition fade out white in 2.0

goto label appartment_choice

}

The template ?

Le ven. 4 janv. 2019 à 17:08, Kayla episodeinteractive@discoursemail.com a écrit :

You need to use gain first THEN goto label also, goto can’t contain label just a name
So it should be:

gain HOSPITAL_FIRSTCHOICE
goto hospital_firstchoice

applies to others as well, you didn’t gain any flags because it was skipping gain because it was going to the label straight away

AAAAAAAH god ! It was driving me nuts XD

Thank you so much !

Le ven. 4 janv. 2019 à 18:13, Apes episodeinteractive@discoursemail.com a écrit :

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