Branching not working properly


#1

I’m having trouble with something at the moment, i’m trying to create a test mini-game for my story but i’m having some problems with it.

I don’t know if i did the coding wrong but for some reason it skips a fraction of questions

Here are some of the questions affected:

(Question 2 skips the wrong choice)

if (Q2 is “Ask them how their day”) {
readerMessage You answered incorrectly
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (talk_repulsed)
(What kind of answer was that!?)

} elif (Q2 is “Ask them if they have a lung condition or asthma”) {
readerMessage You got a point for picking the correct answer
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (idle_happy)
(I knew that!)
ADRIAN +1

(Question 7 completely skips over)

if (Q7 is “Check their airways”) {
readerMessage You got a point for picking the correct answer
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (laugh_giggle)
(Sweet!)
ADRIAN +1

} elif (Q7 is “Check their heartbeat”) {
readerMessage You answered incorrectly
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (arms_crossed_angry)
(God darn it!)

The others work fine, can anyone help me out here?


#2

So I’ve would need to see your full codes for these and for the choice code. If you could provide a screenshot of your script that would be greats.


#3

Here’s the full script, i don’t actually know how to take a screenshot on the computer

INT. CLASSROOM DESK - DAY
music music_atwork
@ADRIAN changes into ADRIAN_derp
@ADRIAN spot 1.275 81 -47
@ADRIAN faces right
@ZOEY changes into ZOEY_casual
@ZOEY spot 1.280 270 -36
@ZOEY faces right
@ZOEY starts write_notepad
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (think)
(What do you do when you see a person who is unconscious, showing double vision, vomiting or other signs?)
choice (Q1)
“Call an ambulance” {
@ADRIAN is write_notepad AND ZOEY is write_notepad

} “Just leave them” {
@ADRIAN is write_notepad AND ZOEY is write_notepad
}

@ZOEY starts write_notepad
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (think)
(If you see a person who is conscious, what do you do?)
choice (Q2)
“Ask them how their day is” {
@ADRIAN is write_notepad AND ZOEY is write_notepad

} “Ask them if they have a lung condition or asthma” {
@ADRIAN is write_notepad AND ZOEY is write_notepad
}

@ZOEY starts write_notepad
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (think)
(Why should you place the person down on their side?)
choice (Q3)
“So they can get a good night sleep” {
@ADRIAN is write_notepad AND ZOEY is write_notepad

} “So they don’t choke on vomit and phlegm” {
@ADRIAN is write_notepad AND ZOEY is write_notepad
}

@ZOEY starts write_notepad
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (think)
(What should you do when the person is not breathing?)
choice (Q4)
“Perform CPR” {
@ADRIAN is write_notepad AND ZOEY is write_notepad

} “Just stand still and scream the shit out of you” {
@ADRIAN is write_notepad AND ZOEY is write_notepad
}

@ZOEY starts write_notepad
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (think)
(What condition does the person show if they have signs of pale and clammy skin, weakness, glazed eyes or other signs?)
choice (Q5)
“Heart Attack” {
@ADRIAN is write_notepad AND ZOEY is write_notepad

} “Shock” {
@ADRIAN is write_notepad AND ZOEY is write_notepad
}

@ZOEY starts write_notepad
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (think)
(When the person is taken to the hospital, what will the nurses do?)
choice (Q6)
“They are examined for smoke inhalation” {
@ADRIAN is write_notepad AND ZOEY is write_notepad

} “They are just given antibiotics” {
@ADRIAN is write_notepad AND ZOEY is write_notepad
}

@ZOEY starts write_notepad
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (think)
(What will the doctor do when exanimating the person?)
choice (Q7)
“Check for airways” {
@ADRIAN is write_notepad AND ZOEY is write_notepad

} “Check their heartbeat” {
@ADRIAN is write_notepad AND ZOEY is write_notepad
}

@ZOEY starts write_notepad
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (think)
(What will happen to the person afterwards?)
choice (Q8)
“May be hospitalized or be given antibiotics or bronchodilator” {
@ADRIAN is write_notepad AND ZOEY is write_notepad

} “Give them an EpiPen” {
@ADRIAN is write_notepad AND ZOEY is write_notepad
}

@ZOEY starts write_notepad
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (talk_exclaim_yes)
That’s all the questions!
music off
@transition iris out black 2

INT. CLASSROOM BLACKBOARD - DAY with PODIUM
@MRS APPLEBERRY changes into MRS APPLEBERRY_red
@MRS APPLEBERRY spot 1.302 160 0
@MRS APPLEBERRY faces left
@MRS APPLEBERRY is think
sound callbell
@speechbubble is 103 283 to 91% with tail_top_right
MRS APPLEBERRY (talk_call_out)
Times up!
@MRS APPLEBERRY is shiftweight
MRS APPLEBERRY (talk_neutral)
Let’s go over the results…
MRS APPLEBERRY (talk_read_paper)
First off, What do you do when you see a person who is unconscious, showing double vision, vomiting or other signs?
MRS APPLEBERRY (talk_shrug)
Obviously you would call an ambulance
MRS APPLEBERRY (talk_doubtful)
You don’t want them to die do you?

INT. CLASSROOM DESK - DAY
@ADRIAN changes into ADRIAN_derp
@ADRIAN spot 1.275 81 -47
@ADRIAN faces right
@ZOEY changes into ZOEY_casual
@ZOEY spot 1.280 270 -36
@ZOEY faces right
@ZOEY starts arms_crossed

if (Q1 is “Call an ambulance”) {
readerMessage You got a point for picking the correct answer
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (talk_exclaim_yes)
(Yes!)
@ADRIAN +1

} elif (Q1 is “Just leave them”) {
readerMessage You answered incorrectly
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (disappointed)
(Drat!)
}

INT. CLASSROOM BLACKBOARD - DAY with PODIUM
@MRS APPLEBERRY changes into MRS APPLEBERRY_red
@MRS APPLEBERRY spot 1.302 160 0
@MRS APPLEBERRY faces left
@speechbubble is 103 283 to 91% with tail_top_right
MRS APPLEBERRY (talk_read_paper)
Second question
MRS APPLEBERRY (talk_read_paper)
If you see a person who is conscious, what do you do?
MRS APPLEBERRY (talk_gesture)
You ask them if they have a lung condition or asthma
MRS APPLEBERRY (talk_angry_stubborn)
Smoke inhalation is a serial killer!
MRS APPLEBERRY (talk_contend)
People with lung conditions or asthma may suffer a worse death!
MRS APPLEBERRY (talk_arms_crossed_angry)
So check to see if the person’s inhaler is nearby!

INT. CLASSROOM DESK - DAY
@ADRIAN changes into ADRIAN_derp
@ADRIAN spot 1.275 81 -47
@ADRIAN faces right
@ZOEY changes into ZOEY_casual
@ZOEY spot 1.280 270 -36
@ZOEY faces right
@ZOEY starts arms_crossed

if (Q2 is “Ask them how their day”) {
readerMessage You answered incorrectly
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (talk_repulsed)
(What kind of answer was that!?)

} elif (Q2 is “Ask them if they have a lung condition or asthma”) {
readerMessage You got a point for picking the correct answer
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (idle_happy)
(I knew that!)
@ADRIAN +1
}

INT. CLASSROOM BLACKBOARD - DAY with PODIUM
@MRS APPLEBERRY changes into MRS APPLEBERRY_red
@MRS APPLEBERRY spot 1.302 160 0
@MRS APPLEBERRY faces left
@speechbubble is 103 283 to 91% with tail_top_right
MRS APPLEBERRY (talk_read_paper)
Question 3
MRS APPLEBERRY (talk_read_paper)
Why should you place the person down on their side?
MRS APPLEBERRY (talk_handsonhips)
It’s basically so they don’t choke on vomit and phlegm…
MRS APPLEBERRY (talk_repulsed)
Why the hell would a person with smoke inhalation get a good night sleep?

INT. CLASSROOM DESK - DAY
@ADRIAN changes into ADRIAN_derp
@ADRIAN spot 1.275 81 -47
@ADRIAN faces right
@ZOEY changes into ZOEY_casual
@ZOEY spot 1.280 270 -36
@ZOEY faces right
@ZOEY starts arms_crossed

if (Q3 is “So they can get a good night sleep”) {
readerMessage You answered incorrectly
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (idle_awkward)
(I don’t know)

} elif (Q3 is “So they don’t choke on vomit and phlegm”) {
readerMessage You got a point for picking the correct answer
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (eyeroll)
(Well duh!)
@ADRIAN +1
}

INT. CLASSROOM BLACKBOARD - DAY with PODIUM
@MRS APPLEBERRY changes into MRS APPLEBERRY_red
@MRS APPLEBERRY spot 1.302 160 0
@MRS APPLEBERRY faces left
@speechbubble is 103 283 to 91% with tail_top_right
MRS APPLEBERRY (talk_read_paper)
No. 4
MRS APPLEBERRY (talk_read_paper)
What should you do when the person is not breathing?
MRS APPLEBERRY (talk_neutral)
You perform CPR!
MRS APPLEBERRY (talk_mindblown)
Are you trying to scare people by screaming!?

INT. CLASSROOM DESK - DAY
@ADRIAN changes into ADRIAN_derp
@ADRIAN spot 1.275 81 -47
@ADRIAN faces right
@ZOEY changes into ZOEY_casual
@ZOEY spot 1.280 270 -36
@ZOEY faces right
@ZOEY starts arms_crossed

if (Q4 is “Perform CPR”) {
readerMessage You got a point for picking the correct answer
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (primp_condescend)
(No shit!)
@ADRIAN +1

} elif (Q4 is “Just stand still and scream the shit out of you”) {
readerMessage You answered incorrectly
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (talk_repulsed)
(Well I am a bit peakish when I see a dead body)
}

INT. CLASSROOM BLACKBOARD - DAY with PODIUM
readerMessage People that have watched Codename:Kids Next Door will get the reference
@MRS APPLEBERRY changes into MRS APPLEBERRY_red
@MRS APPLEBERRY spot 1.302 160 0
@MRS APPLEBERRY faces left
@speechbubble is 103 283 to 91% with tail_top_right
MRS APPLEBERRY (sing_warmup_loop)
Numbah 5!
MRS APPLEBERRY (talk_read_paper)
What condition does the person show if they have signs of pale and clammy skin, weakness, glazed eyes or other signs?
MRS APPLEBERRY (talk_shrug)
It’s obviously shock!
MRS APPLEBERRY (talk_think)
I don’t think heart attacks have the same signs as shock!

INT. CLASSROOM DESK - DAY
@ADRIAN changes into ADRIAN_derp
@ADRIAN spot 1.275 81 -47
@ADRIAN faces right
@ZOEY changes into ZOEY_casual
@ZOEY spot 1.280 270 -36
@ZOEY faces right
@ZOEY starts arms_crossed

if (Q5 is “Heart Attack”) {
readerMessage You answered incorrectly
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (idle_sad)
(So close!)

} elif (Q5 is “Shock”) {
readerMessage You got a point for picking the correct answer
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (flirt_fingersnap)
(BINGO!)
@ADRIAN +1
}

INT. CLASSROOM BLACKBOARD - DAY with PODIUM
@MRS APPLEBERRY changes into MRS APPLEBERRY_red
@MRS APPLEBERRY spot 1.302 160 0
@MRS APPLEBERRY faces left
@speechbubble is 103 283 to 91% with tail_top_right
MRS APPLEBERRY (talk_neutral)
Sixy Six!
MRS APPLEBERRY (talk_read_paper)
When the person is taken to the hospital, what will the nurses do?
MRS APPLEBERRY (talk_gesture)
They examine for smoke inhalation!
MRS APPLEBERRY (talk_repulsed)
What will antibiotics do!?

INT. CLASSROOM DESK - DAY
@ADRIAN changes into ADRIAN_derp
@ADRIAN spot 1.275 81 -47
@ADRIAN faces right
@ZOEY changes into ZOEY_casual
@ZOEY spot 1.280 270 -36
@ZOEY faces right
@ZOEY starts arms_crossed

if (Q6 is “They are examined for smoke inhalation”) {
readerMessage You got a point for picking the correct answer
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (idle_happy)
(Oh yeah!)
@ADRIAN +1

} elif (Q6 is “They are just given antibiotics”) {
readerMessage You answered incorrectly
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (frustrated)
(Agh!)
}

INT. CLASSROOM BLACKBOARD - DAY with PODIUM
@MRS APPLEBERRY changes into MRS APPLEBERRY_red
@MRS APPLEBERRY spot 1.302 160 0
@MRS APPLEBERRY faces left
@speechbubble is 103 283 to 91% with tail_top_right
MRS APPLEBERRY (talk_read_paper)
Lucky seven!
MRS APPLEBERRY (talk_read_paper)
What will the doctor do when exanimating the person?
MRS APPLEBERRY (talk_arms_crossed)
They check the airways!
MRS APPLEBERRY (talk_angry_arms_crossed)
The heart isn’t going to do anything!

INT. CLASSROOM DESK - DAY
@ADRIAN changes into ADRIAN_derp
@ADRIAN spot 1.275 81 -47
@ADRIAN faces right
@ZOEY changes into ZOEY_casual
@ZOEY spot 1.280 270 -36
@ZOEY faces right
@ZOEY starts arms_crossed

if (Q7 is “Check their airways”) {
readerMessage You got a point for picking the correct answer
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (laugh_giggle)
(Sweet!)
@ADRIAN +1

} elif (Q7 is “Check their heartbeat”) {
readerMessage You answered incorrectly
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (arms_crossed_angry)
(God dam it!)
}

INT. CLASSROOM BLACKBOARD - DAY with PODIUM
@MRS APPLEBERRY changes into MRS APPLEBERRY_red
@MRS APPLEBERRY spot 1.302 160 0
@MRS APPLEBERRY faces left
@speechbubble is 103 283 to 91% with tail_top_right
MRS APPLEBERRY (talk_read_paper)
Last question!
MRS APPLEBERRY (talk_read_paper)
What will happen to the person afterwards?
MRS APPLEBERRY (talk_contend)
They may be hospitalized or be given antibiotics or bronchodilator
MRS APPLEBERRY (talk_contend)
EpiPen is for people with allergies!

INT. CLASSROOM DESK - DAY
@ADRIAN changes into ADRIAN_derp
@ADRIAN spot 1.275 81 -47
@ADRIAN faces right
@ZOEY changes into ZOEY_casual
@ZOEY spot 1.280 270 -36
@ZOEY faces right
@ZOEY starts arms_crossed

if (Q8 is “May be hospitalized or be given antibiotics or bronchodilator”) {
readerMessage You got a point for picking the correct answer
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (talk_exclaim_yes)
(Woo Hoo!)
@ADRIAN +1

} elif (Q8 is “Give them an EpiPen”) {
readerMessage You answered incorrectly
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (idle_exhausted)
(I suck at this!)
}

INT. CLASSROOM BLACKBOARD - DAY with PODIUM
@MRS APPLEBERRY changes into MRS APPLEBERRY_red
@MRS APPLEBERRY spot 1.302 160 0
@MRS APPLEBERRY faces left
@speechbubble is 103 283 to 91% with tail_top_right
MRS APPLEBERRY (talk_happy_agree)
That’s all the questions!

INT. CLASSROOM DESK - DAY
@ADRIAN changes into ADRIAN_derp
@ADRIAN spot 1.275 81 -47
@ADRIAN faces right
@ZOEY changes into ZOEY_casual
@ZOEY spot 1.280 270 -36
@ZOEY faces right
@ZOEY starts deepbreath

if (ADRIAN = 8){
readerMessage You’ve got all the questions right!
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (cheer_loop)
I’m a genius!

} elif (ADRIAN = 7){
readerMessage You’ve got nearly all of the questions right!
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (nod_loop)
Pretty average

} elif (ADRIAN = 6){
readerMessage You’ve got nearly all of the questions right!
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (nod_loop)
Pretty average

} elif (ADRIAN = 5){
readerMessage You’ve got some of the questions right!
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (nod_loop)
I could do some more revision

} elif (ADRIAN = 4){
readerMessage You’ve got half of the questions right!
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (nod_loop)
Not bad

} else {
readerMessage You did not get any answers right!
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (talk_exhausted)
Back to the drawing board
}


#4

The issue is a simple wording error:


Correct those errors because they have to match.
I also suggest instead of using “elif (Q…)” you use else instead. The last option should be else. It keeps the code clean and you’ll save yourself from issues later.

For example:

if (Q8 is “May be hospitalized or be given antibiotics or bronchodilator”) {
readerMessage You got a point for picking the correct answer
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (talk_exclaim_yes)
(Woo Hoo!)
@ADRIAN +1

} else {
readerMessage You answered incorrectly
@speechbubble is 156 222 to 100% with tail_top_left
ADRIAN (idle_exhausted)
(I suck at this!)
}


#5

Thank you so much, i cannot believe i did not notice that!

Guess i need to look closely next time


#6

Aha no worries, it happens to the best of us


#7

Resolved and closed. Thanks again to the ever so helpful @RudeInception :smiley:


#8

#9