Lemma Soft Forums

Supporting creators of visual novels and story-based games since 2003.

Visit our new games list, blog aggregator, IRC channel, and Discord (new).
Activation problem? Email pytom@bishoujo.us.
It is currently Sun May 28, 2017 2:46 am

All times are UTC - 5 hours [ DST ]


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.



Post new topic Reply to topic  [ 97 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7  Next
Author Message
PostPosted: Fri Feb 10, 2017 5:38 pm 
Newbie
User avatar

Joined: Fri Feb 10, 2017 11:56 am
Posts: 2
Twitter: @karuni17
Tumblr: mostlikelytomorrow
Deviantart: karuni17
Thanks for the nice dating sim engine.
I was just wondering how to limit the number of days you have to reach a certain goal? :)


Top
 Profile Send private message  
 
PostPosted: Mon Feb 13, 2017 2:09 pm 
Veteran
User avatar

Joined: Thu Jul 31, 2003 10:06 pm
Posts: 417
Location: New Mexico, USA
Organization: Metasepia Games
Twitter: @Andrea_Landaker
Deviantart: qirien
Github: qirien
Well, you could easily put a check in to see what day it is, and jump to an end sequence at that point.

For example, in the sample code's main.rpy, when you increment the day, you could add something like this (set MAX_DAYS to however many days you want to run):
Code:
    if (day >= MAX_DAYS):
        jump ending

and later have:
Code:
label ending:
    if ((strength >= 100) and (intelligence >= 100)):
        jump superhero_ending
    elif (strength >= 100):
        jump strong_ending
    elif (intelligence >= 100):
        jump smart_ending
    else:
        jump slacker_ending


Does that make sense?

_________________
Finished games:

Image
Image
Image

In progress: Our Personal Space 2: Space to Grow


Top
 Profile Send private message  
 
PostPosted: Wed Feb 15, 2017 1:14 pm 
Newbie
User avatar

Joined: Fri Feb 10, 2017 11:56 am
Posts: 2
Twitter: @karuni17
Tumblr: mostlikelytomorrow
Deviantart: karuni17
Yeah, I'll try that. Thank you so much for your help. :)


Top
 Profile Send private message  
 
PostPosted: Thu Feb 16, 2017 10:21 pm 
Newbie
User avatar

Joined: Sun Jan 08, 2017 8:03 pm
Posts: 4
Completed: Gulungan Pengembara & Puteri
Projects: Sim VN Setia
Hi, ... i'd try it, but i have problem when i use event.choose_one and event.solo together, is they can't work together? coz if i use event solo, the event.choose_one not working. Any solution?

Code:
    $ event("sekolah1", "act =='01class'", event.choose_one('01class'), event.solo(), priority=200)
    $ event("sekolah2", "act =='01class'", event.choose_one('01class'), event.solo(), priority=200)


the event.choose_one just call first label only.


Top
 Profile Send private message  
 
PostPosted: Fri Feb 17, 2017 1:41 pm 
Veteran
User avatar

Joined: Thu Jul 31, 2003 10:06 pm
Posts: 417
Location: New Mexico, USA
Organization: Metasepia Games
Twitter: @Andrea_Landaker
Deviantart: qirien
Github: qirien
Yes, solo is meant for a single event, so you can't really use it with choose_one. Instead, you could change the priority on the events. The system will prefer events with a lower priority number, so if you have other events you want it to pick and only use these if none of those match, set those events to have a lower priority value.

Would that work for what you want to do?

_________________
Finished games:

Image
Image
Image

In progress: Our Personal Space 2: Space to Grow


Top
 Profile Send private message  
 
PostPosted: Tue Feb 21, 2017 9:55 pm 
Newbie
User avatar

Joined: Sun Jan 08, 2017 8:03 pm
Posts: 4
Completed: Gulungan Pengembara & Puteri
Projects: Sim VN Setia
I Use for DSE 3.11.
Okay .. thank you Qirien.


Top
 Profile Send private message  
 
PostPosted: Fri Mar 24, 2017 11:31 pm 
Newbie

Joined: Sun Mar 19, 2017 12:13 pm
Posts: 1
While calling the day_planner, I get the following exception.

