Page 11 of 11

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

Posted: Mon Feb 05, 2018 3:48 am
by verysunshine
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.

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

Posted: Mon Feb 12, 2018 7:32 am
by verysunshine
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.)

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

Posted: Thu Mar 01, 2018 2:36 pm
by qirien
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?

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

Posted: Thu Mar 01, 2018 2:40 pm
by qirien
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.

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

Posted: Thu Mar 01, 2018 4:00 pm
by verysunshine
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.

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

Posted: Sat Mar 03, 2018 5:04 am
by verysunshine
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.

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

Posted: Wed Aug 29, 2018 5:26 am
by DoomStrangeJourney
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.

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

Posted: Mon Sep 03, 2018 4:28 am
by E-l337
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.

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

Posted: Fri Sep 21, 2018 6:39 pm
by Tritonials
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.

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

Posted: Mon Oct 01, 2018 12:40 pm
by qirien
Tritonials, I sent you a PM.

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

Posted: Sat Oct 27, 2018 11:08 pm
by TsugumiLightning
I'm having trouble with this...
I want to add some extra periods, but I always get this error.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/main_menu.rpy", line 7, in script call
    call start
  File "game/dse-schedule.rpy", line 94, in script
    call screen day_planner(["Morning", "Class", "Afternoon", "Club", "Evening"])
  File "renpy/common/000statements.rpy", line 519, in execute_call_screen
    store._return = renpy.call_screen(name, *args, **kwargs)
  File "game/dse-day_planner.rpy", line 50, in execute
    screen day_planner(periods):
  File "game/dse-day_planner.rpy", line 50, in execute
    screen day_planner(periods):
  File "game/dse-day_planner.rpy", line 53, in execute
    frame:
  File "game/dse-day_planner.rpy", line 56, in execute
    use display_planner(periods)
  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 68, in execute
    if p not in __periods:
  File "game/dse-day_planner.rpy", line 69, in execute
    $ raise Exception("Period %r was never defined." % p)
  File "game/dse-day_planner.rpy", line 69, in <module>
    $ raise Exception("Period %r was never defined." % p)
Exception: Period u'Class' was never defined.

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

Full traceback:
  File "game/main_menu.rpy", line 7, in script call
    call start
  File "game/dse-schedule.rpy", line 94, in script
    call screen day_planner(["Morning", "Class", "Afternoon", "Club", "Evening"])
  File "/Applications/renpy-7.0.0-sdk/renpy/ast.py", line 1828, in execute
    self.call("execute")
  File "/Applications/renpy-7.0.0-sdk/renpy/ast.py", line 1816, in call
    return renpy.statements.call(method, parsed, *args, **kwargs)
  File "/Applications/renpy-7.0.0-sdk/renpy/statements.py", line 177, in call
    return method(parsed, *args, **kwargs)
  File "renpy/common/000statements.rpy", line 519, in execute_call_screen
    store._return = renpy.call_screen(name, *args, **kwargs)
  File "/Applications/renpy-7.0.0-sdk/renpy/exports.py", line 2710, in call_screen
    rv = renpy.ui.interact(mouse="screen", type="screen", roll_forward=roll_forward)
  File "/Applications/renpy-7.0.0-sdk/renpy/ui.py", line 287, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "/Applications/renpy-7.0.0-sdk/renpy/display/core.py", line 2649, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "/Applications/renpy-7.0.0-sdk/renpy/display/core.py", line 3033, in interact_core
    root_widget.visit_all(lambda i : i.per_interact())
  File "/Applications/renpy-7.0.0-sdk/renpy/display/core.py", line 511, in visit_all
    d.visit_all(callback)
  File "/Applications/renpy-7.0.0-sdk/renpy/display/core.py", line 511, in visit_all
    d.visit_all(callback)
  File "/Applications/renpy-7.0.0-sdk/renpy/display/core.py", line 511, in visit_all
    d.visit_all(callback)
  File "/Applications/renpy-7.0.0-sdk/renpy/display/screen.py", line 424, in visit_all
    callback(self)
  File "/Applications/renpy-7.0.0-sdk/renpy/display/core.py", line 3033, in <lambda>
    root_widget.visit_all(lambda i : i.per_interact())
  File "/Applications/renpy-7.0.0-sdk/renpy/display/screen.py", line 434, in per_interact
    self.update()
  File "/Applications/renpy-7.0.0-sdk/renpy/display/screen.py", line 619, in update
    self.screen.function(**self.scope)
  File "game/dse-day_planner.rpy", line 50, in execute
    screen day_planner(periods):
  File "game/dse-day_planner.rpy", line 50, in execute
    screen day_planner(periods):
  File "game/dse-day_planner.rpy", line 53, in execute
    frame:
  File "game/dse-day_planner.rpy", line 56, in execute
    use display_planner(periods)
  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 68, in execute
    if p not in __periods:
  File "game/dse-day_planner.rpy", line 69, in execute
    $ raise Exception("Period %r was never defined." % p)
  File "game/dse-day_planner.rpy", line 69, in <module>
    $ raise Exception("Period %r was never defined." % p)
Exception: Period u'Class' was never defined.

Darwin-15.2.0-x86_64-i386-64bit
Ren'Py 7.0.0.196
NameOfGame 1.1.1
Sun Oct 28 10:52:55 2018
What do I do? Can you please help me?

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

