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: 445
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) 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: 445
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) 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 63 times

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

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot]