[solved] How do I show the current year?

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
User avatar
Nanahs
Veteran
Posts: 310
Joined: Wed Aug 22, 2018 5:50 pm
Contact:

[solved] How do I show the current year?

#1 Post by Nanahs »

If I wanted a character show say "Oh, it's 2018!". But the year would be the current year in real life.
How do I get the game to show it?

Thanks :)
Last edited by Nanahs on Tue Oct 30, 2018 6:03 pm, edited 1 time in total.

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: How do I show the current year?

#2 Post by Donmai »

Code: Select all

init:
    $ import time

    $ year, month, day, hour, minute, second, dow, doy, dst = time.localtime()
    # dow = day of the week (Monday is 0 and Sunday is 6), doy = day of the year, dst = daylight saving time.

label start:
    scene black
    e "Oh, it's [year]!"
return
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

User avatar
Nanahs
Veteran
Posts: 310
Joined: Wed Aug 22, 2018 5:50 pm
Contact:

Re: How do I show the current year?

#3 Post by Nanahs »

Donmai wrote: Tue Oct 30, 2018 11:38 am

Code: Select all

init:
    $ import time

    $ year, month, day, hour, minute, second, dow, doy, dst = time.localtime()
    # dow = day of the week (Monday is 0 and Sunday is 6), doy = day of the year, dst = daylight saving time.

label start:
    scene black
    e "Oh, it's [year]!"
return
Thank you so much!

Post Reply

Who is online

Users browsing this forum: Google [Bot], Yone28