Dating Sim Engine (DSE) 4.1! Day Planner and Event Manager
Forum rules
Do not post questions here!
This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Do not post questions here!
This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
- Meinos Kaen
- Regular
- Posts: 107
- Joined: Wed Jan 04, 2012 1:01 pm
- Completed: JPDE - Sonata of Fire
- Projects: JPDE, Ars Oratoria, ONHA
- Skype: therealmeinoskaen
- Location: Somewhere in Italy...
- Contact:
Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana
Good morning from Italy
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
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
- qirien
- Miko-Class Veteran
- Posts: 541
- Joined: Thu Jul 31, 2003 10:06 pm
- Organization: Metasepia Games
- Deviantart: qirien
- Github: qirien
- itch: qirien
- Location: New Mexico, USA
- Discord: qirien
- Contact:
Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana
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?
What do you mean by a rotating list?
Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana
Modulo.
and so forth.
Code: Select all
if WeekDays % 7 == 1:
# Sunday
elif WeekDays % 7 == 2:
# Monday
...
- Meinos Kaen
- Regular
- Posts: 107
- Joined: Wed Jan 04, 2012 1:01 pm
- Completed: JPDE - Sonata of Fire
- Projects: JPDE, Ars Oratoria, ONHA
- Skype: therealmeinoskaen
- Location: Somewhere in Italy...
- Contact:
Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana
Basically this :3 So, from a still learning guy, what does the % 7 stand for?philat wrote:Modulo.
and so forth.Code: Select all
if WeekDays % 7 == 1: # Sunday elif WeekDays % 7 == 2: # Monday ...
- qirien
- Miko-Class Veteran
- Posts: 541
- Joined: Thu Jul 31, 2003 10:06 pm
- Organization: Metasepia Games
- Deviantart: qirien
- Github: qirien
- itch: qirien
- Location: New Mexico, USA
- Discord: qirien
- Contact:
Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana
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
1 % 7 = 1
2 % 7 = 2
3 % 7 = 3
...
7 % 7 = 0
8 % 7 = 1
...
26 % 7 = 5
- Meinos Kaen
- Regular
- Posts: 107
- Joined: Wed Jan 04, 2012 1:01 pm
- Completed: JPDE - Sonata of Fire
- Projects: JPDE, Ars Oratoria, ONHA
- Skype: therealmeinoskaen
- Location: Somewhere in Italy...
- Contact:
Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana
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.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 a possible code would be something like this?
Code: Select all
if WeekDays % 7 == 0:
DayOfTheWeek = Sunday
if WeekDays % 7 == 1:
DayOfTheWeek = Monday
Edit: No, wait, elif is needed. So...
Code: Select all
if WeekDays % 7 == 0:
DayOfTheWeek = Sunday
elif WeekDays % 7 == 1:
DayOfTheWeek = Monday
- qirien
- Miko-Class Veteran
- Posts: 541
- Joined: Thu Jul 31, 2003 10:06 pm
- Organization: Metasepia Games
- Deviantart: qirien
- Github: qirien
- itch: qirien
- Location: New Mexico, USA
- Discord: qirien
- Contact:
Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana
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.
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
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?
- qirien
- Miko-Class Veteran
- Posts: 541
- Joined: Thu Jul 31, 2003 10:06 pm
- Organization: Metasepia Games
- Deviantart: qirien
- Github: qirien
- itch: qirien
- Location: New Mexico, USA
- Discord: qirien
- Contact:
Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana
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:
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
Thank you! I was looking at vbox and hbox but didn't think of that code section needed to change, thanks again!
-
- Newbie
- Posts: 2
- Joined: Sat Dec 10, 2016 4:49 pm
- Contact:
Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana
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.
- qirien
- Miko-Class Veteran
- Posts: 541
- Joined: Thu Jul 31, 2003 10:06 pm
- Organization: Metasepia Games
- Deviantart: qirien
- Github: qirien
- itch: qirien
- Location: New Mexico, USA
- Discord: qirien
- Contact:
Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana
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.
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.
-
- Newbie
- Posts: 2
- Joined: Sat Dec 10, 2016 4:49 pm
- Contact:
Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana
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.
- aliishaq
- Newbie
- Posts: 6
- Joined: Sun Jan 08, 2017 8:03 pm
- Completed: Gulungan Pengembara & Puteri
- Projects: Sim VN Setia
- Contact:
Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana
wow ... thanks qirien. its awesome sim engine. i'll try it.
- awurawuran
- Newbie
- Posts: 3
- Joined: Wed Jan 11, 2017 4:23 am
- Contact:
Re: Dating Sim Engine (DSE) 3.11! Day Planner and Event Mana
Hi thanks for this very nice DSE.
Who is online
Users browsing this forum: No registered users