Making story events in a Dating Sim/Stat Raising game

A place to discuss things that aren't specific to any one creator or game.
Forum rules
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
Post Reply
Message
Author
User avatar
AERenoir
Veteran
Posts: 318
Joined: Fri May 27, 2011 8:23 pm
Contact:

Making story events in a Dating Sim/Stat Raising game

#1 Post by AERenoir » Sun Dec 23, 2012 2:39 am

I have two ideas. One is mainly a story VN but with some stat-raising elements that would affect the storyline. So it's mostly story, but you can go off to read in the library or train fighting every once in a while, and it will increase "stats" that would affect later events. The second is mainly stat-raising with a story. I guess it's something like Hanako's game "Long Live the Queen" (or whatever the correct title is).

I'm not sure I quite understand how to arrange that. I think I can try using the DSE from the cookbook for the second idea, but how do I insert the events? And I'm not sure which is better for the first idea. A basic VN system with a lot of "ifs" and scene blocks or use the DSE.

Any ideas, guys?

User avatar
Spiky Caterpillar
Veteran
Posts: 253
Joined: Fri Nov 14, 2008 7:59 pm
Completed: Lots.
Projects: Black Closet
Organization: Slipshod
Location: Behind you.
Contact:

Re: Making story events in a Dating Sim/Stat Raising game

#2 Post by Spiky Caterpillar » Sun Dec 23, 2012 5:36 am

Yes, Long Live the Queen is the correct title.

Personally, I prefer working with a basic VN structure with lots of ifs, and a set of functions (Python functions, screens, called Ren'Py blocks, depending on what works best where) to handle anything that will be done repeatedly or needs to be accessed from multiple places in the story/code. That's actually the approach we used with LLtQ, rather than using the DSE.
Nom nom nom nom nom LEAVES.

User avatar
AERenoir
Veteran
Posts: 318
Joined: Fri May 27, 2011 8:23 pm
Contact:

Re: Making story events in a Dating Sim/Stat Raising game

#3 Post by AERenoir » Sun Dec 23, 2012 9:13 am

Is that so? can you recommend me samples/tutorials to look at?

I'm still rather new at this. I can do basic Ren'py coding, but I'm not sure where to declare the stuff if I need to call them multiple times.

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Making story events in a Dating Sim/Stat Raising game

#4 Post by nyaatrap » Sun Dec 23, 2012 9:26 am

Simple if games can be done with the following 3 sample labels:

Code: Select all

start:
  $money=0
  $love=0

menu:
  "work":
    $money = moeny +1
  "talk":
    $love = love+1

checkpoint:
  python:
    if money > 100:
      renpy.jump("event1")
    else:
      renpy.jump("event2")
I forgot ren'py has the if statement or not. If it has, the 3rd syntax becomes simpler.
Combination of jump allows you to repeats events. It's a basic math/algorithm matter more than programming.

User avatar
Spiky Caterpillar
Veteran
Posts: 253
Joined: Fri Nov 14, 2008 7:59 pm
Completed: Lots.
Projects: Black Closet
Organization: Slipshod
Location: Behind you.
Contact:

Re: Making story events in a Dating Sim/Stat Raising game

#5 Post by Spiky Caterpillar » Mon Dec 24, 2012 5:53 am

AERenoir wrote:Is that so? can you recommend me samples/tutorials to look at?

I'm still rather new at this. I can do basic Ren'py coding, but I'm not sure where to declare the stuff if I need to call them multiple times.
I can't think of any tutorials to recommend off the top of my head, sorry. As for declarations, Python functions go in an init python: block, callable labels and screens can go wherever you like.

Vague, untested, and almost certainly buggy skeletal example using UI widgets:

Code: Select all

init python:
    def set_activity(day, activity):
        activities[day] = activity
    sets_activity = renpy.curry(set_activity)

    def draw_activitybutton(day, activity):
        # It's its own function to make it easier to add consistent stylefluff if you later decide to.
        ui.textbutton(activity, action=sets_activity(day, activity))

    def draw_day(day):
        ui.vbox()
        draw_activitybutton(day, 'Lift')
        draw_activitybutton(day, 'Stack Trilobites')
        draw_activitybutton(day, 'Code')
        draw_activitybutton(day, 'Troll')
        ui.close()

    def draw_dayplanner():
        ui.vbox()
        ui.hbox()
        draw_day('Monday')
        draw_day('Tuesday')
        draw_day('Wednesday')
        draw_day('Thursday')
        draw_day('Friday')
        ui.close()
        ui.textbutton('Done',action=day_planned)
        ui.close()

    def day_planned():
        return 1

label start:
    python:
        day = 32
label plan_day:
    python:
        activities = dict()
        draw_dayplanner()
        ui.interact()
    $ today = 'Monday'
    call do_day
    $ today = 'Tuesday'
    call do_day
    $ today = 'Wednesday'
    call do_day

label do_day:
    if today in activities:
        $ activity = activities[today]
    else:
        $ activity = 'do nothing in particular'
    "On %(today)s, you %(activity)s." # Note oldstyle variable substitutions.
    if day==33:
        "It's the 33rd!  You get a pie to celebrate."
    $ day += 1
    return
You could handle the UI with screens instead, I just don't have the screen syntax memorized.
Nom nom nom nom nom LEAVES.

User avatar
AERenoir
Veteran
Posts: 318
Joined: Fri May 27, 2011 8:23 pm
Contact:

Re: Making story events in a Dating Sim/Stat Raising game

#6 Post by AERenoir » Mon Dec 24, 2012 8:30 am

Ah, screens? What difference does it make from putting the codes in the main script?

Post Reply

Who is online

Users browsing this forum: No registered users