Code posted, multiple Jump issues

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
WhiteMageChiu
Regular
Posts: 35
Joined: Thu Dec 12, 2013 8:35 pm
Completed: Two Steps Back
Projects: I Woke Up Because it Hurt, A Case of Two Souls Becoming One, In Which I Was Never the Hero
Organization: CureAll
Tumblr: chiuscanvas
Deviantart: inuyashatoysrule
Location: [The World]
Contact:

Code posted, multiple Jump issues

#1 Post by WhiteMageChiu » Thu Nov 06, 2014 2:47 pm

Code: Select all

label start:
b "I woke up because it hurt." 

label begin:

$ items = []
    
screen bedrooml:
    imagemap:
        ground "bg5.png"
        hover "bg5movel.png"

        hotspot (10, 290, 150, 145) clicked Return("frame")
        hotspot (398, 541, 300, 80) clicked Return("glass")
        hotspot (539, 2, 343, 370) clicked Return("door")
        hotspot (735, 373, 130, 80) clicked Return("arrow")
        
screen bedroomr:
    imagemap:
        ground "bg2.png"
        hover "bg2mover.png"
        
        hotspot (3, 205, 200, 410) clicked Return("bed") 
        hotspot (405, 180, 215, 161) clicked Return("table")
        hotspot (715, 39, 129, 260) clicked Return("mirror") 
        hotspot (730, 370, 130, 80) clicked Return("arow")

label example: 

    call screen bedrooml
    with fade

    $ result = _return 

    if result == 'frame':
        b "An empty picture frame."
        b "...Most people fill these with photos of their family and loved ones." 
        b "Vessels in which we can physically manifest memories with." 
        b "They can exist forever without relying on our shody memory." 
        b "...I ran away from home when I was young. It was toxic there, so I left. Nothing special." 
        b "I've done just fine on my own, so it's not like I regret anything." 
        b "So in the end I have no need for such things, this came with the dresser for some reason." 
        b "I never considered myself a hoarder, so why haven't I thrown this out yet?" 
        
        jump example 
    if result == 'glass':
        scene background hurt
        with fade 
        b "Ggh--"
        b "There's glass everywhere, this must be what cut my head up." 
        b "It's not entirely see through though, is it not quite glass?" 
        b "Where did it come from?" 
        "You've obtained some glass! Be careful handling it!" 
        $ items.append("glass") 
        if "blanket" in items:
            b "If I use the blanket and glass together, maybe I can make a rope?"
            b "But what the heck would I need a rope for?" 
            b "Why can't I... shake this feeling... that I need one?" 
            b "..."
            b "I suppose I can always buy a new blanket later." 
            "You've obtained a rope!" 
        $ items.append("rope") 
        
        jump example
    else:
        jump example
    if result == 'door':
        scene background abyss
        with fade
        b "The kitchen." 
        
        jump example 
    if result == 'arrow':
        
        call screen bedroomr
        b "The other side of my room, where I sleep." 
        
        
label examplee:
    
    call screen bedroomr
    with fade
    
    $ result = _return
    
    if result == 'bed':
        b "My bed, plain and simple."
        b "I've always been more of a function over form kind of person." 
        b "It's the perfect combination of soft and firm, though the blanket could stand to be a bit warmer." 
        b "Maybe I can use it for something." 
        $ items.append("blanket") 
        if "glass" in items:
            b "If I use the glass and blanket together, maybe I can make a rope?"
            b "But what the heck would I need a rope for?" 
            b "Why can't I... shake this feeling... that I need one?" 
            b "..."
            "You've obtained a rope!" 
        $ items.append("rope") 
        b "I suppose I can always buy a new blanket later."
        
        jump examplee
    else: 
        
        jump examplee
    if result == 'table': 
        b "Stuff has been knocked over."
        b "Who ever did this... they were clearly in a hurry." 
        b "The doll looks so sad thrown behind the bed like that." 
        b "It's the only sentimental thing I kept from my childhood." 
        b "When you grow up attatched to something so strongly it's pretty hard to just stop feeling that way." 
        b "Regardless of your age." 
        
        jump examplee
    if result == 'mirror': 
        b "Another mirror?" 
        b "Did I always have so many mirrors?" 
        b "..." 
        b "Maybe there's a reason no one ever visits." 
        
        jump examplee 
    if result == 'arow': 
        
        call screen bedrooml
        with fade
