Urgent! Hiding and showing choices
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.
-
- Newbie
- Posts: 1
- Joined: Sat Aug 08, 2015 7:23 pm
- Contact:
Urgent! Hiding and showing choices
Hello! I'm a beginner user to ren'py, making a dating sim. I want to release my game today but I just have this one bit to go. I want to do something with choices but I'm not sure how. I want the player to talk to a character about something, and in order to have a new choice shown, the player has to talk to all the other main characters about something first, then go back to that character. I don't understand If and Condition statements very well, so if someone can help explain it to me, I'll be very grateful. Thank you!
- JhazyJazz
- Regular
- Posts: 35
- Joined: Fri Feb 19, 2016 4:22 am
- Completed: Best Friends
- Organization: Pastelle Studios
- Contact:
Re: Urgent! Hiding and showing choices
Does this help?
hope it helps~
Code: Select all
label start:
e "You've created a new Ren'Py game."
e "Once you add a story, pictures, and music, you can release it to the world!"
"Talk to Eileen?"
menu:
"Yep.":
jump yep
"Nope.":
jump nope
label yep:
a"Hello Eileen!"
e"Hello!"
return
label nope:
"You don't want to talk?"
"Okay.."
return
Last edited by JhazyJazz on Fri Feb 19, 2016 6:08 am, edited 1 time in total.
Re: Urgent! Hiding and showing choices
Not likely...JhazyJazz wrote:Does this help?
Something along the lines of:
Code: Select all
default flag1 = False
default flag2 = False
label start:
menu:
"Talk to NPC1":
"Hi NPC1"
$ flag1 = True
jump start
"Talk to NPC2":
"Hi NPC2"
$ flag2 = True
jump start
"Go Bowling!" if flag1 and flag2:
"The three of you go out to have some fun!"
- JhazyJazz
- Regular
- Posts: 35
- Joined: Fri Feb 19, 2016 4:22 am
- Completed: Best Friends
- Organization: Pastelle Studios
- Contact:
Re: Urgent! Hiding and showing choices
Duly Noted!~xela wrote:Not likely...JhazyJazz wrote:Does this help?
Something along the lines of:
might help but don't we have like 1000 of these examples...Code: Select all
default flag1 = False default flag2 = False label start: menu: "Talk to NPC1": "Hi NPC1" $ flag1 = True jump start "Talk to NPC2": "Hi NPC2" $ flag2 = True jump start "Go Bowling!" if flag1 and flag2: "The three of you go out to have some fun!"
- FonaCall
- Regular
- Posts: 98
- Joined: Sun Dec 13, 2015 6:59 am
- Projects: Bahay Kubo, Tower of Saviors Cries of Soul
- Organization: Black Eared Games
- Tumblr: blackearedgames
- Deviantart: fonacall
- Skype: fona.call
- Soundcloud: fona-call
- Location: Philippines
- Contact:
Re: Urgent! Hiding and showing choices
Hello.
I think xela give idea of what do already, but maybe change bit of something in code? I change code a bit, then will try explain.
So, is start with these:
Probably know what start label is, as is where game starts. After that, declare variable, is line with dollar sign. Is like marker for game to check something. Variable help check lots of things, like if action been done or not done, or how many points have already.
In this case, you want game to check if you talk to NPC 1 and 2 already.
I put menu under different label now. I do it to be safe with making variable stay True after make variable True with talk to NPC, since I usually declare variable after start label. No want endless loop with no new choice. No sure what happen if declare variable before start label, though.
So, what code do is show menu first to choose if talk with NPC 1 or NPC 2. When decide to talk to NPC, you get talk to NPC and variable become true, then you jump to label for menu so can choose something else. Go bowling appear when both variable are True.
Is helpful? If still confuse, can also try look at other people game and code if can and try copy some things.
I think xela give idea of what do already, but maybe change bit of something in code? I change code a bit, then will try explain.
Code: Select all
label start:
$ talk_npc1 = False
$ talk_npc2 = False
label talk_menu:
menu:
"Talk to NPC1":
"Hi NPC1"
$ talk_npc1 = True
jump talk_menu
"Talk to NPC2":
"Hi NPC2"
$ talk_npc2 = True
jump talk_menu
"Go Bowling!" if talk_npc1 and talk_npc2:
"The three of you go out to have some fun!"
Code: Select all
label start:
$ talk_npc1 = False
$ talk_npc2 = False
In this case, you want game to check if you talk to NPC 1 and 2 already.
Code: Select all
label talk_menu:
menu:
"Talk to NPC1":
"Hi NPC1"
$ talk_npc1 = True
jump talk_menu
"Talk to NPC2":
"Hi NPC2"
$ talk_npc2 = True
jump talk_menu
"Go Bowling!" if talk_npc1 and talk_npc2:
"The three of you go out to have some fun!"
So, what code do is show menu first to choose if talk with NPC 1 or NPC 2. When decide to talk to NPC, you get talk to NPC and variable become true, then you jump to label for menu so can choose something else. Go bowling appear when both variable are True.
Is helpful? If still confuse, can also try look at other people game and code if can and try copy some things.
SO MANY GAMES, SO LITTLE TIME!!!
For those who are freelance VN staff and also for those who are VN team leaders, please read this. Inform yourselves. Thank you.
Status: More or less busy with IRL work and finishing a game in time for Halloween Jam in itch.io
Brainstorming for the following:
My Seven Deadly Friends | the rest of the ideas
For those who are freelance VN staff and also for those who are VN team leaders, please read this. Inform yourselves. Thank you.
Status: More or less busy with IRL work and finishing a game in time for Halloween Jam in itch.io
Brainstorming for the following:
My Seven Deadly Friends | the rest of the ideas
- MimirollCookie
- Miko-Class Veteran
- Posts: 725
- Joined: Sat May 23, 2015 5:05 am
- Completed: Best Friends (DRAMA), Sweet and Spices (NaNo16)
- Projects: Cupid's Wish, Best Friends Deux
- Organization: Pastelle Studios
- Deviantart: MimirollCookie
- Location: A place where rainbows and unicorns collide. ^0^
- Contact:
Re: Urgent! Hiding and showing choices
Hmm.....FonaCall wrote:Hello.
I think xela give idea of what do already, but maybe change bit of something in code? I change code a bit, then will try explain.
So, is start with these:Code: Select all
label start: $ talk_npc1 = False $ talk_npc2 = False label talk_menu: menu: "Talk to NPC1": "Hi NPC1" $ talk_npc1 = True jump talk_menu "Talk to NPC2": "Hi NPC2" $ talk_npc2 = True jump talk_menu "Go Bowling!" if talk_npc1 and talk_npc2: "The three of you go out to have some fun!"
Probably know what start label is, as is where game starts. After that, declare variable, is line with dollar sign. Is like marker for game to check something. Variable help check lots of things, like if action been done or not done, or how many points have already.Code: Select all
label start: $ talk_npc1 = False $ talk_npc2 = False
In this case, you want game to check if you talk to NPC 1 and 2 already.
I put menu under different label now. I do it to be safe with making variable stay True after make variable True with talk to NPC, since I usually declare variable after start label. No want endless loop with no new choice. No sure what happen if declare variable before start label, though.Code: Select all
label talk_menu: menu: "Talk to NPC1": "Hi NPC1" $ talk_npc1 = True jump talk_menu "Talk to NPC2": "Hi NPC2" $ talk_npc2 = True jump talk_menu "Go Bowling!" if talk_npc1 and talk_npc2: "The three of you go out to have some fun!"
So, what code do is show menu first to choose if talk with NPC 1 or NPC 2. When decide to talk to NPC, you get talk to NPC and variable become true, then you jump to label for menu so can choose something else. Go bowling appear when both variable are True.
Is helpful? If still confuse, can also try look at other people game and code if can and try copy some things.
Maybe FonaCall's right!
Maybe that'll solve everyone's problem!
Re: Urgent! Hiding and showing choices
I've completely lost the "flow" of this thread
Who is online
Users browsing this forum: voluorem