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

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Message
Author
User avatar
rayminator
Regular
Posts: 187
Joined: Fri Feb 09, 2018 12:05 am
Projects: Redoing games to fix spelling mistakes other companys that don't care
Location: Canada
Contact:

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

#1 Post by rayminator » Sat Apr 07, 2018 6:40 pm

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
Last edited by rayminator on Sun Apr 08, 2018 4:24 pm, edited 2 times in total.
Image

User avatar
Ocelot
Miko-Class Veteran
Posts: 849
Joined: Tue Aug 23, 2016 10:35 am
Skype: miinipaa
Contact:

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

#2 Post by Ocelot » 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.
< < insert Rick Cook quote here > >

kivik
Miko-Class Veteran
Posts: 784
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

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

#3 Post by kivik » Sun Apr 08, 2018 5:33 am

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
Last edited by kivik on Sun Apr 08, 2018 7:18 am, edited 1 time in total.

User avatar
rayminator
Regular
Posts: 187
Joined: Fri Feb 09, 2018 12:05 am
Projects: Redoing games to fix spelling mistakes other companys that don't care
Location: Canada
Contact:

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

#4 Post by rayminator » Sun Apr 08, 2018 6:38 am

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
Image

User avatar
Remix
Eileen-Class Veteran
Posts: 1259
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: Choice menu how to hide it until finish one route

#5 Post by Remix » 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

    "..."
Mad Scientist Todo List:
  • Finish Improved Event Handler
  • Implement DragonBones animation as a Creator Defined Container
  • Develop Cartoon Speech Bubble dialogue
  • Finish Bitmask collision and rebound vector system
  • Develop time based building mechanic
  • Others
  • *Find a superb artist and actually write a game*

User avatar
rayminator
Regular
Posts: 187
Joined: Fri Feb 09, 2018 12:05 am
Projects: Redoing games to fix spelling mistakes other companys that don't care
Location: Canada
Contact:

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

#6 Post by rayminator » Sun Apr 08, 2018 10:33 am

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
Image

kivik
Miko-Class Veteran
Posts: 784
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

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

#7 Post by kivik » Sun Apr 08, 2018 11:19 am

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.

User avatar
Ocelot
Miko-Class Veteran
Posts: 849
Joined: Tue Aug 23, 2016 10:35 am
Skype: miinipaa
Contact:

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

#8 Post by Ocelot » 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
< < insert Rick Cook quote here > >

User avatar
rayminator
Regular
Posts: 187
Joined: Fri Feb 09, 2018 12:05 am
Projects: Redoing games to fix spelling mistakes other companys that don't care
Location: Canada
Contact:

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

#9 Post by rayminator » Sun Apr 08, 2018 11:32 am

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
Image

kivik
Miko-Class Veteran
Posts: 784
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

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

#10 Post by kivik » Sun Apr 08, 2018 11:37 am

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.

User avatar
rayminator
Regular
Posts: 187
Joined: Fri Feb 09, 2018 12:05 am
Projects: Redoing games to fix spelling mistakes other companys that don't care
Location: Canada
Contact:

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

#11 Post by rayminator » Sun Apr 08, 2018 11:39 am

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
Image

User avatar
Ocelot
Miko-Class Veteran
Posts: 849
Joined: Tue Aug 23, 2016 10:35 am
Skype: miinipaa
Contact:

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

#12 Post by Ocelot » 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.
< < insert Rick Cook quote here > >

User avatar
rayminator
Regular
Posts: 187
Joined: Fri Feb 09, 2018 12:05 am
Projects: Redoing games to fix spelling mistakes other companys that don't care
Location: Canada
Contact:

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

#13 Post by rayminator » Sun Apr 08, 2018 11:45 am

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?
Image

kivik
Miko-Class Veteran
Posts: 784
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

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

#14 Post by kivik » 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.

User avatar
rayminator
Regular
Posts: 187
Joined: Fri Feb 09, 2018 12:05 am
Projects: Redoing games to fix spelling mistakes other companys that don't care
Location: Canada
Contact:

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

#15 Post by rayminator » Sun Apr 08, 2018 11:54 am

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
Image

Post Reply

Who is online

Users browsing this forum: Bing [Bot]