• To improve security, we will soon start forcing password resets for any account that uses a weak password on the next login. If you have a weak password or a defunct email, please update it now to prevent future disruption.

Ren'Py Move to the main menu and the menu to save, language choice

Black Ram oss

Black Ram
Game Developer
May 10, 2018
582
1,543
On Ren'Py what is the code to print the version of the game and to move to the main menu and the menu to save?

How do I add the language choice in the settings?
 
  • Like
Reactions: Flower34234

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,219
14,973
On Ren'Py what is the code to print the version of the game
Code:
label whatever:
    $ print config.version
But something tell me that, in fact, what you want is not to print the version of the game.
So, what do you mean by "print", and when do you want it to appear ?


and to move to the main menu
Code:
label whatever:
    $ renpy.full_restart()
It's one way to move to the main menu. But do you really wanted it to restart the game, I can't say. So, perhaps that telling us from where you want to move to the main menu, and to do what, will lead to a more accurate answer.


and the menu to save?
At what moment ? Oh, and save what anyway ?


How do I add the language choice in the settings?
By doing as said on .
 

Black Ram oss

Black Ram
Game Developer
May 10, 2018
582
1,543
But something tell me that, in fact, what you want is not to print the version of the game.
So, what do you mean by "print", and when do you want it to appear ?
in this case:
Code:
label temporary_end_story:
    "This is the temporary end (current version:config.version). You'll have to wait new update."
    return

It's one way to move to the main menu. But do you really wanted it to restart the game, I can't say. So, perhaps that telling us from where you want to move to the main menu, and to do what, will lead to a more accurate answer.
I have also used this method, but I think that on android it gives problems.
Can be used at different moment even after a "call"

At what moment ? Oh, and save what anyway ?
Can be used at different moment even after a "call"
 
  • Like
Reactions: Flower34234

Black Ram oss

Black Ram
Game Developer
May 10, 2018
582
1,543
By doing as said on .
Code:
frame:

    style_prefix "pref"

    has vbox


    label _("Language")

    textbutton "English" action Language(None)

    textbutton "......." action Language("......")
I tried it, but it doesn't appear in the settings
I know I have to put it on screens, but I don't know when.
 
  • Like
Reactions: Flower34234

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,219
14,973
in this case:
Code:
label temporary_end_story:
    "This is the temporary end (current version:config.version). You'll have to wait new update."
    return
Well, you do like for any other variables :
Code:
label temporary_end_story:
    "This is the temporary end (current version: [config.version]). You'll have to wait new update."
    return
Obviously, but seem to be said, you've first to update the "option.rpy" file for config.version to be accurate.


I have also used this method, but I think that on android it gives problems.
It's not impossible, but I doubt.


Can be used at different moment even after a "call"
Which still don't explain why you want to go back to the main menu ; or what you're trying to achieve by doing this. Is it to end the play at the end of the update (after you've "print the version" above), is it to offer the possibility to save at a given moment ? Is it for something else ?


Can be used at different moment even after a "call"
Same than above. It don't explain what you want to save, nor why you want to do it.
 

Black Ram oss

Black Ram
Game Developer
May 10, 2018
582
1,543
to move to the main menu and the menu to save
Same than above. It don't explain what you want to save, nor why you want to do it.

I need it at the end of the current version to encourage the user to save.
but I'm not sure I want to encourage the user to save at that moment, because I would only use that screen in the first (introductory) beta and delete it in the second update
 
  • Like
Reactions: Flower34234

the66

beware, the germans are cumming
Modder
Respected User
Donor
Jan 27, 2017
7,618
23,606
return to the main menu:
the proper way would be $ renpy.run(MainMenu(confirm=False))
the fast way $ MainMenu(confirm=False)()
to save, as above:
proper $ renpy.run(ShowMenu('save'))
or $ ShowMenu('save')()
and btw, there is no restart on Android.
 
  • Love
Reactions: Black Ram oss

Black Ram oss

Black Ram
Game Developer
May 10, 2018
582
1,543
he left this code to help someone else in the same situation in the future:

Code:
# Temporary end of the story (then play other stories)
label temporary_end_story:
    "This is the temporary end (current version: [config.version]). You'll have to wait new update."
    return

# Temporary end of the game
label temporary_end_game:
    #TODO: immagine To be continue
    call temporary_end_story
    $ old_version = config.version
    "Save the game now and not later."
    $ ShowMenu('save')()

    if (old_version == config.version):
        "Pressing ENTER will return to the Main Menu."
        $ renpy.run(MainMenu(confirm=False))
    return
 
  • Like
Reactions: Flower34234