So I have several issues that suddenly popped up that didn't used to be there.
Currently I have two rooms you can be in, the bedroom [which has a left and right side] and the kitchen.
I can no longer go to those other parts, the kitchen or the right side, when you click the hotspot it just takes you back to the left side of the room.

So I need to figure out how to fix both of those.

But the other problem I have, is when you investigate the glass, a cut-in illustration shows.
That works fine, however.

After seeing said illustration, if you try to move to somewhere else, you see that illustration for a moment before moving.
I have no idea why that's happening.

If I need to clarify more things, please let me know, but I'd really appreciate some help!
Last edited by WhiteMageChiu on Thu Nov 06, 2014 4:03 pm, edited 1 time in total.
https://twitter.com/CureAllChiu
http://www.chiuscanvas.tumblr.com

Keep updated on my horror/ mystery visual novel [I Woke Up Because It Hurt!]
[Currently @ 20% completion- chugging along on coding, art, music. Writing completed]

User avatar
Alex
Lemma-Class Veteran
Posts: 2369
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Code posted, multiple Jump issues

#2 Post by Alex » Thu Nov 06, 2014 3:40 pm

When posting some code examples try to use "code" button - it will keep the indentation in your code, 'cause for now it's a bit hard to read the code.
For the first issue check all your if-conditions - this might be that you need to change them to be if / elif / elif / else.
For the second - you've used the "hurt" image as a background, so it stays behind the screens. You could try to show it using "show" statement instead of "scene" and then "hide" it.
http://www.renpy.org/wiki/renpy/doc/ref ... _Statement
http://www.renpy.org/doc/html/displaying_images.html

User avatar
WhiteMageChiu
Regular
Posts: 35
Joined: Thu Dec 12, 2013 8:35 pm
Completed: Two Steps Back
Projects: I Woke Up Because it Hurt, A Case of Two Souls Becoming One, In Which I Was Never the Hero
Organization: CureAll
Tumblr: chiuscanvas
Deviantart: inuyashatoysrule
Location: [The World]
Contact:

Re: Code posted, multiple Jump issues

#3 Post by WhiteMageChiu » Thu Nov 06, 2014 4:04 pm

Thank you so much Alex!!
I re-did the first post so it's in code mode now! Sorry about that!

And... that show thing seems like it'll work like a charm thank you so much!
https://twitter.com/CureAllChiu
http://www.chiuscanvas.tumblr.com

Keep updated on my horror/ mystery visual novel [I Woke Up Because It Hurt!]
[Currently @ 20% completion- chugging along on coding, art, music. Writing completed]

User avatar
Alex
Lemma-Class Veteran
Posts: 2369
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Code posted, multiple Jump issues

#4 Post by Alex » Thu Nov 06, 2014 5:17 pm

It seems that the jumps leads to wrong labels - change "jump example" with "jump examplee" and vice versa.

User avatar
WhiteMageChiu
Regular
Posts: 35
Joined: Thu Dec 12, 2013 8:35 pm
Completed: Two Steps Back
Projects: I Woke Up Because it Hurt, A Case of Two Souls Becoming One, In Which I Was Never the Hero
Organization: CureAll
Tumblr: chiuscanvas
Deviantart: inuyashatoysrule
Location: [The World]
Contact:

Re: Code posted, multiple Jump issues

#5 Post by WhiteMageChiu » Thu Nov 06, 2014 5:41 pm

Mmm... I looked over it and I don't think so?
When you're done investigating something, I want you to go back to the room you were in when you investigated it. And that's working with everything except for the door to the kitchen, and the arrow to go to the right side of the room.

Sorry if I misunderstood something you said
https://twitter.com/CureAllChiu
http://www.chiuscanvas.tumblr.com

Keep updated on my horror/ mystery visual novel [I Woke Up Because It Hurt!]
[Currently @ 20% completion- chugging along on coding, art, music. Writing completed]

