Page 1 of 2

[Solved]Choice menu how to hide it until finish one route

Posted: Sat Apr 07, 2018 6:40 pm
by rayminator
I have search through about 31 pages and try a search bot all i get a white page

so I found one page that I thought it might help but it didn't help

hope someone one can help

how do I hide a choice menu until at least 1 route have been seen

Code: Select all

default rout1_seen = False
default route3_seen = False
default main_seen = False


label start:

    menu:
        nav "selection"
        "Start from beginning":
            $ main_seen = True
            jump beginning
        "Start from after OP":
            $ main_seen = True
            jump op
        "Extra scenario 1":
            $ route1_seen = True
            jump extra1
        "Extra scenario 2":
            $ route3_seen = True
            jump extra2

    return

Re: Choice menu how to hide it until finish one route

Posted: Sun Apr 08, 2018 3:45 am
by Ocelot
Do you need to skip whole menu? Add an "if" statement before it checking if at least one route was seen and jump directly to beginning if not.

Re: Choice menu how to hide it until finish one route

Posted: Sun Apr 08, 2018 5:33 am
by kivik
This page has what you need. I googled "Renpy choices" to find it, as it's often easier to find exactly what you need :)

Note the if statement at the bottom example.

Since your code wouldn't work and just serves as an example, I'm only including the menu block below to show the concept:

Code: Select all

    menu:
        nav "selection"
        "Start from beginning":
            $ main_seen = True
            jump beginning
        "Start from after OP":
            $ main_seen = True
            jump op
        "Extra scenario 1" if main_seen:
            $ route1_seen = True
            jump extra1
        "Extra scenario 2" if route1_seen:
            $ route3_seen = True
            jump extra2

Re: Choice menu how to hide it until finish one route

Posted: Sun Apr 08, 2018 6:38 am
by rayminator
Ocelot wrote: Sun Apr 08, 2018 3:45 am Do you need to skip whole menu? Add an "if" statement before it checking if at least one route was seen and jump directly to beginning if not.
what i want is for the choice menu to be hidden meaning is locked until common route , route1 and route3 have been seen

Re: Choice menu how to hide it until finish one route

Posted: Sun Apr 08, 2018 10:26 am
by Remix
You could probably get away with just calling the menu by name... untested though:

Code: Select all

menu path_choices:
    nav "selection"
    "Start from beginning":
        $ main_seen = True
        jump beginning
    "Start from after OP":
        $ main_seen = True
        jump op
    "Extra scenario 1":
        $ route1_seen = True
        jump extra1
    "Extra scenario 2":
        $ route3_seen = True
        jump extra2

label start:

    if some_condition:
        call path_choices

    "..."

Re: Choice menu how to hide it until finish one route

Posted: Sun Apr 08, 2018 10:33 am
by rayminator
Remix wrote: Sun Apr 08, 2018 10:26 am You could probably get away with just calling the menu by name... untested though:

Code: Select all

menu path_choices:
    nav "selection"
    "Start from beginning":
        $ main_seen = True
        jump beginning
    "Start from after OP":
        $ main_seen = True
        jump op
    "Extra scenario 1":
        $ route1_seen = True
        jump extra1
    "Extra scenario 2":
        $ route3_seen = True
        jump extra2

label start:

    if some_condition:
        call path_choices

    "..."
thanks for the help but it didn't work the menu still shows up

Re: Choice menu how to hide it until finish one route

Posted: Sun Apr 08, 2018 11:19 am
by kivik
rayminator wrote: Sun Apr 08, 2018 10:33 am thanks for the help but it didn't work the menu still shows up
Can you describe what the outcome would should look like so we know exactly what you're trying to do?

You haven't replied to my suggestion so I don't know if you've seen / tried it, but I thought I had the solution of what you're asking for.

Re: Choice menu how to hide it until finish one route

Posted: Sun Apr 08, 2018 11:25 am
by Ocelot
SO why cannot you simply jump over the menu?

Code: Select all

label start:
    if not (route1_seen and route2_seen and route3_seen):
        jump beginning
    menu:
# The rest

Re: Choice menu how to hide it until finish one route

