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
verysunshine
Veteran
Posts: 231
Joined: Wed Sep 24, 2014 5:03 pm
Projects: No Good Wife
Organization: Wild Rose Interactive
Contact:

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

#151 Post by verysunshine » Mon Feb 05, 2018 3:48 am

I thought the if statements had ended the last of these bugs. It did, but there's another problem.

The call for "work event" fails to load an event.

Code: Select all

label work:
    if check_skip_period():
        jump afternoon
        
    if weekend == True:
        jump afternoon
        
    centered "Work"

    $ period = "work"
    $ act = work_act

    call events_run_period
    
#   calls the work_act

    $ event("atwork", "act == 'at_work'", event.solo(), priority=200)
    
label atwork:
    "Default work event."
    if day == 2 or day == 9 or day == 10:
        "It's Friday, so my boss gives me my paycheque."
        $ items["pounds"] += 20
    return
In afternoon, it crashes when trying to call any event. The crash is the syntax error "unbound method eval".

The relevant variables right before the crash (When "Afternoon" is displayed):
  • act = u'atwork'
    events_executed = {u'garden': True}
    period = u'work'
    work_act = u'actwork'
My afternoon code:

Code: Select all

label afternoon:

    # It's possible that we will be skipping the afternoon, if one
    # of the events in the morning jumped to skip_next_period. If
    # so, we should skip the afternoon.
    if check_skip_period():
        jump evening

    # The rest of this is the same as for the morning.

    centered "Afternoon"

    $ period = "afternoon"
    $ act = afternoon_act

    call events_run_period
Pressing "ignore" allows the game to continue.

EDIT: My initial events were flawed. I missed the brackets in event.only().

However, return goes to call another event instead of going to the next period. It looks like this should be easy to fix, so I'll see what I can do. I don't want the events to always appear in a specific order, so event.depends won't work for me.

"Date for the romance. Marry for the truth." - No Good Wife (Alpha available for Mac and PC.)

verysunshine
Veteran
Posts: 231
Joined: Wed Sep 24, 2014 5:03 pm
Projects: No Good Wife
Organization: Wild Rose Interactive
Contact:

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

#152 Post by verysunshine » Mon Feb 12, 2018 7:32 am

I managed to add a "ranking" argument to the stats screen and set it up so it can display one of three different formats.

"numbers_only" resembles the old state.
dse_rank_numbers_only.JPG
"rank_only" just shows the rank tied to a stat.
dse_rank_rank_only.JPG
The default shows both.
dse_rank_default.JPG
(Oh, and I fixed all of the issues I had before. I just figured this was more interesting.)

"Date for the romance. Marry for the truth." - No Good Wife (Alpha available for Mac and PC.)

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

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

#153 Post by qirien » Thu Mar 01, 2018 2:36 pm

Gahh, you are right. I don't know what happened to delete some of that text in the documentation, but it also says the page is obsolete and should not be linked to. :( I will remove the link to that documentation, but we really need some more documentation in the comments, especially about the different event.functions. Anyone want to fill some of that in?
Finished games:
Image
Image
Image
In progress: Our Personal Space 2: Space to Grow

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

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

#154 Post by qirien » Thu Mar 01, 2018 2:40 pm

verysunshine, are you still having a problem with your code? I'm not sure which return you are talking about... I would check to make sure you're not missing a return at the end of one of your events; that is an easy mistake to make (I still do that sometimes!). Or make sure you're not using a call when you need to use a jump.
Finished games:
Image
Image
Image
In progress: Our Personal Space 2: Space to Grow

verysunshine
Veteran
Posts: 231
Joined: Wed Sep 24, 2014 5:03 pm
Projects: No Good Wife
Organization: Wild Rose Interactive
Contact:

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

#155 Post by verysunshine » Thu Mar 01, 2018 4:00 pm

No, I don't have any more problems with the code. I had misspelt "at_work" as "atwork" (or something equally wrong. I don't remember what the problem was anymore, but it was a missed character.).

The return issue was fixed by adding event.only to the events that were repeating when I didn't want them to repeat.

"Date for the romance. Marry for the truth." - No Good Wife (Alpha available for Mac and PC.)

verysunshine
Veteran
Posts: 231
Joined: Wed Sep 24, 2014 5:03 pm
Projects: No Good Wife
Organization: Wild Rose Interactive
Contact:

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

#156 Post by verysunshine » Sat Mar 03, 2018 5:04 am

