Dating Sim Engine (DSE) 4.0! Day Planner and Event Manager

A place for Ren'Py tutorials and reusable Ren'Py code.
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.
Message
Author
User avatar
arowon
Newbie
Posts: 2
Joined: Fri Feb 10, 2017 11:56 am
Tumblr: mostlikelytomorrow
Deviantart: karuni17
Contact:

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

#76 Post by arowon » Fri Feb 10, 2017 5:38 pm

Thanks for the nice dating sim engine.
I was just wondering how to limit the number of days you have to reach a certain goal? :)

User avatar
qirien
Veteran
Posts: 425
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
Location: New Mexico, USA
Contact:

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

#77 Post by qirien » Mon Feb 13, 2017 2:09 pm

Well, you could easily put a check in to see what day it is, and jump to an end sequence at that point.

For example, in the sample code's main.rpy, when you increment the day, you could add something like this (set MAX_DAYS to however many days you want to run):

Code: Select all

    if (day >= MAX_DAYS):
        jump ending
and later have:

Code: Select all

label ending:
    if ((strength >= 100) and (intelligence >= 100)):
        jump superhero_ending
    elif (strength >= 100):
        jump strong_ending
    elif (intelligence >= 100):
        jump smart_ending
    else:
        jump slacker_ending
Does that make sense?
Finished games:
Image
Image
Image
In progress: Our Personal Space 2: Space to Grow

User avatar
arowon
Newbie
Posts: 2
Joined: Fri Feb 10, 2017 11:56 am
Tumblr: mostlikelytomorrow
Deviantart: karuni17
Contact:

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

#78 Post by arowon » Wed Feb 15, 2017 1:14 pm

Yeah, I'll try that. Thank you so much for your help. :)

User avatar
aliishaq
Newbie
Posts: 4
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

#79 Post by aliishaq » Thu Feb 16, 2017 10:21 pm

Hi, ... i'd try it, but i have problem when i use event.choose_one and event.solo together, is they can't work together? coz if i use event solo, the event.choose_one not working. Any solution?

Code: Select all

    $ event("sekolah1", "act =='01class'", event.choose_one('01class'), event.solo(), priority=200)
    $ event("sekolah2", "act =='01class'", event.choose_one('01class'), event.solo(), priority=200)
the event.choose_one just call first label only.

User avatar
qirien
Veteran
Posts: 425
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
Location: New Mexico, USA
Contact:

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

#80 Post by qirien » Fri Feb 17, 2017 1:41 pm

Yes, solo is meant for a single event, so you can't really use it with choose_one. Instead, you could change the priority on the events. The system will prefer events with a lower priority number, so if you have other events you want it to pick and only use these if none of those match, set those events to have a lower priority value.

Would that work for what you want to do?
Finished games:
Image
Image
Image
In progress: Our Personal Space 2: Space to Grow

User avatar
aliishaq
Newbie
Posts: 4
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

#81 Post by aliishaq » Tue Feb 21, 2017 9:55 pm

I Use for DSE 3.11.
Okay .. thank you Qirien.

Pneumonica
Newbie
Posts: 1
Joined: Sun Mar 19, 2017 12:13 pm
Contact:

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

#82 Post by Pneumonica » Fri Mar 24, 2017 11:31 pm

While calling the day_planner, I get the following exception.

Code: Select all

While running game code:
  File "game/script.rpy", line 144, in script
    call screen day_planner(["Wee Hours","Early Dawn","Morning", "Afternoon", "Evening","Night"])
  File "renpy/common/000statements.rpy", line 471, in execute_call_screen
    store._return = renpy.call_screen(name, *args, **kwargs)
  File "game/scheduling.rpy", line 50, in execute
    screen day_planner(periods):
  File "game/scheduling.rpy", line 50, in execute
    screen day_planner(periods):
  File "game/scheduling.rpy", line 53, in execute
    window:
  File "game/scheduling.rpy", line 56, in execute
    use display_planner(periods)
  File "game/scheduling.rpy", line 58, in execute
    screen display_planner(periods):
  File "game/scheduling.rpy", line 58, in execute
    screen display_planner(periods):
  File "game/scheduling.rpy", line 59, in execute
    frame:
  File "game/scheduling.rpy", line 61, in execute
    vbox:
  File "game/scheduling.rpy", line 63, in execute
    hbox:
  File "game/scheduling.rpy", line 65, in execute
    for p in periods:
  File "game/scheduling.rpy", line 66, in execute
    vbox:
  File "game/scheduling.rpy", line 71, in execute
    $ selected_choice = getattr(store, this_period.var)
  File "game/scheduling.rpy", line 71, in <module>
    $ selected_choice = getattr(store, this_period.var)