Posted: Sun Apr 08, 2018 11:32 am
by rayminator
say that you just started the game for the first time and there is NO CHOICE MENU then you have finish the first route then you start a new game again there is a choice menu

so when you start the game there is no menu until the first route has been seen

feels like i am repeat myself

okay if you have played Wanko to Kurasou you should know what i mean
Wanko to Kurasou

kivik

i have tried it and it didn't work

Re: Choice menu how to hide it until finish one route

Posted: Sun Apr 08, 2018 11:37 am
by kivik
Right, so you're saying once an ENDING has been experienced, then you get a choice menu? You've not mentioned anything about new game till now that's why we're all so lost as to what you're trying to achieve :)

You'll need persistent variables for that then, have a look at this.

Re: Choice menu how to hide it until finish one route

Posted: Sun Apr 08, 2018 11:39 am
by rayminator
Ocelot wrote: Sun Apr 08, 2018 11:25 am SO why cannot you simply jump over the menu?

Code: Select all

label start:
    if not (route1_seen and route2_seen and route3_seen):
        jump beginning
    menu:
# The rest
tried that it gave me this

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 40, in script
    if not (route1_seen and route2_seen and route3_seen):
  File "game/script.rpy", line 40, in <module>
    if not (route1_seen and route2_seen and route3_seen):
NameError: name 'route1_seen' is not defined

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/script.rpy", line 40, in script
    if not (route1_seen and route2_seen and route3_seen):
  File "G:\renpy\renpy-6.99.14.1-sdk\renpy\ast.py", line 1702, in execute
    if renpy.python.py_eval(condition):
  File "G:\renpy\renpy-6.99.14.1-sdk\renpy\python.py", line 1843, in py_eval
    return py_eval_bytecode(code, globals, locals)
  File "G:\renpy\renpy-6.99.14.1-sdk\renpy\python.py", line 1836, in py_eval_bytecode
    return eval(bytecode, globals, locals)
  File "game/script.rpy", line 40, in <module>
    if not (route1_seen and route2_seen and route3_seen):
NameError: name 'route1_seen' is not defined

Windows-8-6.2.9200
Ren'Py 6.99.14.1.3218
Wanko to Kurasou 1.0
Sun Apr 08 11:37:26 2018

Code: Select all

if not (route1_seen and route2_seen and route3_seen):
        jump beginning
    menu path_choices:
        nav "selection"
        "Start from beginning":
            $ main_seen = True
            jump beginning
        "Start from after OP":
            $ main_seen = True
            jump op
        "Risa extra scenario":
            $ route1_seen = True
            jump extra1
        "Kana & Kuu extra scenario":
            $ route3_seen = True
            jump extra2

    return

Re: Choice menu how to hide it until finish one route

Posted: Sun Apr 08, 2018 11:43 am
by Ocelot
Objiously, you should replace route1_seen and others with actual variables used to determine which route you have already seen.

Re: Choice menu how to hide it until finish one route

Posted: Sun Apr 08, 2018 11:45 am
by rayminator
Ocelot wrote: Sun Apr 08, 2018 11:43 am Objiously, you should replace route1_seen and others with actual variables used to determine which route you have already seen.
okay but how do you do that?

Re: Choice menu how to hide it until finish one route

Posted: Sun Apr 08, 2018 11:50 am
by kivik
Look up persistent variables - if you want to unlock a menu after a player has played through the game through a path, you need to store the variable inside the persistent object - it's the only thing that remains the same throughout different play throughs.

If you store it in a normal variable, then once the player restarts the game, it'll reset to False.

Re: Choice menu how to hide it until finish one route

Posted: Sun Apr 08, 2018 11:54 am
by rayminator
kivik wrote: Sun Apr 08, 2018 11:50 am Look up persistent variables - if you want to unlock a menu after a player has played through the game through a path, you need to store the variable inside the persistent object - it's the only thing that remains the same throughout different play throughs.

If you store it in a normal variable, then once the player restarts the game, it'll reset to False.
tried that

its not what I want the menu has to stay there when the play starts a new game cause when the first route has been done it goes to the main menu so if the player wishes to play the other routes he doesn't have have to replay the first route

but I try again

last time i have tried it last night after finishing the first route it didn't reappear