I know you can import the time using this:
Code: Select all
init:
$ import time
$ year, month, day, hour, minute, second, dow, doy, dst = time.localtime()
Code: Select all
if month == 12 and day == 25:
e "Merry Christmas!"
Code: Select all
init:
$ import time
$ year, month, day, hour, minute, second, dow, doy, dst = time.localtime()
Code: Select all
if month == 12 and day == 25:
e "Merry Christmas!"
Code: Select all
label quit:
$ persistent.last_exit = time.time()
Code: Select all
default today = 0
default days = 0
init python:
from datetime import date
label start:
$ tempus_fugit = date.today() - date(2017, 03, 22)
$ today = tempus_fugit.days
# ...
label after_load:
$ tempus_fugit = date.today() - date(2017, 03, 22)
$ new_today = tempus_fugit.days
$ days = new_today - today
return
Code: Select all
default now = 0
default eileen_goes_to_sleep = 0
default NAP_TIME = 7200 # Seconds
init python:
import time
label start:
scene bg house
"Me" "I'm looking for Eileen."
$ eileen_goes_to_sleep = time.time()
"Mother" "Oh, sorry. She has just gone to bed."
"Me" "Don't worry. I'll wait."
"Mother" "Mmmm. As you wish. Better take a good book... May I suggest 'The Lord of the Rings'?"
jump waiting_loop
label waiting_loop:
$ now = time.time()
$ wait = eileen_goes_to_sleep + NAP_TIME - now
if wait > 0:
"You need to wait [wait] seconds."
"How is Frodo doing?"
# You can save the game here, and load it again, or not.
# It'll work the same.
jump waiting_loop
show eileen with dissolve
"Eileen" "Hey! Are you waiting for me?"
"Eileen" "I'm sorry, I'm busy today."
scene black with fade
centered "GAME OVER"
return
Users browsing this forum: Andredron