Dating Sim Engine (DSE) 4.1! 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
Kshimimi
Newbie
Posts: 13
Joined: Mon Nov 09, 2015 7:29 am
Tumblr: kshimimishimesh.tumblr.com
Contact:

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

#31 Post by Kshimimi »

Sorry to lean on you for help again, but I'm encountering an issue with formatting inside of the boxes. I didn't like the default padding between different elements, so I changed this (in the stats.rpy file):

Code: Select all

                    if bar:
                        bar value v range m.max xmaximum 150 xalign 0.0
                        
                    if value and max:
                        label ("%d/%d" % (v, m.max)) xalign 1.0
                    elif value:
                        label ("%d" % (v,)) xalign 1.0
                    elif max:
                        label ("%d" % (max,)) xalign 1.0
to this:

Code: Select all

                    if bar:
                        bar value v range m.max xmaximum 150 xalign 0.0
                        
                    if value and max:
                        label ("%d/%d" % (v, m.max)) xalign 0.0
                    elif value:
                        label ("%d" % (v,)) xalign 0.0
                    elif max:
                        label ("%d" % (max,)) xalign 0.0
the problem is that it leaves a large space between the value and the righthand side of the box, as you can see from my screenshot. My question is what number in all of the possible frames/files/etc do I need to change so that both edges fit properly to the interior elements?
Screen Shot 2016-02-09 at 1.13.40 AM.png
Thanks in advance

User avatar
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.0! Day Planner and Event Manag

#32 Post by qirien »

I'm not sure what you mean by "fit properly" - do you want the the bar and the value number to be together on the right edge of the box? If so, you could try putting the bar and the value together in an hbox. That also requires changing the size of the grid, so I'm just going to post the whole display_stats screen:

Code: Select all

screen display_stats(name=True, bar=True, value=True, max=True):
    $ dse_stat_length = len(__dse_stats)
    frame:
        style_group "dse_stats"        
        yalign 0.0
        xalign 0.5

        vbox:
            yalign 0.0
            xalign 0.5
            label "Statistics" xalign 0.5

            # Make a grid that has two spots horizontally, and as many spots vertically as there are stats
            grid 2 dse_stat_length:
                xalign 0.5
                yalign 0.5
                spacing 5
                
                for s in __dse_stats:
                    $ v = getattr(store, s.var)

                    if name:
                        label s.name
                    
                    #put the bar and the value together in a box
                    hbox:
                        if bar:
                            bar value v range s.max xmaximum 150 xalign 0.0
                            
                        if value and max:
                            label ("%d/%d" % (v, s.max)) xalign 1.0
                        elif value:
                            label ("%d" % (v,)) xalign 1.0
                        elif max:
                            label ("%d" % (max,)) xalign 1.0
You can change the display_stats screen to display in whatever way you want. Some of this is controlled by the stat_* styles in styles.rpy, but you can also override it in stats.rpy if you want. It might be helpful to refer to the screen language documentation.

Or, maybe you could sketch kind of what you are trying to do and I can take a stab at it. :-)
Finished games:
Image
Image
Image

Kshimimi
Newbie
Posts: 13
Joined: Mon Nov 09, 2015 7:29 am
Tumblr: kshimimishimesh.tumblr.com
Contact:

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

#33 Post by Kshimimi »

The hbox trick did help me out. The problem that I still have is that there is so much space between the labels and the bars.
Screen Shot 2016-02-09 at 12.53.30 PM.png
I suspect it has something to do with the xmaximum value that the bar has, but if i change that then the bar itself gets shorter. I tried placing the labels in the same hbox as the bar and its values, but then the bars and values don't line up neatly like they do in the picture. Does that make it clear enough what I want to make happen?

Thanks again :wink:

User avatar
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.0! Day Planner and Event Manag

#34 Post by qirien »

Hmm, I think I see what you want to change. I don't think the problem is the xmaximum of the bar - you don't want to change the length of the bar, you want to change the position of the labels, right?

Do you still want them left justified? If you want them right-justified, you can just change this part:

Code: Select all

                    if name:
                        label s.name 
to

Code: Select all

                    if name:
                        label s.name xalign 1.0
If you want to change the size of the frame containing all this stuff, you can add an "xsize 300" or however wide you want it to be up where the frame is defined.

