paths ignoring label jumps

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
monkeykg
Regular
Posts: 48
Joined: Mon Jan 01, 2018 6:36 pm
Projects: DATE KNIGHT
Tumblr: monkeywiki
Contact:

paths ignoring label jumps

#1 Post by monkeykg »

I am trying to have a character interact with a different character in one scene depending on a previous choice they picked earlier in the game.

At the start of this scene it was working fine! But now we're here:

Code: Select all

          
label godihatecoding:
    
    "{i}The bartender moves away to prepare your order.{/i}"
    
    "{i}You wait patiently.{/i}"
    
    if decide == "zcool":
        
        "fsdfsdfdf"
        
        jump edgemotherfucker
    
    else:
        
        "fdsfdfd"
        
        jump chefknighthere
            
label chefknighthere:
    show chef at right
    with moveinright
        
And the game will NOT go to any scene that isn't

Code: Select all

 else:
        
        "fdsfdfd"
        
        jump chefknighthere
Like, i could change this jump to edgemotherfucker and then it correctly jumps to that character. But it continues ignoring the rest of the code. The problem persists If i reverse the order just making it vice versa.

And like I said, this was all working earlier in the scene. At least for the jumps. for example this:

Code: Select all

label friendlybar:
    
    "{i}You move to take a seat next to the knight.{/i}"
    
      if decide == "zcool":
        
        "{i}You can't help but notice [their] pretty... dramatic looking armor. [They] [have] a tall mug of beer... you always used to think the white frothy foam on beer was whipped cream.{/i}"
        
        "{i}That is, until you actually tried it yourself.{/i}"
        
        "{i}Whipped cream doesn't sound so bad right about now, though...{/i}"
        
        "{i}Beer always looks so much like a dessert in cartoons, though.{/i}"
        
        "{i}Almost like it'd be sweet. But it's definitely an aquired taste, that's for sure.{/i}"
        
        new "What are {b}YOU{/b} looking at?"
        
        p "--Huh?? Oh-- No, I- wasn't..I was just- you know...."
        
        "{i}Oh, jeez. All that thinking about beer and you didn't realize you were staring at [them] this whole time. You look away awkwardly.{/i}"
        
        "{i}You can feel [their] gaze. The imposing knight stares at you almost threateningly before turning [their] head away. [They] set[s] [their] beer down.{/i}"
        
        new "You knights are all the same."
        
        "{i}That comment stunts you. At that point you're staring again- almost taken aback. You squint a little.{/i}"
        
        p "But, aren't you a knight t--"
        
        "{i}Before you can finish your sentence, the bartender approaches.{/i}"
        jump takefuckingsipbabies
      
    else:
        $ decide = "meetchef"
        "{i}You glance towards [them]. [They]'[ss] wearing a ..chef hat. Maybe [they] work[s] here?{/i}"
        
        "{i}It looks like [they]'[ess] been watching some sort of cooking show on [their] phone.{/i}"
                                              
        "{i}Eventually, [they] notice[s] your staring and glance[s] at you. You look away a little awkwardly and tap your fingers against the counter lightly.{/i}"
                                              
        "{i}Just mind your own business. Don't be weird, [name] Knight. It's just a little weird to be wearing a chef hat like that. Not for a place like this, you'd think. The food here isn't that fancy. And [their] hat looks like it belongs in a fancy french restaurant!{/i}"
                                                                                                                                                                                               
        "{i}after a moment, the bartender approaches you.{/i}"
        jump takefuckingsipbabies
        
correctly jumps-- but they do all have the same jump label, at the same time.

it's worth noting that the part that is giving me issues is acknowledging the choice paths-- because it will pick up the test text I put correctly, but then just completely ignores the jump label.

FYI that test text is just for testing, it's not staying there. there won't be any text aside from the jump labels.

irredeemable
Regular
Posts: 78
Joined: Thu Feb 08, 2018 7:57 am
Contact:

Re: paths ignoring label jumps

#2 Post by irredeemable »

If it's only going to the else path I can only assume that decide != "zcool". Try adding "[decide]" right before the if to check the variable.

User avatar
monkeykg
Regular
Posts: 48
Joined: Mon Jan 01, 2018 6:36 pm
Projects: DATE KNIGHT
Tumblr: monkeywiki
Contact:

Re: paths ignoring label jumps

#3 Post by monkeykg »

I'm not entirely sure what you're trying to say but
I should clarify that it's not JUST going to the else path, it recognizes the other path, it's just ignoring the jump label in that path and only using the jump label in the else path.

Code: Select all

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/script66.rpy", line 169: expected statement.
    [decide] if decide == "zcool":
             ^

File "game/script66.rpy", line 175: expected statement.
    else:
        ^

Ren'Py Version: Ren'Py 6.99.14.1.3218
Sun Feb 18 12:44:59 2018

irredeemable
Regular
Posts: 78
Joined: Thu Feb 08, 2018 7:57 am
Contact:

Re: paths ignoring label jumps

#4 Post by irredeemable »

I mean something like

Code: Select all

"[decide]"
if decide == "zcool":
Just to check the value of 'decide'. If you're sure it follows the if path can you post the code to the label it's supposed to jump to? Or just all of the relevant script as there aren't any obvious errors jumping out at me from what you've posted.

User avatar
monkeykg
Regular
Posts: 48
Joined: Mon Jan 01, 2018 6:36 pm
Projects: DATE KNIGHT
Tumblr: monkeywiki
Contact:

Re: paths ignoring label jumps

#5 Post by monkeykg »

EDIT EDIT EDIT:

HEY! I took the time to try to figure it out and I realized it happened because all my previous choices were now being ignored since, being a little newer to renpy I was not defining any of my choice variables.

I was using stuff like $ decide = "fdsfd" For every menu choice.

Now the problem has fixed itself after defining:

Code: Select all

default hair_cool = False
default hair_sexy = False
default hair_cas = False
default hair_cute = False
default hair_hard = False

default bar_water = False
default bar_ale = False
default bar_broke = False
default bar_juice = False
and using this instead of what i'd previously been using:

Code: Select all

label godihatecoding:
    
    "{i}The bartender moves away to prepare your order.{/i}"
    
    "{i}You wait patiently.{/i}"
    
    if hair_cool:
        
        "fsdfsdfdf"
        jump edgemotherfucker
    
    else:
        
        "fdsfdfd"
        jump chefknighthere

Post Reply

Who is online

Users browsing this forum: No registered users