Still getting used to coding, so wasn't too sure how to get what I wanted for the VN I'm making.
Basically, at the beginning you're taken on a university tour, and an in-game menu will come up from which you can choose where you want to be taken, or if you want to just go straight to the dorms (which progresses the story, but means you don't meet the dateable characters)
Each choice leads to a semi-long scene, so I wouldn't want the player to choose more than about three before they return to the dorms, so is there any way that I can put this limit on?
I also wanted the menu to remember the places that the player has already toured, so that they can't repeat scenes.
Does anyone know how I could put these in?
Limiting amount of choices from menu that can be selected
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.
- theCodeCat
- Regular
- Posts: 62
- Joined: Sun Sep 06, 2015 8:40 pm
- Projects: Lucid9, Mystic Destinies: Serendipity of Aeons
- Skype: theCodeCat
- Contact:
Re: Limiting amount of choices from menu that can be selecte
You could do something like:
but name the labels and variables something more descriptive.
Code: Select all
label start:
"content leading into choice"
python:
# 0 = Not toured, 1 = Toured
touredSpotA = 0
touredSpotB = 0
touredSpotC = 0
touredSpotD = 0
label tourChoice:
# Count how many locations have been visited and check if that number is above some threshold
if touredSpotA + touredSpotB + touredSpotC + touredSpotD >= 3:
# Force player to go to dorm
jump dorm
menu:
"Where would you like to go next?"
"Location A" if touredSpotA == 0:
$ touredSpotA = 1
jump spotATour
"Location B" if touredSpotB == 0:
$ touredSpotB = 1
jump spotBTour
"Location C" if touredSpotC == 0:
$ touredSpotC = 1
jump spotCTour
"Location D" if touredSpotD == 0:
$ touredSpotD = 1
jump spotDTour
"Dorm":
jump dorm
label spotATour:
"Some content"
jump tourChoice
label spotBTour:
"Some content"
jump tourChoice
label spotCTour:
"Some content"
jump tourChoice
label spotDTour:
"Some content"
jump tourChoice
label dorm:
"game continues here"
- Izzayuh
- Newbie
- Posts: 15
- Joined: Sat Mar 19, 2016 12:06 am
- Projects: Masked, Lovetale
- Tumblr: izzycle
- Deviantart: izzysdoodles
- Contact:
Re: Limiting amount of choices from menu that can be selecte
Thank you!! I will definitely try that
Who is online
Users browsing this forum: Ahrefs [Bot], trailsiderice