Posted: Sat Oct 27, 2018 11:18 pm
by TsugumiLightning
Sorry, to bother you, I found out that I had the wrong names. Don't waste your time on trying to fix it, when it''s already fixed.
TsugumiLightning wrote:
Sat Oct 27, 2018 11:08 pm
I'm having trouble with this...
I want to add some extra periods, but I always get this error.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/main_menu.rpy", line 7, in script call
    call start
  File "game/dse-schedule.rpy", line 94, in script
    call screen day_planner(["Morning", "Class", "Afternoon", "Club", "Evening"])
  File "renpy/common/000statements.rpy", line 519, in execute_call_screen
    store._return = renpy.call_screen(name, *args, **kwargs)
  File "game/dse-day_planner.rpy", line 50, in execute
    screen day_planner(periods):
  File "game/dse-day_planner.rpy", line 50, in execute
    screen day_planner(periods):
  File "game/dse-day_planner.rpy", line 53, in execute
    frame:
  File "game/dse-day_planner.rpy", line 56, in execute
    use display_planner(periods)
  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 68, in execute
    if p not in __periods:
  File "game/dse-day_planner.rpy", line 69, in execute
    $ raise Exception("Period %r was never defined." % p)
  File "game/dse-day_planner.rpy", line 69, in <module>
    $ raise Exception("Period %r was never defined." % p)
Exception: Period u'Class' was never defined.

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

Full traceback:
  File "game/main_menu.rpy", line 7, in script call
    call start
  File "game/dse-schedule.rpy", line 94, in script
    call screen day_planner(["Morning", "Class", "Afternoon", "Club", "Evening"])
  File "/Applications/renpy-7.0.0-sdk/renpy/ast.py", line 1828, in execute
    self.call("execute")
  File "/Applications/renpy-7.0.0-sdk/renpy/ast.py", line 1816, in call
    return renpy.statements.call(method, parsed, *args, **kwargs)
  File "/Applications/renpy-7.0.0-sdk/renpy/statements.py", line 177, in call
    return method(parsed, *args, **kwargs)
  File "renpy/common/000statements.rpy", line 519, in execute_call_screen
    store._return = renpy.call_screen(name, *args, **kwargs)
  File "/Applications/renpy-7.0.0-sdk/renpy/exports.py", line 2710, in call_screen
    rv = renpy.ui.interact(mouse="screen", type="screen", roll_forward=roll_forward)
  File "/Applications/renpy-7.0.0-sdk/renpy/ui.py", line 287, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "/Applications/renpy-7.0.0-sdk/renpy/display/core.py", line 2649, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "/Applications/renpy-7.0.0-sdk/renpy/display/core.py", line 3033, in interact_core
    root_widget.visit_all(lambda i : i.per_interact())
  File "/Applications/renpy-7.0.0-sdk/renpy/display/core.py", line 511, in visit_all
    d.visit_all(callback)
  File "/Applications/renpy-7.0.0-sdk/renpy/display/core.py", line 511, in visit_all
    d.visit_all(callback)
  File "/Applications/renpy-7.0.0-sdk/renpy/display/core.py", line 511, in visit_all
    d.visit_all(callback)
  File "/Applications/renpy-7.0.0-sdk/renpy/display/screen.py", line 424, in visit_all
    callback(self)
  File "/Applications/renpy-7.0.0-sdk/renpy/display/core.py", line 3033, in <lambda>
    root_widget.visit_all(lambda i : i.per_interact())
  File "/Applications/renpy-7.0.0-sdk/renpy/display/screen.py", line 434, in per_interact
    self.update()
  File "/Applications/renpy-7.0.0-sdk/renpy/display/screen.py", line 619, in update
    self.screen.function(**self.scope)
  File "game/dse-day_planner.rpy", line 50, in execute
    screen day_planner(periods):
  File "game/dse-day_planner.rpy", line 50, in execute
    screen day_planner(periods):
  File "game/dse-day_planner.rpy", line 53, in execute
    frame:
  File "game/dse-day_planner.rpy", line 56, in execute
    use display_planner(periods)
  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 68, in execute
    if p not in __periods:
  File "game/dse-day_planner.rpy", line 69, in execute
    $ raise Exception("Period %r was never defined." % p)
  File "game/dse-day_planner.rpy", line 69, in <module>
    $ raise Exception("Period %r was never defined." % p)
Exception: Period u'Class' was never defined.

Darwin-15.2.0-x86_64-i386-64bit
Ren'Py 7.0.0.196
NameOfGame 1.1.1
Sun Oct 28 10:52:55 2018
What do I do? Can you please help me?

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

Posted: Sun Oct 28, 2018 2:25 am
by TsugumiLightning
Okay, This time I've been trying for hours.
I've added in two extra periods...
The gaps between each period are huge, as shown in the picture attached.
What do I do?

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

Posted: Mon Oct 29, 2018 12:58 pm
by qirien
OK, I think I see what's going on here. It puts all the choice buttons in the same size_group so that they will all be the same size. This means all of your buttons will be as large as your largest button. Since you have some long text in one of your buttons, it's making them all big. If you want to turn this off, you can go in dse-styles.rpy and change the style of the dp_button. Comment out this line:

Code: Select all

size_group dp_choice
and now the buttons will not all be the same size and you will have more room on your screen.

But you might also consider making the button text a little more terse so the user isn't confronted with quite so much text.