Page 1 of 13

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

Posted: Wed Apr 08, 2015 2:50 pm
by qirien

One common element of simulation-style VNs is a planner of some kind where you choose between various options for different things. Then the game decides what events happen based on things you've already done, statistics, affection points, or things like that. This framework should make it easier for game writers to do that.

PyTom wrote the original version, but I wanted to integrate it with screens for Our Personal Space, so I updated it.
screenshot0002.png
Sample Daily Planner
It includes a sample game that shows how to define periods of time, when events should happen, and things like that. The sample code has lots of comments and explains things pretty well, so please start there to learn how to use it. The main files you will want to change are:
  • main.rpy - This has the "start" label in it which is where the game starts.
  • events.rpy - This is where all the events are defined.
  • styles.rpy - If you want to change how it looks.
Documentation is provided as comments inside each file, for now. If you would like to improve the documentation, I would love your help!

Download the Dating Sim Engine:
https://github.com/renpy/dse/releases/latest


-------------------------------------------------------------------------------
Changelog
v3.0 - Initial re-release
v3.1 - More consistent styles, Fixed a bug where it would crash if you asked it not to display the stats label or value, More comments directing users to the parts they probably wish to change
v3.11 - Fixed a bug where skipping periods would not work properly
v3.12 - Added hidden stat feature
v4.0 - Changed to be compatible with the new GUI system. Also renamed most files to make it obvious which were part of the DSE.
v4.1 - Fixed variables being accessed before initialized. Thanks isak grozny!

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

Posted: Sun Apr 12, 2015 7:42 pm
by noeinan
Nice! I'll have to check it out. :)

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

Posted: Wed Apr 15, 2015 6:09 am
by Brother O'Fart
Sounds great! Will give it a try myself! :)

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

Posted: Mon May 11, 2015 11:25 pm
by sasquatchii
I just downloaded this because it looks AMAZING! But I got this error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While parsing C:\Users\Laura\In The Air\renpy-6.18.3-sdk\dse/game/event_dispatcher (2).rpy.
ScriptError: Name u'events_end_day' is defined twice, at game/event_dispatcher.rpy:235 and game/event_dispatcher (2).rpy:235.

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "C:\Users\Laura\In The Air\renpy-6.18.3-sdk\renpy\bootstrap.py", line 288, in bootstrap
    renpy.main.main()
  File "C:\Users\Laura\In The Air\renpy-6.18.3-sdk\renpy\main.py", line 284, in main
    renpy.game.script.load_script() # sets renpy.game.script.
  File "C:\Users\Laura\In The Air\renpy-6.18.3-sdk\renpy\script.py", line 181, in load_script
    self.load_appropriate_file(".rpyc", ".rpy", dir, fn, initcode)
  File "C:\Users\Laura\In The Air\renpy-6.18.3-sdk\renpy\script.py", line 498, in load_appropriate_file
    self.finish_load(stmts, initcode, filename=rpyfn)
  File "C:\Users\Laura\In The Air\renpy-6.18.3-sdk\renpy\script.py", line 336, in finish_load
    bad_node.filename, bad_node.linenumber))
ScriptError: Name u'events_end_day' is defined twice, at game/event_dispatcher.rpy:235 and game/event_dispatcher (2).rpy:235.

Windows-7-6.1.7601-SP1
Ren'Py 6.99.3.404
Not sure what I did wrong... any ideas?

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

Posted: Tue May 12, 2015 9:29 am
by qirien
It looks like maybe you had an older version of the DSE already in there, and when you unzipped the new one, instead of replacing the files it made two versions of the same file, one with a (2) on the end.

I'm not sure which version of the file is newest, so you could either delete the older versions if there are two of certain files, or you could delete the dse directory and unzip it again.

Let me know if that works!

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

Posted: Tue May 12, 2015 11:39 pm
by sasquatchii
qirien wrote:It looks like maybe you had an older version of the DSE already in there, and when you unzipped the new one, instead of replacing the files it made two versions of the same file, one with a (2) on the end.

