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
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) 4.0! Day Planner and Event Manager

#136 Post by qirien »

OK, wow, you guys have been busy! Thanks for helping each other out. :-)

verysunshine, I wonder if it is having trouble evaluating whether to show the choice or not. Do you have any dp_choice lines that have a "show" clause in them?

As for screens.rpy -- if you are using the classic Ren'Py screens your screens.rpy will look very different. I tried to make it compatible with new and classic screens, but I may have missed something.

After checking that, if you still have problems, it might be easiest to just zip up your code and PM me a link. I can take a look at it.

PoisonLullaby, you shouldn't need to change anything in dse-stats (unless you want to change the stats screen, I guess). From what I can see of your code it looks correct; would you also like to zip up your code and send it to me and I can take a look?
Finished games:
Image
Image
Image

verysunshine
Veteran
Posts: 339
Joined: Wed Sep 24, 2014 5:03 pm
Organization: Wild Rose Interactive
Contact:

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

#137 Post by verysunshine »

Yes, two of my dp_choice lines have a show clause. One is looking for a variable set to true. The other is looking for the same variable set to false. Commenting them out doesn't help.

Here's
verysunshine SyntaxError None Line1 Jan232018.zip
(689.24 KiB) Downloaded 56 times
, the bug replication build for this code.

Build the basics first, then add all the fun bits.

Please check out my games on my itch.io page!

User avatar
PoisionLullaby
Regular
Posts: 44
Joined: Wed Jan 10, 2018 9:11 pm
Projects: Reaching
Deviantart: PoisionLullaby
Contact:

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

#138 Post by PoisionLullaby »

I'm not very tech savy. How do I send only my code and not the whole game file? ^^'
~Everyone has bad days. Don't judge someone on that day and that day alone, judge them on their actions after it and onward.~

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) 4.0! Day Planner and Event Manager

#139 Post by qirien »

verysunshine, your problem was that you defined everything twice, once in newscript.rpy and once days_script.rpy. So that was making it confused. I deleted one of them and then it did not crash on that screen. :-)

PoisonLullaby, if you find your projects folder where Ren'Py is saving all of your code, you can zip up the whole project you're working on and then upload it here. If you want to remove images or other things to save space you can do that. If you only have one script file that you've edited, you could also just upload that and I can add it to my local copy of the DSE and try it on my computer.

To upload here, use the full post editor (not the quick reply), and down below your posts there's an "Attachments" tab you can use. You could also PM it to me if you don't want it to be public, or if you have trouble zipping it up/uploading.
Finished games:
Image
Image
Image

User avatar
PoisionLullaby
Regular
Posts: 44
Joined: Wed Jan 10, 2018 9:11 pm
Projects: Reaching
Deviantart: PoisionLullaby
Contact:

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

#140 Post by PoisionLullaby »

Okay I think I got it. Thank you so much for your help btw. :)
Attachments
To Test zip.zip
Test game file
(1.06 MiB) Downloaded 52 times
~Everyone has bad days. Don't judge someone on that day and that day alone, judge them on their actions after it and onward.~

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) 4.0! Day Planner and Event Manager

#141 Post by qirien »

OK, I found the problem! In dse-schedule.rpy on line 22, you switched a " and a ,

Code: Select all

register_stat("Gameing Skill," "gaming", 5, 100)
It should be:

Code: Select all

register_stat("Gameing Skill", "gaming", 5, 100)
One other change that you will need is to initialize your noon_act, since you are adding a new act. So around line 94, you should add this line:

Code: Select all

$ noon_act = None
Good luck!
Finished games:
Image
Image
Image

User avatar
PoisionLullaby
Regular
Posts: 44
Joined: Wed Jan 10, 2018 9:11 pm
Projects: Reaching
Deviantart: PoisionLullaby
Contact:

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

#142 Post by PoisionLullaby »

Thank you so much. Everything is all fixed now. :)
~Everyone has bad days. Don't judge someone on that day and that day alone, judge them on their actions after it and onward.~