AttributeError: 'StoreModule' object has no attribute 'early_act'
What is causing this? I can't figure out how to make it not do this.

User avatar
qirien
Veteran
Posts: 425
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
Location: New Mexico, USA
Contact:

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

#83 Post by qirien » Tue Apr 04, 2017 12:43 pm

Sorry for the delay; I've been out of town.

At the very end, it says "'StoreModule' object has no attribute 'early_act'". Would you look at where you are defining the different events and see if you can find any errors in that code? It looks like perhaps you did not register that period with dp_period in main.rpy. Perhaps you could paste in the relevant code from main.rpy here.
Finished games:
Image
Image
Image
In progress: Our Personal Space 2: Space to Grow

User avatar
qirien
Veteran
Posts: 425
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
Location: New Mexico, USA
Contact:

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

#84 Post by qirien » Wed Apr 05, 2017 1:26 pm

Version 3.12 is now out!
https://github.com/renpy/dse/releases/tag/3.12

Thanks to Pneumonica for the new hidden stat feature.
Finished games:
Image
Image
Image
In progress: Our Personal Space 2: Space to Grow

Ceiyne
Newbie
Posts: 8
Joined: Thu Apr 13, 2017 9:57 am
Contact:

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

#85 Post by Ceiyne » Thu Apr 13, 2017 11:27 am

First of all, thank you for creating this. Although I have a programming background, I'm a complete noob when it comes to Ren'Py (for that matter, Python too, lol) and it's a huge help to avoid having to write all of this logic myself. I'm starting to think about how to approach my first Ren'Py/DSE game and I am worried about starting off with a bad design that becomes a nightmare to deal with later on. I'm hoping I can draw on your experience and avoid this. :)

I initially thought that I'd create a series of generic stat building events which would always run when the player scheduled them, and then during the same period other events might also run if their criteria were met. This means I would not be using event.solo() or event.only() for most events, since both types of events would need to be able to occur in the same period, like:

"Afternoon" period
  1. Show generic study animation and increase intelligence stat
  2. Show scene "X" with character "Y" based on some criteria that has been met
  3. Period end
The sample DSE code seems to take a different approach, where most events are solo or only. For studying, there's a basic study event that's only used the first time, followed by a series of different events that successively override each other as their criteria are met. Sometimes these events allow for studying to occur, and sometimes studying is interrupted by what happens in the event. For events that allow studying, the stat changes are coded into each of those individual events. For a longer game it could become a potential maintenance issue to copy the stat changing code across all of the events, although you could probably use a function to deal with this. This design also means you can't study if there are any other events that occur and there may be short events where I would want to allow the player to continue with their planned activity for the period.

Having said all that, I feel like my initial approach above also has some potential issues. For instance, if I want certain events to interrupt studying (like the "borrow_pen" or "bookslide" events in the sample code), I'd have to use event.solo() with a higher priority to avoid running the generic study event. But then I'd be stuck if I ever need some other event to run in the same period (e.g., if I wanted to show events "A" and "B" but not the generic study event). Another potential pitfall would be special events that affected the stat changes (e.g., to provide a bigger or smaller stat change). And finally, since this design allows for many events to run in a single period, there may be situations where a completely unrealistic number of events trigger at once. I might be able to work around some of these issues (in particular the last two) with some extra code, but then again, maybe these issues are a sign I'm using DSE wrong. :)

What are your thoughts on the best way to approach this?

