Page 5 of 13

Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana

Posted: Tue Sep 20, 2016 12:50 pm
by Meinos Kaen
Good morning from Italy :D

I was wondering: is it possible to use the event planner without the daily dispatcher?

What I mean is, I'd like in my game to use a map instead of the day planner as in: the player has access to certain locations and depending on the day of the week, time of the day and his stats certain events can happen.

So, more than not having the daily dispatcher it'd be showing it three times a day -morning, afternoon, night- and instead of showing the planner I'd show the map.

Edit: Okay, I think I could do this by making, at the start of every period, call a different screen depending on the value of a variable called Time. 1 for Morning Screen, 2 for Afternoon Screen, 3 for Evening Screen. And I could make it so that each location would make the player jump to an 'act' where the check for stats, time and day would happen. Did I forget anything?

I think the only thing missing is: how do I make a rotating list for a WeekDays variable? O_O

Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana

Posted: Tue Sep 20, 2016 5:11 pm
by qirien
Yes, I think what you're proposing would work - basically, you have 3 different day planners, with a map interface instead of buttons.

What do you mean by a rotating list?

Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana

Posted: Wed Sep 21, 2016 5:12 am
by philat
Modulo.

Code: Select all

if WeekDays % 7 == 1:
    # Sunday
elif WeekDays % 7 == 2:
    # Monday 
...
and so forth.

Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana

Posted: Wed Sep 21, 2016 7:23 am
by Meinos Kaen
philat wrote:Modulo.

Code: Select all

if WeekDays % 7 == 1:
    # Sunday
elif WeekDays % 7 == 2:
    # Monday 
...
and so forth.
Basically this :3 So, from a still learning guy, what does the % 7 stand for?

Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana

Posted: Wed Sep 21, 2016 2:02 pm
by qirien
It means "the remainder after dividing by 7". So:
1 % 7 = 1
2 % 7 = 2
3 % 7 = 3
...
7 % 7 = 0
8 % 7 = 1
...
26 % 7 = 5

Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana

Posted: Wed Sep 21, 2016 3:39 pm
by Meinos Kaen
qirien wrote:It means "the remainder after dividing by 7". So:
1 % 7 = 1
2 % 7 = 2
3 % 7 = 3
...
7 % 7 = 0
8 % 7 = 1
...
26 % 7 = 5
So basically that'd... Take away 7 from the total number of days passed from the start of the game as many time as possible and then use the remainder ones to calculate what day it is. Got it.

So a possible code would be something like this?

Code: Select all

if WeekDays % 7 == 0:
     DayOfTheWeek = Sunday

if WeekDays % 7 == 1:
     DayOfTheWeek = Monday
And so on?

Edit: No, wait, elif is needed. So...

Code: Select all

if WeekDays % 7 == 0:
     DayOfTheWeek = Sunday
elif WeekDays % 7 == 1:
     DayOfTheWeek = Monday
Would I need to set up the DayOfTheWeek variable at the start of the script with an init or initpython?

Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana

Posted: Wed Sep 21, 2016 5:26 pm
by qirien
Yeah, you got it! The elif is slightly more efficient but the other one would work, too.

It's generally a good idea to initialize all your variables in one place; not only does that help you keep track of what variables you're using, but it also makes sure that you don't get any errors from uninitialized variables. You can do that in a python init section, or use Ren'Py's "define" statement.

Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana

Posted: Sun Nov 20, 2016 9:40 pm
by DMKalwin
I have a question about customizing the day planner. I have the labels with the days of the week across the top of the planner with the buttons going down from there. I have been trying to make the days of the week go up to down with the buttons for locations go left to right, but can't seem to figure it out. Any ideas?

Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana

Posted: Tue Nov 22, 2016 12:28 pm
by qirien
This isn't too hard to do. Basically you want to open up day_planner.rpy and swap some of the hboxes and vboxes in the display_planner screen.

An hbox is a horizontal box, which means it will lay the things you give it out next to each other. A vbox is a vertical box, meaning it will lay things out below each other.

When you're done, your code for the display_planner screen will look something like this:

Code: Select all

screen display_planner(periods):            
    frame:
        style_group "dp"        
        vbox:
            text "Day Planner" yalign 0.0 xalign 0.5
            vbox:
                $ can_continue = True
                for p in periods:
                    hbox:
                        xalign 1.0
                        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
                        hbox:
                            style_group "dp_choice"
                            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"


Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana

Posted: Fri Nov 25, 2016 12:13 pm
by DMKalwin
Thank you! I was looking at vbox and hbox but didn't think of that code section needed to change, thanks again!

Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana

Posted: Sat Dec 10, 2016 4:59 pm
by FangOfDrknss
This engine is the kind of 'feel' I've been looking for, ever since I've given Ren'py an actual try, awhile ago. The Day planner's layout works great as is, but I was wondering if one of the choices can be swapped for 'Visit' or 'Date', which clicking on it would take it to a planner with that label, and in place of the choices are names.

Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana

Posted: Sat Dec 10, 2016 8:15 pm
by qirien
Yes, you could certainly do that. The easiest way would be to have "Visit X" "Visit Y" and "Visit Z" be options for that time period. You can do that by modifying the main.rpy and changing/adding the dp_choice lines to be whatever you want. You can even add flags like "show=met_Y" to only show an option after they've met a certain person.

If you wanted to make a separate screen pop up when they click "Visit" or "Date", you could do that but it would take a lot more modification. The file to start at for that is day_planner.rpy.

Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana

Posted: Sun Dec 11, 2016 7:43 pm
by FangOfDrknss
Both methods are worth looking into, but the first is definitely more of what I want. Especially with having the option appear with flags. Thanks.

Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana

Posted: Mon Jan 09, 2017 7:51 pm
by aliishaq
wow ... thanks qirien. its awesome sim engine. i'll try it.

Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana

Posted: Wed Jan 11, 2017 4:44 am
by awurawuran
Hi thanks for this very nice DSE.