How to make code stop in a certain scene
Posted: Tue Mar 09, 2021 5:41 pm
Hey everyone. I've been having trouble with the emma part of this code. It's intended behaviour is that you talk to her and return to the screen hallway 2 where she is still visible but the code is skipping to the hallway 1 scene and leaving her and chad's screen up. Not only that, but sometimes it goes even further back and sometimes the game just ends. I'm not sure what is happening. If anyone has any insights please let me know. It's driving me insane, i've wasted three hours on this.
This is my screens code:
and my main code:
This is my screens code:
Code: Select all
init:
transform arrowSize:
zoom 0.09
screen gotohallway1():
imagebutton: #image that has a button attached to it
xalign 1.0
yalign 0.5
idle "red_arrow.png"
hover "red_arrow_hover.png"
action [Hide("gotohallway1"), Hide("emmascreen"), Hide("chadscreen"), Jump("hallway1")]
at arrowSize
screen gotohallway2():
imagebutton:
xalign 0.0
yalign 0.5
idle "red_arrow.png"
hover "red_arrow_hover.png"
action [ Hide("gotohallway2"), Jump("hallway2")]
at arrowSize
screen gotohallway3():
imagebutton:
xalign 0.0
yalign 0.5
idle "red_arrow.png"
hover "red_arrow_hover.png"
action [ Hide("gotohallway2"), Jump("hallway2")]
at arrowSize
screen emmascreen():
imagebutton:
xalign 0.85
yalign 0.5
idle "emmaIdle.png"
hover "emmaHover.png"
action Call("emmalabel")
screen chadscreen():
imagebutton:
xalign 0.691 #(1143, 374, 263, 271?????????)
yalign 0.465
idle "chadIdle.png"
hover "chadHover.png"
action If(renpy.get_screen("emmascreen"), Hide("emmascreen"), Show("emmascreen"))Code: Select all
label intro:
#python:
$ playerName = renpy.input("What is your name?")
$ playerName = playerName.strip() or "Robbie"
scene intro
"{cps=25}It's been a month since I dropped out of trade school and lost my scholarship.{/cps}"
"{cps=25}I've been looking for an apartment and a job, and I finally found something.{/cps}"
"{cps=25}I found a run down apartment in the boonies and a shitty job. It's a kick to the balls but I've come back to work here.{/cps}"
"{cps=25} {b}Fucking embarrassing{/b}{/cps}{cps=2}... {/cps}{cps=15}but I need the job.{/cps}"
$ introDone = True
call mondaymorning
label mondaymorning:
scene principal_office
show mc_tired at left with dissolve
main "*sigh* What am I doing..."
show principal_mad at right with dissolve
pri "Are you even listening to me [playerName]?"
hide principal_mad
show principal_annoyed at right
pri "[playerName] I hired you because I believe in second chances. Even though you dropped out, I'm giving you a chance to get your life back on track."
main "Yeah I uh... I'm trying..."
hide principal_annoyed
show principal_compassion at right
pri "..."
pri "It'll be okay."
main "..."
pri "..."
main "I'll get to it..."
call hallway2
label mondaylate:
label mondayafternoon:
label emmalabel:
if(emmaTalk == 0 and not emmaTalkNow):
emm "Anon? Is that you?"
main "Hey Emma, how you doing?"
emm "Why are you wearing a Janitor's uniform?"
$ emmaTalk += 1
$ emmaTalkNow = True
return
elif(emmaTalk == 1 and not emmaTalkNow):
emm "yo bro"
return
elif(emmaTalkNow):
"I've already talked to Emma."
return
window hide
$ renpy.pause(hard=True)
label chadlabel:
window hide
$ renpy.pause(hard=True)
label hallway2:
scene hallway2
show screen chadscreen
show screen gotohallway1
window hide
$ renpy.pause(hard=True)
label hallway1:
scene hallway1
show screen gotohallway2
window hide
$ renpy.pause(hard=True)