I'm not sure which version of the file is newest, so you could either delete the older versions if there are two of certain files, or you could delete the dse directory and unzip it again.

Let me know if that works!

Oh, duh!

Yes, that worked!! I just deleted both DSE's, reinstalled it, and booted it up and now it's working perfectly. Thanks so much, I'm excited to be able to use this in my game :D

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

Posted: Thu May 21, 2015 10:09 am
by AsHLeX
I know this is a pretty odd question and i'm not sure if here is the right place to post it...but how to I change the colour of the stats bar? (Like from the default blue and white to say... pink, for example. Changing the theme doesn't change the colour and a blue bar looks kind of odd on a yellow background.

P.S: Thanks for this ^_^ It's really helpful.

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

Posted: Thu May 21, 2015 11:54 am
by qirien
Hey, this is a fine place to post it!

The bars probably should change when you change themes... but because we've customized them a bit, they don't. The normal bars for the Round Rectangle theme don't look like stat-raising game bars, so we've been using the ones from the (old?) Outline theme.

If you want to change the bars, you can open up options.rpy and look for these lines below the theme:

Code: Select all

    theme.outline_bars(
        inside="#fff",
        idle="#003c78",
        hover="#0050a0")
If you want to keep the look and just change the color, you can change the colors here. If you are using a completely different theme and want to use its default bars, you can just delete these lines.

Hope this helps!

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

Posted: Thu May 21, 2015 12:49 pm
by AsHLeX
Thank you so much!!! It did...immensely :D

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

Posted: Fri May 22, 2015 9:47 am
by AsHLeX
Edit: (After browsing around the Q&A forums I found the answer. Thanks!!!)

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

Posted: Mon Jun 15, 2015 11:29 pm
by Mii
is there anyway to store the choices made in the planner so that the player can either make a choice of what they want to do during the week or just repeat their last chosen activities for the week?

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

Posted: Tue Jun 16, 2015 1:20 am
by qirien
Yes, good idea, that's not too hard to do. The main reason you wouldn't do this would be to encourage the user to think about their choices each time, but for some schedules it might make sense for the default to be what they did last time.

Open up main.rpy and look for "label day:" You should see where we initialize each of these variables and reset them every day; it looks like this:

Code: Select all

    # Here, we want to set up some of the default values for the
    # day planner. In a more complicated game, we would probably
    # want to add and remove choices from the dp_ variables
    # (especially dp_period_acts) to reflect the choices the
    # user has available.

    $ morning_act = None
    $ afternoon_act = None
    $ evening_act = None
What we want to do is not run that every day, but only run it one time. That way these variables will stay the same from day to day unless the user changes them. But we have to initialize them at first or the game doesn't know about these variables. So, cut that code, and paste it up above under the "label start:", so it looks like this:

Code: Select all

# This is the entry point into the game.
label start:

    # Initialize the default values of some of the variables used in
    # the game.
    $ day = 0
    $ morning_act = None
    $ afternoon_act = None
    $ evening_act = None

That should do what you want.

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

Posted: Tue Jun 16, 2015 2:52 am
by Mii
thank you so much! it worked perfectly. i figured i would at least have it as an option to make the game feel less grindy to the player.

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

Posted: Tue Jun 16, 2015 12:47 pm
by JodoKaden
I'm sorry if this is a really stupid question, but how do you install this framework?

Which file in Ren'py do I want to put it in?

Re: Dating Sim Engine (DSE) 3.0! Day Planner and Event Manag

Posted: Tue Jun 16, 2015 10:58 pm
by qirien
Unzip the file into your Ren'Py projects directory, where it will appear as a project when you start Ren'Py. You can then modify it to meet your own needs, or, if you want to combine it with an exisiting project, you can copy all the .rpy files in the dse/game subdirectory into your own project's game subdirectory.