Code:
While running game code:
  File "game/script.rpy", line 144, in script
    call screen day_planner(["Wee Hours","Early Dawn","Morning", "Afternoon", "Evening","Night"])
  File "renpy/common/000statements.rpy", line 471, in execute_call_screen
    store._return = renpy.call_screen(name, *args, **kwargs)
  File "game/scheduling.rpy", line 50, in execute
    screen day_planner(periods):
  File "game/scheduling.rpy", line 50, in execute
    screen day_planner(periods):
  File "game/scheduling.rpy", line 53, in execute
    window:
  File "game/scheduling.rpy", line 56, in execute
    use display_planner(periods)
  File "game/scheduling.rpy", line 58, in execute
    screen display_planner(periods):
  File "game/scheduling.rpy", line 58, in execute
    screen display_planner(periods):
  File "game/scheduling.rpy", line 59, in execute
    frame:
  File "game/scheduling.rpy", line 61, in execute
    vbox:
  File "game/scheduling.rpy", line 63, in execute
    hbox:
  File "game/scheduling.rpy", line 65, in execute
    for p in periods:
  File "game/scheduling.rpy", line 66, in execute
    vbox:
  File "game/scheduling.rpy", line 71, in execute
    $ selected_choice = getattr(store, this_period.var)
  File "game/scheduling.rpy", line 71, in <module>
    $ selected_choice = getattr(store, this_period.var)
AttributeError: 'StoreModule' object has no attribute 'early_act'


What is causing this? I can't figure out how to make it not do this.


Top
 Profile Send private message  
 
PostPosted: Tue Apr 04, 2017 12:43 pm 
Veteran
User avatar

Joined: Thu Jul 31, 2003 10:06 pm
Posts: 417
Location: New Mexico, USA
Organization: Metasepia Games
Twitter: @Andrea_Landaker
Deviantart: qirien
Github: qirien
Sorry for the delay; I've been out of town.

At the very end, it says "'StoreModule' object has no attribute 'early_act'". Would you look at where you are defining the different events and see if you can find any errors in that code? It looks like perhaps you did not register that period with dp_period in main.rpy. Perhaps you could paste in the relevant code from main.rpy here.

_________________
Finished games:

Image
Image
Image

In progress: Our Personal Space 2: Space to Grow


Top
 Profile Send private message  
 
PostPosted: Wed Apr 05, 2017 1:26 pm 
Veteran
User avatar

Joined: Thu Jul 31, 2003 10:06 pm
Posts: 417
Location: New Mexico, USA
Organization: Metasepia Games
Twitter: @Andrea_Landaker
Deviantart: qirien
Github: qirien
Version 3.12 is now out!
https://github.com/renpy/dse/releases/tag/3.12

Thanks to Pneumonica for the new hidden stat feature.

_________________
Finished games:

Image
Image
Image

In progress: Our Personal Space 2: Space to Grow


Top
 Profile Send private message  
 
PostPosted: Thu Apr 13, 2017 11:27 am 
Newbie

Joined: Thu Apr 13, 2017 9:57 am
Posts: 7
First of all, thank you for creating this. Although I have a programming background, I'm a complete noob when it comes to Ren'Py (for that matter, Python too, lol) and it's a huge help to avoid having to write all of this logic myself. I'm starting to think about how to approach my first Ren'Py/DSE game and I am worried about starting off with a bad design that becomes a nightmare to deal with later on. I'm hoping I can draw on your experience and avoid this. :)

I initially thought that I'd create a series of generic stat building events which would always run when the player scheduled them, and then during the same period other events might also run if their criteria were met. This means I would not be using event.solo() or event.only() for most events, since both types of events would need to be able to occur in the same period, like:

"Afternoon" period
  1. Show generic study animation and increase intelligence stat
  2. Show scene "X" with character "Y" based on some criteria that has been met
  3. Period end

The sample DSE code seems to take a different approach, where most events are solo or only. For studying, there's a basic study event that's only used the first time, followed by a series of different events that successively override each other as their criteria are met. Sometimes these events allow for studying to occur, and sometimes studying is interrupted by what happens in the event. For events that allow studying, the stat changes are coded into each of those individual events. For a longer game it could become a potential maintenance issue to copy the stat changing code across all of the events, although you could probably use a function to deal with this. This design also means you can't study if there are any other events that occur and there may be short events where I would want to allow the player to continue with their planned activity for the period.

Having said all that, I feel like my initial approach above also has some potential issues. For instance, if I want certain events to interrupt studying (like the "borrow_pen" or "bookslide" events in the sample code), I'd have to use event.solo() with a higher priority to avoid running the generic study event. But then I'd be stuck if I ever need some other event to run in the same period (e.g., if I wanted to show events "A" and "B" but not the generic study event). Another potential pitfall would be special events that affected the stat changes (e.g., to provide a bigger or smaller stat change). And finally, since this design allows for many events to run in a single period, there may be situations where a completely unrealistic number of events trigger at once. I might be able to work around some of these issues (in particular the last two) with some extra code, but then again, maybe these issues are a sign I'm using DSE wrong. :)

