[SOLVED]Need help with time system

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
creativechaos
Newbie
Posts: 9
Joined: Wed Apr 29, 2020 3:27 pm
Contact:

[SOLVED]Need help with time system

#1 Post by creativechaos »

Hello,
I am stuck at triggering an event, which should happen 6 hrs after charging the mobile phone. So not matter when the player starts charging the phone, the event needs to be triggered after 6 hrs.

This is my code for the time:

Code: Select all

   
 label world_time:
    if world_time_minute >=60:

        $ world_time_minute = world_time_minute -60
        $ world_time_hour = world_time_hour + 1

        while world_time_minute >= 60:
            $ world_time_minute = world_time_minute -60
            $ world_time_hour = world_time_hour + 1

        if world_time_hour >=8 and world_time_hour <=20:
            $ world_day_night = "Day"
        else:
            $ world_day_night = "Night"

        if world_time_hour >=24:
            $ world_time_hour = world_time_hour -24
            $ world_daycount = world_daycount + 1

            if world_day <=6:
                $ world_day = world_day + 1

            else:
                $ world_day = 1
                

    return
Thanks a lot for helping

The problem is solved!

Post Reply

Who is online

Users browsing this forum: No registered users