christmas calendar Tips

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Live
Newbie
Posts: 3
Joined: Fri Oct 07, 2016 3:12 pm
Contact:

christmas calendar Tips

#1 Post by Live » Fri Oct 07, 2016 3:17 pm

Hey all game makers.. hoping for some tips:)

So the idea is to make a christmas calendar, where i each day come up with some new storie or something.. one thing I'm wondering about is that i want to have it so you only play one chapter every day... like 1 desember, 2 desember and so on.

Any tips on how to make that work?

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: christmas calendar Tips

#2 Post by PyTom » Sat Oct 08, 2016 12:07 am

You can generally use the datetime to get the current date, and act on it.

Code: Select all

init python:
    import datetime

python:
    today = datetime.date.today()

    if today < datetime.date(2016, 12, 25):
        "It's before christmas."
    else:
        "Merry christmas."
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Live
Newbie
Posts: 3
Joined: Fri Oct 07, 2016 3:12 pm
Contact:

Re: christmas calendar Tips

#3 Post by Live » Sat Oct 08, 2016 4:22 am

OK thx:) ill get working and try it out:D

kalesco
Regular
Posts: 25
Joined: Wed Apr 18, 2018 9:34 am
Contact:

Re: christmas calendar Tips

#4 Post by kalesco » Fri Jun 08, 2018 4:20 am

Thank you for this thread.

I used it for adding the current date to my build name. :) (in options.rpy)

Code: Select all

## A short name for the game used for executables and directories in the built
## distribution. This must be ASCII-only, and must not contain spaces, colons,
## or semicolons.

#define build.name = "KuKuRisk"
init python:
    import datetime
define build.name = datetime.datetime.today().strftime('%Y-%m-%d')+"-KuKuRisk"

Post Reply

Who is online

Users browsing this forum: Google [Bot], Ocelot