What are your thoughts on the best way to approach this?


Top
 Profile Send private message  
 
PostPosted: Tue Apr 18, 2017 1:21 pm 
Veteran
User avatar

Joined: Thu Jul 31, 2003 10:06 pm
Posts: 417
Location: New Mexico, USA
Organization: Metasepia Games
Twitter: @Andrea_Landaker
Deviantart: qirien
Github: qirien
Hey, sorry for the delay, I've been thinking about your question...

The truth is, either way would work, but the approach you choose will affect how you structure your game.

It might be best to have an outline of events first, and then you can make sure that the structure you're choosing matches the way you want your game to go. And, yes, you will be somewhat limited by the approach you choose, but it will probably still be easier than coding it all by hand manually.

Remember that you can use "jump events_end_period" any time you want to skip the rest of the events for a period.

One thing you may want to consider is dividing up your "afternoon" into two separate periods: "afternoon1" and "afternoon2". Maybe afternoon1 always has 1 event, which is usually just studying, and afternoon2 might have no events or several events depending on criteria?

If you have some more specifics, let me know and I can take a look and try to help. I hope this is a little bit helpful!

_________________
Finished games:

Image
Image
Image

In progress: Our Personal Space 2: Space to Grow


Top
 Profile Send private message  
 
PostPosted: Tue Apr 18, 2017 4:42 pm 
Newbie

Joined: Thu Apr 13, 2017 9:57 am
Posts: 7
Thanks for thinking it through and getting back to me. I'll try to plan things out a bit and go with the solution that best fits my events, as you recommended. The "afternoon1" and "afternoon2" type of idea had crossed my mind as well so I will probably incorporate that too.


Top
 Profile Send private message  
 
PostPosted: Tue Apr 18, 2017 5:58 pm 
Newbie

Joined: Thu Apr 13, 2017 9:57 am
Posts: 7
Sorry, but I have another question. The quick version is - do I need to do anything special to make the day planner work with the new GUI? Given that I'm new to Ren'py I can't tell if I've made a dumb mistake or not. :) Here are the details behind my question...

In my earlier experiments, I had been playing around by just adding code to the original DSE files. Just now I decided to start fresh and created a new project with "+Create New Project" in Ren'py. I checked the skeleton VN that Ren'py creates and as expected everything worked fine. Next, to get the DSE, I copied the following DSE files into my new project:

day_planner.rpy
event_dispatcher.rpy
events.rpy
main.rpy
stats.rpy
styles.rpy

I got rid of the Ren'py-generated script.rpy and renamed the DSE main.rpy to script.rpy (just to follow the same naming convention), so I would have just one start label.

I didn't copy options.rpy from the DSE because Ren'py generated an options.rpy when I created the project.

When I launched the project, the first few bits worked. However, when I got to the day planner screen, the stats were at the bottom of the screen instead of the top and there was no day planner at all (see attachment for screenshot).

At this point I thought that maybe I had broken something by not copying the DSE options.rpy. I tried two things: a) copied DSE/options.rpy to my new project and replacing the Ren'py options.rpy, and b) copied DSE/options.rpy over as options2.rpy, leaving the Ren'py generated options.rpy in place. Although both of these attempts had an impact (for instance the window resolution was different) neither fixed the day planner screen.

Any ideas?


Attachments:
dse.jpg
dse.jpg [ 41.77 KiB | Viewed 141 times ]
Top
 Profile Send private message  
 
PostPosted: Wed Apr 19, 2017 2:07 pm 
Veteran
User avatar

Joined: Thu Jul 31, 2003 10:06 pm
Posts: 417
Location: New Mexico, USA
Organization: Metasepia Games
Twitter: @Andrea_Landaker
Deviantart: qirien
Github: qirien
Ooh, good question. I wasn't sure if I should redo it to use the new GUI or not... I've been trying to keep it as small as possible, so I didn't want to just include all the new gui files.

I have checked in a new version that should be compatible with the old or new GUI. The only files that have changed are styles.rpy and day_planner.rpy. Would you give it a try and make sure it works for you, too?

You can download the latest version (I haven't made it a new release yet) from GitHub by clicking the green "Clone or Download" button.

_________________
Finished games:

Image
Image
Image

In progress: Our Personal Space 2: Space to Grow


Top
 Profile Send private message  
 
PostPosted: Wed Apr 19, 2017 2:14 pm 
Newbie

Joined: Thu Apr 13, 2017 9:57 am
Posts: 7
Thank you! I will check it out now and let you know.


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 97 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Protected by Anti-Spam ACP
Powered by phpBB® Forum Software © phpBB Group