Code: Select all

    frame:
        style_group "dse_stats"        
        yalign 0.0
        xalign 0.5
        xsize 400 #make the frame exactly 400 pixels wide
I think some combination of these should work for you.
Finished games:
Image
Image
Image

User avatar
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.0! Day Planner and Event Manag

#35 Post by qirien »

Version 3.1 is now out. Fixed a minor bug and moved styles around to be more consistent. If you're already using it and haven't had any problems, you probably don't need the new version.

Here is version 3.1:
https://github.com/renpy/dse/releases/tag/3.1
Finished games:
Image
Image
Image

Kshimimi
Newbie
Posts: 13
Joined: Mon Nov 09, 2015 7:29 am
Tumblr: kshimimishimesh.tumblr.com
Contact:

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

#36 Post by Kshimimi »

I had to get rid of the additional hbox in order to make xsize work properly, but it more or less took care of both of my problems, so consider this mission complete!

Thank you qirien :)

User avatar
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.1! Day Planner and Event Manag

#37 Post by qirien »

OK, great, glad to hear it! :-)
Finished games:
Image
Image
Image

User avatar
Ladythief1997
Regular
Posts: 46
Joined: Tue Mar 08, 2016 6:09 pm
Projects: Unnamed PJ
Tumblr: genderbender1lover
Deviantart: genderbender-lover
Skype: mycandyloveobsession@gmail.com
Soundcloud: Breaking~Point
itch: Ladythief1997
Location: Ildis
Discord: tenshuz
Contact:

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

#38 Post by Ladythief1997 »

So I did the last thing the copy paste but it gave me this error.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
ScriptError: Name u'start' is defined twice, at game/main.rpy:36 and game/script.rpy:28.

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

Full traceback:
  File "C:\Users\special k\OneDrive\Downloads\renpy-6.99.7-sdk\renpy\bootstrap.py", line 281, in bootstrap
    renpy.main.main()
  File "C:\Users\special k\OneDrive\Downloads\renpy-6.99.7-sdk\renpy\main.py", line 346, in main
    renpy.game.script.load_script() # sets renpy.game.script.
  File "C:\Users\special k\OneDrive\Downloads\renpy-6.99.7-sdk\renpy\script.py", line 259, in load_script
    self.load_appropriate_file(".rpyc", ".rpy", dir, fn, initcode)
  File "C:\Users\special k\OneDrive\Downloads\renpy-6.99.7-sdk\renpy\script.py", line 738, in load_appropriate_file
    self.finish_load(stmts, initcode, filename=fn + source)
  File "C:\Users\special k\OneDrive\Downloads\renpy-6.99.7-sdk\renpy\script.py", line 414, in finish_load
    bad_node.filename, bad_node.linenumber))
ScriptError: Name u'start' is defined twice, at game/main.rpy:36 and game/script.rpy:28.

Windows-8-6.2.9200
Ren'Py 6.99.7.858
 
I cant open the files so i dont know how to fix it. any ideas?
Writer looking for EXP go ahead and hit me up. ;D You know you want to.

User avatar
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.1! Day Planner and Event Manag

#39 Post by qirien »

OK, it sounds like you dropped the files in a directory that already has a game in it. Ren'Py looks for the label "start" for where to begin the game; there is one provided by the DSE in main.rpy, and one from your game in script.rpy.

So you need to delete one of these blocks. You probably want to delete the one from the DSE in main.rpy, and then add a line in your code that says "jump day" whenever you want the day planner to start.
Finished games:
Image
Image
Image

CrimsonHazel
Newbie
Posts: 3
Joined: Fri Dec 11, 2015 12:14 am
Contact:

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

#40 Post by CrimsonHazel »

I want to split the planner into weekdays and weekends, so the planner would show up every monday and saturday
How do I do that?
How do I determine when monday and saturday is?

User avatar
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.1! Day Planner and Event Manag

#41 Post by qirien »

Hmmm, that would actually be pretty complicated. It's kind of assumed that each time period is the same length (though you could have days/times with different options, etc).

It'd be easier to either:
a) make the planner for a whole week, and you choose what to do for that week, including the weekend
or
b) have it ask you every day for your plans for that day, and it could give you different options on the weekends.

If you'd like help with one of those options, let me know. :)
Finished games:
Image
Image
Image