verysunshine
Veteran
Posts: 339
Joined: Wed Sep 24, 2014 5:03 pm
Organization: Wild Rose Interactive
Contact:

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

#143 Post by verysunshine »

qirien wrote: Fri Jan 26, 2018 5:14 pm verysunshine, your problem was that you defined everything twice, once in newscript.rpy and once days_script.rpy. So that was making it confused. I deleted one of them and then it did not crash on that screen. :-)
Where is the correct place to define the variables? I removed them in day_script and moved all of the variables above the start label. The error still pops up.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/days_script.rpy", line 28, in script
    call screen display_planner (["Morning", "Afternoon", "Evening"])
  File "renpy/common/000statements.rpy", line 485, in execute_call_screen
    store._return = renpy.call_screen(name, *args, **kwargs)
  File "game/dse-day_planner.rpy", line 58, in execute
    screen display_planner(periods):
  File "game/dse-day_planner.rpy", line 58, in execute
    screen display_planner(periods):
  File "game/dse-day_planner.rpy", line 59, in execute
    frame:
  File "game/dse-day_planner.rpy", line 61, in execute
    vbox:
  File "game/dse-day_planner.rpy", line 63, in execute
    hbox:
  File "game/dse-day_planner.rpy", line 65, in execute
    for p in periods:
  File "game/dse-day_planner.rpy", line 66, in execute
    vbox:
  File "game/dse-day_planner.rpy", line 74, in execute
    vbox:
  File "game/dse-day_planner.rpy", line 76, in execute
    for name, curr_val, enable, should_show in this_period.acts:
  File "game/dse-day_planner.rpy", line 77, in execute
    $ show_this = eval(should_show)
  File "game/dse-day_planner.rpy", line 77, in <module>
    $ show_this = eval(should_show)
SyntaxError: invalid syntax (<none>, line 1)


Windows-8-6.2.9200
Ren'Py 6.99.14.3135
No Good Wife Redux Basic
Here's everything before the game's first display.

Code: Select all

init python:
    config.automatic_images = [ '_' ]
## Characters
define f = Character('Farris', kind=adv, color="#b3b4f6")
define v = Character('Virgil', kind=adv, color="#99c27b", show_two_window= False)
define e = Character('Esther', kind=adv, color="#FFFFFF", show_two_window= False)
define en = Character('', what_prefix="\"", what_suffix="\"", what_color="#FFFFFF")
define m = Character('Mother', kind=adv, color="#f6dfb3")
define a = Character('Anne Brown', kind=adv, color="#f6b3f6")
define h = Character('Mr. Hughes', kind=adv, color="#b3f6de")
define s = Character('Shopkeeper', kind=adv, color="#f6b3b3")

#This code defines the variables that will be used in the rest of the game.
init python:
    register_stat("Wedding Preparedness", "prep", 10, 100)
    register_stat("Charisma", "charisma", 10, 100)
    register_stat("Intelligence", "intelligence", 10, 100)
    register_stat("Handiness", "handiness", 10, 100)
    register_stat("Physicality", "physicality", 10, 100)
    register_stat("Relaxation", "relaxation", hidden=True)

    dp_period("Morning", "morning_act")
    dp_choice("Work Early", "work")
    dp_choice("Talk to Mother", "tmother")
    
    dp_period("Afternoon", "afternoon_act")
    dp_choice("Shop", "shop")
    dp_choice("Visit Farris", "tfarris", show ="fnightinvite= False")
    dp_choice("Visit Virgil", "tvirgil")
    dp_choice("Visit Anne", "tanne")

    dp_period("Evening", "evening_act")
    dp_choice("Talk to Mother", "tmother")
    dp_choice("Sew", "sew")
    dp_choice("Read", "read")
    dp_choice("Visit Farris", "tfarris_eve", show ="fnightinvite= True")
    
$ money = 30

# The game starts here.
label start:
        
        ## Time to define variables!

    define day = 0
    define fnightinvite = False
    scene black
