Lemma Soft Forums

Supporting creators of visual novels and story-based games since 2003.


Visit our new games list, blog aggregator, IRC, and wiki.
Activation problem? Email [email protected]
It is currently Sat May 25, 2013 8:42 pm

All times are UTC - 5 hours [ DST ]


Forum rules


Ask questions about one topic per thread, and use a descriptive subject. "NotImplemented error in script.rpy" is a good subject, "Tom's problems" is not. Remember to include all of traceback.txt or error.txt when reporting a problem, as well as the relevant lines of script. Use the [code] tag to format scripts.



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Fri May 06, 2011 4:43 pm 
Newbie

Joined: Fri May 06, 2011 4:00 pm
Posts: 1
Hello there!
I need to make two different kinds of main menu, that will be showing depending on variable value, but i don't really understand how to do it. -__-
For example, i have 4 different endings in the game. Playing trough each of them sets variable+1. When all of endings are opened and variable=4 main menu switches for the other one, with different bg, music and additional "Epilogue" button. (something like Tsukihime or Fate/stay night Réalta Nua)


Top
 Profile Send private message  
 
PostPosted: Fri May 06, 2011 5:50 pm 
Regular
User avatar

Joined: Wed Oct 20, 2010 12:34 am
Posts: 92
Location: Spokane, WA
With screen language, you could use the "if statement" for that.

Code:
screen main_menu:

    # This ensures that any other menu screen is replaced.
    tag menu

    # The background of the main menu.
    window:
        style "mm_root"

    # The main menu buttons.
    frame:
        style_group "mm"
        xalign .98
        yalign .98

        has vbox

        textbutton _("Start Game") action Start()
        textbutton _("Load Game") action ShowMenu("load")
        if variable = 4:
            textbutton_("Extra") action ShowMenu("extra")
        textbutton _("Preferences") action ShowMenu("preferences")
        textbutton _("Help") action Help()
        textbutton _("Quit") action Quit(confirm=False)

init python:

    # Make all the main menu buttons be the same size.
    style.mm_button.size_group = "mm"


Ren Py' won't show that button until "variable" dose equal 4.

_________________
The artist's world is limitless. It can be found anywhere, far from where he lives or a few feet away. It is always on his doorstep.
--Paul Strand


Top
 Profile Send private message  
 
PostPosted: Sat May 07, 2011 12:41 am 
Miko-Class Veteran

Joined: Mon Nov 01, 2010 9:10 pm
Posts: 832
I think they mean more of something like this (an example):

Image
The Main Menu looks like this and plays a certan BGM when you first start

Image
But then it looks like this and plays an entirely diffrent BGM when you've gotten all the endings/good end/true end

_________________
I have moved to a new account. Please contact me here from now on. T/Y~


Top
 Profile Send private message  
 
PostPosted: Sat May 07, 2011 12:13 pm 
Veteran
User avatar

Joined: Wed Nov 18, 2009 11:17 am
Posts: 359
Location: Germany
Completed: Loren
Projects: PS2
It works even for the whole screen, I would recommend the following structure:
Code:
screen main_menu:

    # This ensures that any other menu screen is replaced.
    tag menu

    if variable == 0:
        use main_menu_1
    else:
        use main_menu_2

Where main_menu_1 and main_menu_2 are screens you define elsewhere.

Alternatively, store the screen you want to use inside the variable.
Code:
screen main_menu:

    # This ensures that any other menu screen is replaced.
    tag menu

    use variable

_________________
Avatar created with this deviation by Crysa
Currently working on:
  • Winterwolves "Planet Stronghold 2" - RPG Framework: Phase II


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: Mimrose


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Protected by Anti-Spam ACP
Powered by phpBB® Forum Software © phpBB Group