User avatar
infel
Veteran
Posts: 290
Joined: Mon Jun 09, 2014 8:26 pm
Projects: Mark's Story(BxB(Reach for the Stars(GxG), Mermaid Sonata(GxG,NaNo16), Black Dale-Curse of the Scarlet Witch(Semi Hiatus), A Few Secret Games
Tumblr: lunarwingsgames
Contact:

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

#42 Post by infel »

I'm having trouble getting the file to register in my game....I could just code the game into the DSE file, but this seems to be an error.

But this is a very helpful way to get started with dating sims =D. So thank you guys for getting it up.
Please support my Twitter, Tumblr and Patreon

Patreon
https://www.patreon.com/user?u=885797&ty=h

Current Projects

Image
A GxG game about overcoming your fears and growing up in an forever changing world. Also focuses on lesbian relationships and self image.

Mermaid Sonata- A game about mermaids, magic, and adventure

http://lemmasoft.renai.us/forums/viewto ... 50&t=37512

User avatar
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.1! Day Planner and Event Manag

#43 Post by qirien »

If you have an existing game, then you probably want to find the "start" label in main.rpy and change it to something else. Otherwise it will conflict with your game's "start" label. Or is there another problem you are experiencing...?
Finished games:
Image
Image
Image

CrimsonHazel
Newbie
Posts: 3
Joined: Fri Dec 11, 2015 12:14 am
Contact:

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

#44 Post by CrimsonHazel »

My problem is that the time period would be around 10 months and the storyline is not quite long, I originally want to make it weekly planner but won't it make the game too short? but making it daily would just make it too long....

Do you have any other recommendation?
If not, I'll go with the weekly planner
Thanks in advance

User avatar
E-l337
Regular
Posts: 49
Joined: Thu Jun 19, 2003 11:58 pm
Location: Internetopia
Contact:

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

#45 Post by E-l337 »

I want to split the planner into weekdays and weekends, so the planner would show up every monday and saturday
How do I do that?
How do I determine when monday and saturday is?
CrimsonHazel wrote:My problem is that the time period would be around 10 months and the storyline is not quite long, I originally want to make it weekly planner but won't it make the game too short? but making it daily would just make it too long....

Do you have any other recommendation?
If not, I'll go with the weekly planner
Thanks in advance
Having spent the last couple of months off and on hacking the day planner and making it do what I want, I think I can help you a little.

If you're talking about wanting to change the options that are available on the day planner (different options on the weekend), you'll need to declare a variable that you can change in your init. The best way is a binary system, where "weekend = 0" or "weekend = 1".

With this variable set in place, you can determine what options are available on the planner during a given planning period. So you'll have events look something like this:

Code: Select all

    dp_period("Morning", "morning_act")
    dp_choice("Attend Class1", "class01", show="weekend == 0")
    dp_choice("Attend Class2", "class02", show="weekend == 1")
This code tells the game that on Monday, 'Attend class 1' is an option, but on the weekends it would be 'Attend class 2' instead.

From the sounds of things, you need something slightly more dynamic, so the other option is to create two day planners. If you intend the player to select options on a daily basis (go to park on monday, attend class on tuesday, etc), that's not too difficult. You'll want to create seven (or as many as necessary) 'periods' to use as options.

Code: Select all

    dp_period("Monday", "mon_act")
You'll want to make one of those for each day of the week. From here, you just need to hack the day planner itself.

Code: Select all


if weekend == 0:

    $ mon_act = None
    $ tue_act = None
    $ wed_act = None
    $ thu_act = None
    $ fri_act = None
    $ narrator("What should I do today?", interact=False)

    # Now, we call the day planner, which may set the act variables
    # to new values. We call it with a list of periods that we want
    # to compute the values for.

    call screen day_planner(["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"])

if weekend == 1:

    $ sat_act = None
    $ sun_act = None
    $ narrator("What should I do today?", interact=False)

    # Now, we call the day planner, which may set the act variables
    # to new values. We call it with a list of periods that we want
    # to compute the values for.

    call screen day_planner(["Saturday", "Sunday"])
Just make sure that the weekend variable gets adjusted before you call the acts and day planner.

It really depends on just how you're breaking apart your game.

Hope this helps.

Post Reply

Who is online

Users browsing this forum: barsunduk