Possible issues:
- Tabbing from hell
- $ or define for variables
- Two init python sections back to back

Build the basics first, then add all the fun bits.

Please check out my games on my itch.io page!

User avatar
PoisionLullaby
Regular
Posts: 44
Joined: Wed Jan 10, 2018 9:11 pm
Projects: Reaching
Deviantart: PoisionLullaby
Contact:

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

#144 Post by PoisionLullaby »

I'm back with a different issue, not sure where to post this but I'm posting it here and one other place just in case ^^'. So my issue is i'm trying to make it where if you decide to do "browse youtube" on the daily planner it will then randomly choose between two events. "youtube_random" and "youtube_choice". In the label "youtube_random" I want it to randomize what the player see's so something like, "youtuber1 never fails to make me smile.", "youtuber2 may be a bit loud but he's so genuine.", ect. Here's what my code looks like.

Code: Select all


label youtube:
    call expression renpy.random.choice(["youtube_choice", "youtube_random"])
    
label youtube_random:
    
    $ youtuber = renpy.random.choice(video)
    "I decide to watch some youtube videos. [youtuber]"
    $ stress -= 10
    
    return

Then on the youtube_choice label I'd like to give the player a choice between something. Here's that code.

Code: Select all

label youtube_choice:
    
    "I watched a video of..."
    
    menu:
        "guy1":
            "His reactions are the best."
            $ stress -=15
            return
            
        "guy2":
            "He is such a sweet guy and that makes people underestimate him."
            $ stress -=15
            return
     
and before the script I have video defined like this as told by someone else.

Code: Select all

define video = ["youtuber1 never fails to make me smile.", "youtuber2 may be a bit loud but he's so genuine.", "youtuber3 videos are always short and sweet.", "Is it bad I laugh when youtuber4 betrays his friends?"]
My issue is that when I choose to "browse youtube" It will say "I decide to watch some youtube videos. youtuber1 never fails to make me smile.", then "I decide to watch some youtube videos. youtuber2 may be a bit loud but he's so genuine." before proceeding. Sometimes it will do something similar but instead of repenting it says "I decide to watch some youtube videos. youtuber3 videos are always short and sweet.", then "I watched a video of..." (choices on screen) "guy1", "guy2". I have no clue why. Any help is appreciated. :)
~Everyone has bad days. Don't judge someone on that day and that day alone, judge them on their actions after it and onward.~

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) 4.0! Day Planner and Event Manager

#145 Post by qirien »

OK, I had deleted the one in newscript but it sounds like you want to put everything there. In Ren'Py it doesn't usually matter what file you have things defined in, but you can only have one of each label, variable, etc. I see you still have some things in dse-schedule even though you have your own version of these in newscript.rpy and days_script.rpy. So it's a little confused.

I think it makes the most sense to define it in your days_script.rpy. That's where all your scheduling stuff is. So I would delete dse-schedule.rpy (you're not using it anymore), change the name of the day label you call in newscript.rpy to the one that is actually in days_script.rpy, and then uncomment the call screen display_planer(["Morning", "Afternoon", "Evening"]) line in days_script.rpy.

So newscript.rpy looks like this:

Code: Select all

init python:
    config.automatic_images = [ '_' ]
## Characters
define f = Character('Farris', kind=adv, color="#b3b4f6")
define v = Character('Virgil', kind=adv, color="#99c27b", show_two_window= False)
define e = Character('Esther', kind=adv, color="#FFFFFF", show_two_window= False)
define en = Character('', what_prefix="\"", what_suffix="\"", what_color="#FFFFFF")
define m = Character('Mother', kind=adv, color="#f6dfb3")
define a = Character('Anne Brown', kind=adv, color="#f6b3f6")
define h = Character('Mr. Hughes', kind=adv, color="#b3f6de")
define s = Character('Shopkeeper', kind=adv, color="#f6b3b3")

## Images removed to save space
# The game starts here.
label start:
        
        ## Time to define variables!

    $ day = 0
    $ fnightinvite = False
    # There'd be a bunch of talking here, but this is a test build.

    jump day #in days_script
    