User avatar
qirien
Veteran
Posts: 425
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
Location: New Mexico, USA
Contact:

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

#86 Post by qirien » Tue Apr 18, 2017 1:21 pm

Hey, sorry for the delay, I've been thinking about your question...

The truth is, either way would work, but the approach you choose will affect how you structure your game.

It might be best to have an outline of events first, and then you can make sure that the structure you're choosing matches the way you want your game to go. And, yes, you will be somewhat limited by the approach you choose, but it will probably still be easier than coding it all by hand manually.

Remember that you can use "jump events_end_period" any time you want to skip the rest of the events for a period.

One thing you may want to consider is dividing up your "afternoon" into two separate periods: "afternoon1" and "afternoon2". Maybe afternoon1 always has 1 event, which is usually just studying, and afternoon2 might have no events or several events depending on criteria?

If you have some more specifics, let me know and I can take a look and try to help. I hope this is a little bit helpful!
Finished games:
Image
Image
Image
In progress: Our Personal Space 2: Space to Grow

Ceiyne
Newbie
Posts: 8
Joined: Thu Apr 13, 2017 9:57 am
Contact:

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

#87 Post by Ceiyne » Tue Apr 18, 2017 4:42 pm

Thanks for thinking it through and getting back to me. I'll try to plan things out a bit and go with the solution that best fits my events, as you recommended. The "afternoon1" and "afternoon2" type of idea had crossed my mind as well so I will probably incorporate that too.

Ceiyne
Newbie
Posts: 8
Joined: Thu Apr 13, 2017 9:57 am
Contact:

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

#88 Post by Ceiyne » Tue Apr 18, 2017 5:58 pm

Sorry, but I have another question. The quick version is - do I need to do anything special to make the day planner work with the new GUI? Given that I'm new to Ren'py I can't tell if I've made a dumb mistake or not. :) Here are the details behind my question...

In my earlier experiments, I had been playing around by just adding code to the original DSE files. Just now I decided to start fresh and created a new project with "+Create New Project" in Ren'py. I checked the skeleton VN that Ren'py creates and as expected everything worked fine. Next, to get the DSE, I copied the following DSE files into my new project:

day_planner.rpy
event_dispatcher.rpy
events.rpy
main.rpy
stats.rpy
styles.rpy

I got rid of the Ren'py-generated script.rpy and renamed the DSE main.rpy to script.rpy (just to follow the same naming convention), so I would have just one start label.

I didn't copy options.rpy from the DSE because Ren'py generated an options.rpy when I created the project.

When I launched the project, the first few bits worked. However, when I got to the day planner screen, the stats were at the bottom of the screen instead of the top and there was no day planner at all (see attachment for screenshot).

At this point I thought that maybe I had broken something by not copying the DSE options.rpy. I tried two things: a) copied DSE/options.rpy to my new project and replacing the Ren'py options.rpy, and b) copied DSE/options.rpy over as options2.rpy, leaving the Ren'py generated options.rpy in place. Although both of these attempts had an impact (for instance the window resolution was different) neither fixed the day planner screen.

Any ideas?
Attachments
dse.jpg

User avatar
qirien
Veteran
Posts: 425
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
Location: New Mexico, USA
Contact:

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

#89 Post by qirien » Wed Apr 19, 2017 2:07 pm

Ooh, good question. I wasn't sure if I should redo it to use the new GUI or not... I've been trying to keep it as small as possible, so I didn't want to just include all the new gui files.

I have checked in a new version that should be compatible with the old or new GUI. The only files that have changed are styles.rpy and day_planner.rpy. Would you give it a try and make sure it works for you, too?

You can download the latest version (I haven't made it a new release yet) from GitHub by clicking the green "Clone or Download" button.
Finished games:
Image
Image
Image
In progress: Our Personal Space 2: Space to Grow

Ceiyne
Newbie
Posts: 8
Joined: Thu Apr 13, 2017 9:57 am
Contact:

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

#90 Post by Ceiyne » Wed Apr 19, 2017 2:14 pm

Thank you! I will check it out now and let you know.

Post Reply

Who is online

Users browsing this forum: No registered users