Default menuset not working as intended
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.
Default menuset not working as intended
I'm using the simple default menuset = set() code to make choices disappear from the menu once you've gone through them. I think it's creating some issues now, however.
When I get through the last option of the menu, it starts to loop that specific option. There is probably an easy solution to this, and I've done menus like this before with other types of code, but am struggling with the menuset one.
While we're on the subject, I also can't seem to be able to call labels from other script files? I think it's because of the menu issue but thought I'd mention it anyway.
When I get through the last option of the menu, it starts to loop that specific option. There is probably an easy solution to this, and I've done menus like this before with other types of code, but am struggling with the menuset one.
While we're on the subject, I also can't seem to be able to call labels from other script files? I think it's because of the menu issue but thought I'd mention it anyway.
- isobellesophia
- Miko-Class Veteran
- Posts: 979
- Joined: Mon Jan 07, 2019 2:55 am
- Completed: None
- Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
- Organization: Friendly Teachers series
- Deviantart: SophBelle
- itch: Child Creation
- Location: Philippines, Mindanao
- Contact:
Re: Default menuset not working as intended
It will be great if you shows us the code, so we can exactly know what is the problem..chesarty wrote: ↑Sun Aug 25, 2019 11:28 am I'm using the simple default menuset = set() code to make choices disappear from the menu once you've gone through them. I think it's creating some issues now, however.
When I get through the last option of the menu, it starts to loop that specific option. There is probably an easy solution to this, and I've done menus like this before with other types of code, but am struggling with the menuset one.
While we're on the subject, I also can't seem to be able to call labels from other script files? I think it's because of the menu issue but thought I'd mention it anyway.
I am lazy to read so..
Re: Default menuset not working as intended
I didn't really know which code to show, ahah. There's nothing inherently wrong with the code, I was mainly just wondering if there was a line of code that would stop the default menuset from looping?isobellesophia wrote: ↑Sun Aug 25, 2019 11:33 amIt will be great if you shows us the code, so we can exactly know what is the problem..chesarty wrote: ↑Sun Aug 25, 2019 11:28 am I'm using the simple default menuset = set() code to make choices disappear from the menu once you've gone through them. I think it's creating some issues now, however.
When I get through the last option of the menu, it starts to loop that specific option. There is probably an easy solution to this, and I've done menus like this before with other types of code, but am struggling with the menuset one.
While we're on the subject, I also can't seem to be able to call labels from other script files? I think it's because of the menu issue but thought I'd mention it anyway.
I am lazy to read so..
Anyway, here is the very basic menu code:
Code: Select all
menu choice1:
set menuset
you "Where should I go...?"
"School building":
jump explore_school_building
"Dormitories":
jump explore_dormitories
"Coffee shop":
jump explore_coffeeshop
"School grounds":
jump explore_yard
- isobellesophia
- Miko-Class Veteran
- Posts: 979
- Joined: Mon Jan 07, 2019 2:55 am
- Completed: None
- Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
- Organization: Friendly Teachers series
- Deviantart: SophBelle
- itch: Child Creation
- Location: Philippines, Mindanao
- Contact:
Re: Default menuset not working as intended
Well.. as i read it here.chesarty wrote: ↑Sun Aug 25, 2019 11:38 amI didn't really know which code to show, ahah. There's nothing inherently wrong with the code, I was mainly just wondering if there was a line of code that would stop the default menuset from looping?isobellesophia wrote: ↑Sun Aug 25, 2019 11:33 amIt will be great if you shows us the code, so we can exactly know what is the problem..chesarty wrote: ↑Sun Aug 25, 2019 11:28 am I'm using the simple default menuset = set() code to make choices disappear from the menu once you've gone through them. I think it's creating some issues now, however.
When I get through the last option of the menu, it starts to loop that specific option. There is probably an easy solution to this, and I've done menus like this before with other types of code, but am struggling with the menuset one.
While we're on the subject, I also can't seem to be able to call labels from other script files? I think it's because of the menu issue but thought I'd mention it anyway.
I am lazy to read so..
Anyway, here is the very basic menu code:And every option ends with jump choice1, bringing the player back into the menu. I assumed that it would just continue the script no issue once it's gone through the list but nope, it loops.Code: Select all
menu choice1: set menuset you "Where should I go...?" "School building": jump explore_school_building "Dormitories": jump explore_dormitories "Coffee shop": jump explore_coffeeshop "School grounds": jump explore_yard
https://www.renpy.org/doc/html/menus.html
Menuset is basically use ALL choices that has been listed each menu and thats gonna use it.
But of course, you need a label of those.
But maybe the reason why it was sent back to menu in loop because you didnt put
the
Code: Select all
label choice1_after
Well, i dont really know about menusets so did my best to help you. >_O
- namastaii
- Eileen-Class Veteran
- Posts: 1350
- Joined: Mon Feb 02, 2015 8:35 pm
- Projects: Template Maker for Ren'Py, What Life
- Github: lunalucid
- Skype: Discord: lunalucid#1991
- Soundcloud: LunaLucidMusic
- itch: lunalucid
- Location: USA
- Contact:
Re: Default menuset not working as intended
label choice_1_after I think is just a user defined example and isn't required for the menu and is simply a label. (I mean, I'm not really finding much documentation on menusets at all... it's very vague but I'm going to assume this isn't related to the current problem.
and your labels are defined just as the menu choices lead to?
label explore_school_building: (etc)
where are these .rpy files located? The ones with these labels.
and your labels are defined just as the menu choices lead to?
label explore_school_building: (etc)
where are these .rpy files located? The ones with these labels.
Re: Default menuset not working as intended
yeah, everything is labelled correctly and the labels are all in the same script.rpy document so there should be no issue calling themnamastaii wrote: ↑Sun Aug 25, 2019 1:40 pm label choice_1_after I think is just a user defined example and isn't required for the menu and is simply a label. (I mean, I'm not really finding much documentation on menusets at all... it's very vague but I'm going to assume this isn't related to the current problem.
and your labels are defined just as the menu choices lead to?
label explore_school_building: (etc)
where are these .rpy files located? The ones with these labels.
-
- Regular
- Posts: 169
- Joined: Sun Jun 04, 2017 12:05 pm
- Completed: Too many, check signature
- Deviantart: mikolajspy
- Location: Wrocław, Poland
- Contact:
Re: Default menuset not working as intended
You can try in some part of the code (maybe at the end of each event or before the menu with small changes to labels, to make it cleaner):
Code: Select all
if len(menuset) == 4: #number of possibilities
$menuset = set() #I guess you'd need to reset to 0 or use different variable set to use this trick somewhere else
jump after_all_events #name of your label after events
else:
jump choice1 #if menuset doesn't have enough length, go back to menu
- Remix
- Eileen-Class Veteran
- Posts: 1628
- Joined: Tue May 30, 2017 6:10 am
- Completed: None... yet (as I'm still looking for an artist)
- Projects: An un-named anime based trainer game
- Contact:
Re: Default menuset not working as intended
What are you doing After the menu? Does the script just run into the following label?
I'd suggest putting the menu actually inside a label (you can still jump back to it by name)...
I'd suggest putting the menu actually inside a label (you can still jump back to it by name)...
Code: Select all
default chosen_choices = []
label start:
menu choice1:
set chosen_choices
"Where should I go...?"
"School building":
jump explore_school_building
"Dormitories":
jump explore_dormitories
"Coffee shop":
jump explore_coffeeshop
"School grounds":
jump explore_yard
"We are now past that looped menu... all choices chosen once... the script can continue"
return
# Just a hack to avoid writing 4 labels...
define config.missing_label_callback = lambda x: "missing_label"
label missing_label:
"You are doing something..."
jump choice1
Frameworks & Scriptlets:
- Speech Bubble dialogue system
- Multiple Notify with ATL and history
- (WIP) Radial Masking - needs updating to use Shader
- 7.4 - Smooth Tinting using ATL and matrixcolor
- Several other repositories there too
Re: Default menuset not working as intended
Yay, this worked! Thank you a bunch ^^mikolajspy wrote: ↑Mon Aug 26, 2019 7:34 am You can try in some part of the code (maybe at the end of each event or before the menu with small changes to labels, to make it cleaner):Code: Select all
if len(menuset) == 4: #number of possibilities $menuset = set() #I guess you'd need to reset to 0 or use different variable set to use this trick somewhere else jump after_all_events #name of your label after events else: jump choice1 #if menuset doesn't have enough length, go back to menu
Who is online
Users browsing this forum: Alex