And I've attached the days_script, as it is too long to paste in here.

You can also delete dse-events.rpy as you are using your own events.

As an aside, the difference between initializing variables with "define" and putting them inside your "start" block is that the "define" variables will not be saved in your saved games. The define block will run every time Ren'Py starts, essentially resetting the variable. Variables that change while code is running (inside the start label or afterwards) *will* be saved in saved games and will work with rollback, etc. So character objects that don't change, constant values, and images are examples of things you usually want to define (since they don't change), while variables and things you want to keep track of are usually set using python syntax with the $, as shown in my modification of your code above.
Attachments
days_script.rpy
(3.91 KiB) Downloaded 108 times
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) 4.0! Day Planner and Event Manager

#146 Post by qirien »

As for your second question, you *can* use renpy.random to choose things like you're trying to do, but you're using the DSE which can take care of that for you.

So in your events (which you have in ngw_events.rpy), add an event like this:

Code: Select all

$ event("youtube_random", "act == 'youtube'", event.choose_one('youtube_choices'), priority=200)
$ event("youtube_choice", "act == 'youtube'", event.choose_one('youtube_choices'), priority=200)
It will then run one of those randomly whenever the Youtube choice is selected.

As for it running more than once, I think you're just missing a return statement right after it calls the expression. If you don't tell it to return, it will just keep going. So it should be this:

Code: Select all

label youtube:
    call expression renpy.random.choice(["youtube_choice", "youtube_random"])
    return
Finished games:
Image
Image
Image

verysunshine
Veteran
Posts: 339
Joined: Wed Sep 24, 2014 5:03 pm
Organization: Wild Rose Interactive
Contact:

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

#147 Post by verysunshine »

dse_schedule and events were added temporarily as a debug measure. If I could get the original events to work, then something was wrong with my events. That's also why I had "morning2" labels. They're not actually meant to be in the game.

After replicating the fixed code and uncommenting "show window", it works, except I'm now having the same problem as PoisonLullaby where events will run one after another after the event chosen by the player ends... because all of the return statements were commented out during testing. :shock:

Thanks for your help! Good luck on Personal Space 2!

Build the basics first, then add all the fun bits.

Please check out my games on my itch.io page!

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) 4.0! Day Planner and Event Manager

#148 Post by qirien »

Thank you! Glad we got it worked out! :-)
Finished games:
Image
Image
Image

User avatar
PoisionLullaby
Regular
Posts: 44
Joined: Wed Jan 10, 2018 9:11 pm
Projects: Reaching
Deviantart: PoisionLullaby
Contact:

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

#149 Post by PoisionLullaby »

Awesome everything is fixed now. Sorry for all the questions but thank you both for all the help. :)
~Everyone has bad days. Don't judge someone on that day and that day alone, judge them on their actions after it and onward.~

verysunshine
Veteran
Posts: 339
Joined: Wed Sep 24, 2014 5:03 pm
Organization: Wild Rose Interactive
Contact:

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

#150 Post by verysunshine »

I was trying to add the ability to change the periods that are displayed depending on the weekday, so I went to the DSE documentation. Not only is it a little bit out of date, some of the text is missing. For example:
The following condition functions ship as part of the DSE.

Returns True until the event has been executed once, and then returns False. It can be used to ensure that the user will only see and event once.
This should probably be:
The following condition functions ship as part of the DSE.

event.only()

Returns True until the event has been executed once, and then returns False. It can be used to ensure that the user will only see an event once.
I don't know what removed those parts of the text. This information is now covered in the comments of the dse files, so I'd suggest either linking to a new webpage with the updated information or directing people to the dse files instead.

I did get the day planner to show different periods by using if/else statements. Now, if it's the weekend, the user gets a bunch of choices. If not, the period becomes "Work Day" with the sole option "Go to Work".

Build the basics first, then add all the fun bits.

Please check out my games on my itch.io page!

Post Reply

Who is online

Users browsing this forum: No registered users