User avatar
WhiteMageChiu
Regular
Posts: 35
Joined: Thu Dec 12, 2013 8:35 pm
Completed: Two Steps Back
Projects: I Woke Up Because it Hurt, A Case of Two Souls Becoming One, In Which I Was Never the Hero
Organization: CureAll
Tumblr: chiuscanvas
Deviantart: inuyashatoysrule
Location: [The World]
Contact:

Re: Code posted, multiple Jump issues

#6 Post by WhiteMageChiu » Fri Nov 07, 2014 3:40 am

Code: Select all

screen bedrooml:
    imagemap:
        ground "bg5.png"
        hover "bg5movel.png"

        hotspot (10, 290, 150, 145) clicked Return("frame")
        hotspot (398, 541, 300, 80) clicked Return("glass")
        hotspot (539, 2, 343, 370) clicked Return("door")
        hotspot (735, 373, 130, 80) clicked Return("arrow")
        
screen bedroomr:
    imagemap:
        ground "bg2.png"
        hover "bg2mover.png"
        
        hotspot (3, 205, 200, 410) clicked Return("bed") 
        hotspot (405, 180, 215, 161) clicked Return("table")
        hotspot (715, 39, 129, 260) clicked Return("mirror") 
        hotspot (730, 370, 130, 80) clicked Return("arow")
        

label example: 

    call screen bedrooml

    $ result = _return 

    if result == 'frame':
        show background bedrooml
        b "An empty picture frame."
        b "...Most people fill these with photos of their family and loved ones." 
        b "Vessels in which we can physically manifest memories with." 
        b "They can exist forever without relying on our shody memory." 
        b "...I ran away from home when I was young. It was toxic there, so I left. Nothing special." 
        b "I've done just fine on my own, so it's not like I regret anything." 
        b "So in the end I have no need for such things, this came with the dresser for some reason." 
        b "I never considered myself a hoarder, so why haven't I thrown this out yet?" 
        hide background bedrooml
        
        jump example 
    if result == 'glass':
        show background hurt
        with fade 
        b "Ggh--"
        b "There's glass everywhere, this must be what cut my head up." 
        b "It's not entirely see through though, is it not quite glass?" 
        b "Where did it come from?" 
        hide background hurt 
        show background bedrooml
        "You've obtained some glass! Be careful handling it!" 
        $ items.append("glass") 
        if "blanket" in items:
            b "If I use the blanket and glass together, maybe I can make a rope?"
            b "But what the heck would I need a rope for?" 
            b "Why can't I... shake this feeling... that I need one?" 
            b "..."
            b "I suppose I can always buy a new blanket later." 
            "You've obtained a rope!" 
        hide background bedrooml
        $ items.append("rope") 
        
        jump example
        
    else:
        jump example
        
    if result == 'door':
        show background abyss
        with fade
        b "The kitchen." 
        hide background abyss 
        
    if result == 'arrow':
        call screen bedroomr 
        
        $ result = _return 
        
        b "The other side of my bedroom, where I sleep." 
        
label examplee:
    
    call screen bedroomr
    
    $ result = _return 
    
    if result == 'bed':
        b "My bed, plain and simple."
        b "I've always been more of a function over form kind of person." 
        b "It's the perfect combination of soft and firm, though the blanket could stand to be a bit warmer." 
        b "Maybe I can use it for something." 
        $ items.append("blanket") 
        if "glass" in items:
            b "If I use the glass and blanket together, maybe I can make a rope?"
            b "But what the heck would I need a rope for?" 
            b "Why can't I... shake this feeling... that I need one?" 
            b "..."
            "You've obtained a rope!" 
        $ items.append("rope") 
        b "I suppose I can always buy a new blanket later."
        
        jump examplee
    else: 
        
        jump examplee
    if result == 'table': 
        b "Stuff has been knocked over."
        b "Who ever did this... they were clearly in a hurry." 
        b "The doll looks so sad thrown behind the bed like that." 
        b "It's the only sentimental thing I kept from my childhood." 
        b "When you grow up attatched to something so strongly it's pretty hard to just stop feeling that way." 
        b "Regardless of your age." 
        
        jump examplee
    if result == 'mirror': 
        b "Another mirror?" 
        b "Did I always have so many mirrors?" 
        b "..." 
        b "Maybe there's a reason no one ever visits." 
        
        jump examplee 
    if result == 'arow': 
        
        call screen bedrooml
        with fade
        
