Different choice paths?
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.
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.
- Ashi-Yu
- Newbie
- Posts: 10
- Joined: Mon Feb 29, 2016 9:02 pm
- Projects: The New Light and Bittersweet
- Tumblr: ashi-sky
- Deviantart: BlueSky2795
- Contact:
Different choice paths?
OK, so I made this two choice at the beginning of the game. The problem is, when I try the second choice the if flag doesn't work. I realize it's because the second choice just jumped over the flag, which is why the game couldn't identify it.
How do I skip the flag or do I do something else?
I feel like this is a pretty stupid thing to ask, but hey I'm a newbie.
How do I skip the flag or do I do something else?
I feel like this is a pretty stupid thing to ask, but hey I'm a newbie.
- yuren
- Newbie
- Posts: 14
- Joined: Sat Feb 20, 2016 2:41 am
- Projects: chomp2
- Github: yosephharyanto
- Skype: yosephharyanto
- Location: Indonesia
- Contact:
Re: Different choice paths?
I guess providing with part of the code will help me understand your problem better. Can you post part of the code , especially at the choice menu and the flag part.Ashi-Yu wrote:OK, so I made this two choice at the beginning of the game. The problem is, when I try the second choice the if flag doesn't work. I realize it's because the second choice just jumped over the flag, which is why the game couldn't identify it.
How do I skip the flag or do I do something else?
I feel like this is a pretty stupid thing to ask, but hey I'm a newbie.
- Ashi-Yu
- Newbie
- Posts: 10
- Joined: Mon Feb 29, 2016 9:02 pm
- Projects: The New Light and Bittersweet
- Tumblr: ashi-sky
- Deviantart: BlueSky2795
- Contact:
Re: Different choice paths?
yuren wrote:I guess providing with part of the code will help me understand your problem better. Can you post part of the code , especially at the choice menu and the flag part.Ashi-Yu wrote:OK, so I made this two choice at the beginning of the game. The problem is, when I try the second choice the if flag doesn't work. I realize it's because the second choice just jumped over the flag, which is why the game couldn't identify it.
How do I skip the flag or do I do something else?
I feel like this is a pretty stupid thing to ask, but hey I'm a newbie.
Code: Select all
menu:
"Just stay here.":
jump choice1_stay
"Try to find Lucy.":
jump choice1_go
label choice1_stay:
n "Eh, I'll just stay here."
jump waiting
with fade
label choice1_go:
show nick sassyface
n "Waiting here would be pretty boring, anyway."
scene black
with dissolve
"An hour later. . ."
scene forest road(p_night)
show nick oh no
with fade
n "I can't even tell which direction is right, which is left anymore."
show nick surprised
m "Nick!"
show nick shout
n "Lucy?"
show lucy concerned r at left
show nick pokerface at right
l "Where were you? I was worried!"
show nick umm at right
n "I was just wondering around."
show lucy what r at left
play music "If_I_Had_a_Chicken.mp3"
l "To all the way up here?"
show nick fluster at Position(xpos = 1.0, xanchor=0.80, ypos=1.0,
yanchor=1.0)
n "Um. Erm. Well."
n "Who's that behind you, anyway?"
show lucy shout r at left
l "Don't change the subject!"
show lucy frowny mad at Position(xpos = 0.25, xanchor=0.25, ypos=1.0,
yanchor=1.0)
show jeff smile c at Position(xpos = 0.00, xanchor=0.00, ypos=1.0,
yanchor=1.0)
j "Name's Jeff."
show lucy smiler at Position(xpos = 0.25, xanchor=0.25, ypos=1.0,
yanchor=1.0)
l "Mr.Henderson helped me looked for you."
show lucy frowny mad at Position(xpos = 0.25, xanchor=0.25, ypos=1.0,
yanchor=1.0)
show jeff snort c at Position(xpos = 0.00, xanchor=0.00, ypos=1.0,
yanchor=1.0)
l "Becuase you left me all by myself."
n "I didn't mean it."
l "Sure you didn't"
l "Anyway, we should get home now."
show jeff smile c at Position(xpos = 0.00, xanchor=0.00, ypos=1.0,
yanchor=1.0)
j "May I walk you guys home, then?"
j "It's pretty late."
show lucy smiler at Position(xpos = 0.25, xanchor=0.25, ypos=1.0,
yanchor=1.0)
l "Sure, Mr.Henderson."
show nick uummmmm at Position(xpos = 1.0, xanchor=0.80, ypos=1.0,
yanchor=1.0)
n ". . ."
jump homeThen here's the flag:
Code: Select all
label choice1_sure:
$ sure_flag = True
show nick looking down blush
n "Sure, I guess."
jump lucy
label choice2_go:
$ sure_flag = False
show nick pokerface at right
n "No thanks, but I'll be fine."Re: Different choice paths?
I removed the text from your code ^^
If I understand it correctly, your problem is that the flag isn't saved when you try the second option, so when you test for that flag later on it trows an error.
I can't see where labels "waiting" and "home" end up, so I don't know exactly where the problem lies.
It could be that it just skips this part entirely.
If so, your code never reached the flag. Try inserting a "jump choice2_go" statement somewhere appropriate.
Is there a second menu before you reach the flag?
If there isn't you could also place the flag in the menu (before the jump statement), to be sure the flag is saved.
(Overall I find it a nice idea to save the flag after the choice that determines the flag instead of in between a lot of text.)
If that doesn't help, it might be a good idea to post the error message (if there is any) or a bit more of your code (so we can see where the labels "home" and "waiting" end up).
Code: Select all
menu:
"Just stay here.":
jump choice1_stay
"Try to find Lucy.":
jump choice1_go
label choice1_stay:
jump waiting
with fade
label choice1_go:
jump home
label choice1_sure:
$ sure_flag = True
jump lucy
label choice2_go:
$ sure_flag = False
I can't see where labels "waiting" and "home" end up, so I don't know exactly where the problem lies.
It could be that it just skips this part entirely.
Code: Select all
label choice2_go:
$ sure_flag = False
show nick pokerface at right
n "No thanks, but I'll be fine."Is there a second menu before you reach the flag?
If there isn't you could also place the flag in the menu (before the jump statement), to be sure the flag is saved.
(Overall I find it a nice idea to save the flag after the choice that determines the flag instead of in between a lot of text.)
If that doesn't help, it might be a good idea to post the error message (if there is any) or a bit more of your code (so we can see where the labels "home" and "waiting" end up).
Re: Different choice paths?
Very easy. Define the flag at the start of the game.
The flag will always be False until you change it to a different value.
Code: Select all
label start:
$ mychoice=False
e "An example"If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.
10 ? "RENPY"
20 GOTO 10
RUN
10 ? "RENPY"
20 GOTO 10
RUN
- Ashi-Yu
- Newbie
- Posts: 10
- Joined: Mon Feb 29, 2016 9:02 pm
- Projects: The New Light and Bittersweet
- Tumblr: ashi-sky
- Deviantart: BlueSky2795
- Contact:
Re: Different choice paths?
Yeah, there's a second menu before the flag, and I think it is because it just skips this part entirely. I'n not sure where to insert the statement, though. ;;w;;panpanvw wrote:I removed the text from your code ^^If I understand it correctly, your problem is that the flag isn't saved when you try the second option, so when you test for that flag later on it trows an error.Code: Select all
menu: "Just stay here.": jump choice1_stay "Try to find Lucy.": jump choice1_go label choice1_stay: jump waiting with fade label choice1_go: jump home label choice1_sure: $ sure_flag = True jump lucy label choice2_go: $ sure_flag = False
I can't see where labels "waiting" and "home" end up, so I don't know exactly where the problem lies.
It could be that it just skips this part entirely.If so, your code never reached the flag. Try inserting a "jump choice2_go" statement somewhere appropriate.Code: Select all
label choice2_go: $ sure_flag = False show nick pokerface at right n "No thanks, but I'll be fine."
Is there a second menu before you reach the flag?
If there isn't you could also place the flag in the menu (before the jump statement), to be sure the flag is saved.
(Overall I find it a nice idea to save the flag after the choice that determines the flag instead of in between a lot of text.)
If that doesn't help, it might be a good idea to post the error message (if there is any) or a bit more of your code (so we can see where the labels "home" and "waiting" end up).
- yuren
- Newbie
- Posts: 14
- Joined: Sat Feb 20, 2016 2:41 am
- Projects: chomp2
- Github: yosephharyanto
- Skype: yosephharyanto
- Location: Indonesia
- Contact:
Re: Different choice paths?
+ 1. Rather than thinking on where to put the flag, just put a default flag value at start of the game.. and change it when necessary. Doing this will simplify your flow..gas wrote:Very easy. Define the flag at the start of the game.The flag will always be False until you change it to a different value.Code: Select all
label start: $ mychoice=False e "An example"
- Ashi-Yu
- Newbie
- Posts: 10
- Joined: Mon Feb 29, 2016 9:02 pm
- Projects: The New Light and Bittersweet
- Tumblr: ashi-sky
- Deviantart: BlueSky2795
- Contact:
Re: Different choice paths?
Oh awesome! It worked, thanks!!yuren wrote:+ 1. Rather than thinking on where to put the flag, just put a default flag value at start of the game.. and change it when necessary. Doing this will simplify your flow..gas wrote:Very easy. Define the flag at the start of the game.The flag will always be False until you change it to a different value.Code: Select all
label start: $ mychoice=False e "An example"
Current Project: https://ashi-yu.itch.io/the-new-light
Who is online
Users browsing this forum: Bing [Bot], Google [Bot]