Per Qirien's suggestion, I'm posting an extension for the DSE stat system. It will enable you to give statistics a ranking, like "Great", "Entry-Level", or "Good Friends". I have added my own comments to the document, which are signed. Unsigned comments are from the original DSE. If you have any questions or bugs, feel free to let me know. I may update the file in the future to make it cleaner.

Users should probably have some knowledge of Ren'Py Screen Syntax and Python "for" and "if" statements before making modifications to this code. While this knowledge isn't necessary, it will help you understand the relatively tricky code.

The current build only supports one list of rankings. The if statements in "if rank" will be used for all of your stats.

The current build has two areas that use "if rank". The code read in "if rank" used will match the presentation style used. No error will appear if the two "if rank" blocks are different.

To add this to your game file, replace dse-stats.rpy with this copy.
Attachments
dse-stats.rpy
(7.15 KiB) Downloaded 127 times

"Date for the romance. Marry for the truth." - No Good Wife (Alpha available for Mac and PC.)

DoomStrangeJourney
Newbie
Posts: 4
Joined: Tue Aug 28, 2018 12:53 pm
Contact:

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

#157 Post by DoomStrangeJourney » Wed Aug 29, 2018 5:26 am

E-l337 wrote:
Fri May 27, 2016 10:19 pm
Thanks for your help...
I think I'll go with the second one. where do i declare the weekend variable and when would it change from 0 to 1?
And sorry to bother you, but could you help me with adding a calendar to it?
No problem, always happy to help out. :) You'll want to declare the weekend variable in your init line (so that, say, it defaults to 'not a weekend' the first time you launch the game). You'll want to make it one of the very first things you declare, but so long as it is anywhere before the dp_choice blocks it will be fine (since you need to check if it is the weekend in those blocks, and it doesn't like it when the variable doesn't exist yet!).

As for when to change them? I recommend during the evening slot, before the 'day' ends. Just have it check what the value is, and adjust it accordingly. Example:

Code: Select all

if weekend == 0:
      weekend += 1
if weekend == 1:
      weekend -= 1
It's important that the variable be a number, since the day planner blocks don't seem to recognize non-integer values.

I'll PM you about the rest, since I don't want to clutter this thread with non-DSE talk. :)
Hi, this may be a long shot but do you happen to have the code with you? I want to do exactly what CrimsonHazel wanted so it would be a huge help if i could have that code. Thanks.

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

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

#158 Post by E-l337 » Mon Sep 03, 2018 4:28 am

DoomStrangeJourney wrote:
Wed Aug 29, 2018 5:26 am
E-l337 wrote:
Fri May 27, 2016 10:19 pm
Thanks for your help...
I think I'll go with the second one. where do i declare the weekend variable and when would it change from 0 to 1?
And sorry to bother you, but could you help me with adding a calendar to it?
No problem, always happy to help out. :) You'll want to declare the weekend variable in your init line (so that, say, it defaults to 'not a weekend' the first time you launch the game). You'll want to make it one of the very first things you declare, but so long as it is anywhere before the dp_choice blocks it will be fine (since you need to check if it is the weekend in those blocks, and it doesn't like it when the variable doesn't exist yet!).

As for when to change them? I recommend during the evening slot, before the 'day' ends. Just have it check what the value is, and adjust it accordingly. Example:

Code: Select all

if weekend == 0:
      weekend += 1
if weekend == 1:
      weekend -= 1
It's important that the variable be a number, since the day planner blocks don't seem to recognize non-integer values.

I'll PM you about the rest, since I don't want to clutter this thread with non-DSE talk. :)
Hi, this may be a long shot but do you happen to have the code with you? I want to do exactly what CrimsonHazel wanted so it would be a huge help if i could have that code. Thanks.
I'd be happy to help provide some snippets or insights, but to provide the actual code, I'd have to go back and literally create a whole new template, since there's too many ways to accomplish this.

I'll PM you though, and hopefully it will prove useful.

User avatar
Tritonials
Newbie
Posts: 1
Joined: Fri Sep 21, 2018 6:32 pm
Contact:

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

#159 Post by Tritonials » Fri Sep 21, 2018 6:39 pm

Hello, I was planning to use it for creating a simulator but I can't even access the script. I downloaded the source code file but it doesn't work as well.

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

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

#160 Post by qirien » Mon Oct 01, 2018 12:40 pm

Tritonials, I sent you a PM.
Finished games:
Image
Image
Image
In progress: Our Personal Space 2: Space to Grow

Post Reply

Who is online

Users browsing this forum: No registered users