Dating Sim Engine - how to remove the "done planning" button?

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.
Post Reply
Message
Author
LightAndDark
Newbie
Posts: 12
Joined: Tue Jan 09, 2018 7:25 am
Contact:

Dating Sim Engine - how to remove the "done planning" button?

#1 Post by LightAndDark »

Hello all,
I am using the DSE and I have split the day planner into separate parts for each time period. So in the morning you do not pick what you're going to do in the evening, you only pick the morning activity.

Then in the evening, the planner appears again and asks what you want to do in the evening.

As a result, I want to get rid of the "done planning" button because it's redundant as the user is only picking one single option at any given time. How can I do this without breaking the script?

Obviously I can't just delete the button itself because then the player wouldn't be able to progress, they need to be able to proceed just by clicking the option.

Code: Select all

# Our Day Planner displays the stats, and buttons for the user to choose
# what to do during each period of time defined in "periods".
screen day_planner(periods):  
    # indicate to Ren'Py engine that this is a choice point
    $ renpy.choice_for_skipping()
    frame:
        style "dayplanner_frame"          
        use display_stats(name=True, bar=True, value=True, max=True)
        use display_planner(periods)
            
screen display_planner(periods):            
    frame:
        style_group "dp"        
        vbox:
            text "Day Planner" yalign 0.0 xalign 0.5
            hbox:
                $ can_continue = True
                for p in periods:
                    vbox:
                        label p
                        if p not in __periods:
                            $ raise Exception("Period %r was never defined." % p)
                        $ this_period = __periods[p]
                        $ selected_choice = getattr(store, this_period.var)

                        $ valid_choice = False
                        vbox:
                            style "dp_choice_vbox"                                                    
                            for name, curr_val, enable, should_show in this_period.acts:
                                $ show_this = eval(should_show)
                                $ enable = eval(enable)

                                $ selected = (selected_choice == curr_val)
                        
                                if show_this:
                                    if enable:
                                        textbutton name action SetField(store, this_period.var, curr_val)
                                    else:
                                        textbutton name
            
                                if show_this and enable and selected:
                                    $ valid_choice = True

                            if not valid_choice:
                                $ can_continue = False
                                    
            if (can_continue):
                textbutton dp_done_title style "dp_done_button" action Return()
            else:
                textbutton dp_done_title style "dp_done_button"

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Dating Sim Engine - how to remove the "done planning" button?

#2 Post by Alex »

Looks like this action Return() is necessary to progress the game. So, if you don't need it as a separete button just add this action to the choice button. Try something like

Code: Select all

                               if show_this:
                                    if enable:
                                        textbutton name action [SetField(store, this_period.var, curr_val), Return()]
(you can set a list of actions for buttons/hotspots)

Post Reply

Who is online

Users browsing this forum: No registered users