Hi!
First off, thank you so much for your help. What I had tested out on my own was very very similar- I had used a different name for the main menu, though. second_menu instead of main_menu(2).
When I use main_menu(2), I get this error:
Code: Select all
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.
File "game/secondmenu.rpy", line 1: expected 'name' not found.
screen main_menu(2):
^
Ren'Py Version: Ren'Py 7.1.3.1092
Fri Jan 04 16:15:06 2019
(Instead of a ^, it's got a little red arrow pointing to the 2.)
When I use second_menu, however, I get no error message. I'm cool with no errors happening, I'm just curious as to why this happens and if I'm actually doing stuff wrong.
Secondly, I noticed this line of code in the screens file:
Code: Select all
if main_menu:
textbutton _("Start") action Start()
I thought "ok, so that's the code that puts the start button on the main menu. What if I do this?", and changed it to this:
Code: Select all
if main_menu:
textbutton _("Start") action Start()
if second_menu:
textbutton _("Start") action Jump(wherever)
The idea being that this second menu will have a 'start' button that will take you somewhere else, almost as if you're making a 'decoy' main menu to trick the player into thinking they're at the real one. (This is not what I'm going to do, but it's a cool application of the idea that I thought of just now and thought might help you understand what I'm going for.) However, when I try to launch the game afterwards, I get this error message:
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/screens.rpy", line 356, in execute
screen main_menu():
File "game/screens.rpy", line 356, in execute
screen main_menu():
File "game/screens.rpy", line 371, in execute
use navigation
File "game/screens.rpy", line 292, in execute
screen navigation():
File "game/screens.rpy", line 292, in execute
screen navigation():
File "game/screens.rpy", line 294, in execute
vbox:
File "game/screens.rpy", line 306, in execute
if second_menu:
NameError: name 'second_menu' is not defined
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "renpy/common/_layout/screen_main_menu.rpym", line 28, in script
python hide:
File "C:\Users\Caro\Desktop\renpy-7.1.3-sdk\renpy\ast.py", line 881, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "C:\Users\Caro\Desktop\renpy-7.1.3-sdk\renpy\python.py", line 1913, in py_exec_bytecode
exec bytecode in globals, locals
File "renpy/common/_layout/screen_main_menu.rpym", line 28, in <module>
python hide:
File "renpy/common/_layout/screen_main_menu.rpym", line 35, in _execute_python_hide
ui.interact()
File "C:\Users\Caro\Desktop\renpy-7.1.3-sdk\renpy\ui.py", line 289, in interact
rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
File "C:\Users\Caro\Desktop\renpy-7.1.3-sdk\renpy\display\core.py", line 2672, in interact
repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
File "C:\Users\Caro\Desktop\renpy-7.1.3-sdk\renpy\display\core.py", line 3059, in interact_core
root_widget.visit_all(lambda i : i.per_interact())
File "C:\Users\Caro\Desktop\renpy-7.1.3-sdk\renpy\display\core.py", line 531, in visit_all
d.visit_all(callback, seen)
File "C:\Users\Caro\Desktop\renpy-7.1.3-sdk\renpy\display\core.py", line 531, in visit_all
d.visit_all(callback, seen)
File "C:\Users\Caro\Desktop\renpy-7.1.3-sdk\renpy\display\core.py", line 531, in visit_all
d.visit_all(callback, seen)
File "C:\Users\Caro\Desktop\renpy-7.1.3-sdk\renpy\display\screen.py", line 424, in visit_all
callback(self)
File "C:\Users\Caro\Desktop\renpy-7.1.3-sdk\renpy\display\core.py", line 3059, in <lambda>
root_widget.visit_all(lambda i : i.per_interact())
File "C:\Users\Caro\Desktop\renpy-7.1.3-sdk\renpy\display\screen.py", line 434, in per_interact
self.update()
File "C:\Users\Caro\Desktop\renpy-7.1.3-sdk\renpy\display\screen.py", line 619, in update
self.screen.function(**self.scope)
File "game/screens.rpy", line 356, in execute
screen main_menu():
File "game/screens.rpy", line 356, in execute
screen main_menu():
File "game/screens.rpy", line 371, in execute
use navigation
File "game/screens.rpy", line 292, in execute
screen navigation():
File "game/screens.rpy", line 292, in execute
screen navigation():
File "game/screens.rpy", line 294, in execute
vbox:
File "game/screens.rpy", line 306, in execute
if second_menu:
File "<screen language>", line 306, in <module>
NameError: name 'second_menu' is not defined
Windows-8-6.2.9200
Ren'Py 7.1.3.1092
Test 1.0
Fri Jan 04 16:23:21 2019
And I have no idea what that means. Is this possible? Am I overlooking some other step?
UPDATE!
I tried it out without that part of code that was causing problems, and it worked flawlessly, even when combined with all the other weird code stuff I was going to do to have you get there! This is absolutely fantastic news! However, I noticed that it still has all the same buttons as the main menu- even the one I added to help you get there, so it must still be tagged as a main menu. Does this have anything to do with the "style prefix"? That's still set to "main_menu".
DOUBLE UPDATE: This seems to be the case for the background, as well as the buttons. The three things I want to change are the background, the music, and the buttons. I'll do some research into "style prefix"es, and see if I can work all this out myself.