Ugh this is being such a load of crap right now.

Hot spots all work and the "frame" and "glass" click through just fine.
But now you can't even click on the "door" and "arrow" ... the hot spots are still recognized but you can't even attempt to click them anymore. I feel like I've taken a step back ward!! Augh!!
https://twitter.com/CureAllChiu
http://www.chiuscanvas.tumblr.com

Keep updated on my horror/ mystery visual novel [I Woke Up Because It Hurt!]
[Currently @ 20% completion- chugging along on coding, art, music. Writing completed]

User avatar
akemicchi
Veteran
Posts: 465
Joined: Mon Dec 31, 2007 11:22 pm
Projects: Magicians of Delphine, Panaderia: Ensaimada, SweetTooth!, XOXO Droplets
Deviantart: littlebabyshoes
Contact:

Re: Code posted, multiple Jump issues

#7 Post by akemicchi » Fri Nov 07, 2014 4:10 am

The 'else' is your problem. Delete the block and it'll work.

Code: Select all

label example: 

    call screen bedrooml

    $ result = _return 

    if result == 'frame':
        show background bedrooml
        b "An empty picture frame."
        b "...Most people fill these with photos of their family and loved ones." 
        b "Vessels in which we can physically manifest memories with." 
        b "They can exist forever without relying on our shody memory." 
        b "...I ran away from home when I was young. It was toxic there, so I left. Nothing special." 
        b "I've done just fine on my own, so it's not like I regret anything." 
        b "So in the end I have no need for such things, this came with the dresser for some reason." 
        b "I never considered myself a hoarder, so why haven't I thrown this out yet?" 
        hide background bedrooml
        
        jump example 
    if result == 'glass':
        show background hurt
        with fade 
        b "Ggh--"
        b "There's glass everywhere, this must be what cut my head up." 
        b "It's not entirely see through though, is it not quite glass?" 
        b "Where did it come from?" 
        hide background hurt 
        show background bedrooml
        "You've obtained some glass! Be careful handling it!" 
        $ items.append("glass") 
        if "blanket" in items:
            b "If I use the blanket and glass together, maybe I can make a rope?"
            b "But what the heck would I need a rope for?" 
            b "Why can't I... shake this feeling... that I need one?" 
            b "..."
            b "I suppose I can always buy a new blanket later." 
            "You've obtained a rope!" 
        hide background bedrooml
        $ items.append("rope") 
        
        jump example
        
    else: # <- This is your problem.
        jump example # Delete this too. 
Same thing is going to happen on label examplee. If you click on anything but the bed, it'll look like nothing will work. What happens is it'll evaluate the 'if' statement, and if it's false, it'll jump straight to the 'else' block. Since you're jumping straight to label examplee, it'll skip the other conditional statements. You should consider using 'elif' instead of 'if' to prevent that.

User avatar
WhiteMageChiu
Regular
Posts: 35
Joined: Thu Dec 12, 2013 8:35 pm
Completed: Two Steps Back
Projects: I Woke Up Because it Hurt, A Case of Two Souls Becoming One, In Which I Was Never the Hero
Organization: CureAll
Tumblr: chiuscanvas
Deviantart: inuyashatoysrule
Location: [The World]
Contact:

Re: Code posted, multiple Jump issues

#8 Post by WhiteMageChiu » Fri Nov 07, 2014 3:20 pm

Hey Akemichhi!! That helped a lot thank you so much! I can click through again!
https://twitter.com/CureAllChiu
http://www.chiuscanvas.tumblr.com

Keep updated on my horror/ mystery visual novel [I Woke Up Because It Hurt!]
[Currently @ 20% completion- chugging along on coding, art, music. Writing completed]

Post Reply

Who is online

Users browsing this forum: No registered users