[solved]datetime change not working right

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
rayminator
Miko-Class Veteran
Posts: 793
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

[solved]datetime change not working right

#1 Post by rayminator »

when I want to change the daytime to night it stay at morning so what I'm doing wrong it did work but now it's not

this what in the script:

Code: Select all

show bb06 with dissolve
    $ days = 1
    $ daytime = 4
    $ david_bed_event_01 = True
    ashley "Happy 18th Birthday Sweetie..."
    ray "Happy 18th Birthday Sweetie..."
    david "Happy 18th Birthday Sis..."
    anna "Thanks Everyone..."
this my code:

Code: Select all

default day = 1
default days = 1
default daytime = 1
screen clock():
    if days == 1:
        $ days = _("Monday")
    elif days == 2:
        $ days = _("Tuesday")
    elif days == 3:
        $ days = _("Wednesday")
    elif days == 4:
        $ days = _("Thursday")
    elif days == 5:
        $ days = _("Friday")
    elif days == 6:
        $ days = _("Saturday")
    elif days == 7:
        $ days = _("Sunday")

    if daytime == 1:
        $ daytime = _("Morning")
    elif daytime == 2:
        $ daytime = _("Afternoon")
    elif daytime == 3:
        $ daytime = _("Evening")
    elif daytime == 4:
        $ daytime = _("Night")


    hbox:
        xpos 25
        ypos 50
        #sunny
        if weather == 0:
            add "gui/weather/sunny.png"
        #rain
        if weather == 1:
            add "gui/weather/rain.png"
        #thunder
        elif weather == 2:
            add "gui/weather/thunder.png"
        #partly
        elif weather == 3:
            add "gui/weather/partlycd.png"
        #NIGHT
        elif weather == 4:
            add "gui/weather/night.png"


    text "[days]":
        xpos 25
        ypos 5
        size 30
        color "#0099cc"
        outlines [(3, "#000000", 0, 0)]
        font "font/foo_regular.ttf"
    text "[day]":
        xpos 130
        ypos 5
        size 30
        color "#0099cc"
        outlines [(3, "#000000", 0, 0)]
        font "font/foo_regular.ttf"
    text "[daytime]":
        xpos 25
        ypos 35
        size 30
        color "#0099cc"
        outlines [(3, "#000000", 0, 0)]
        font "font/foo_regular.ttf"
Last edited by rayminator on Mon Aug 02, 2021 6:24 pm, edited 1 time in total.

User avatar
hell_oh_world
Miko-Class Veteran
Posts: 777
Joined: Fri Jul 12, 2019 5:21 am
Contact:

Re: datetime change not working right

#2 Post by hell_oh_world »

Youre using the same variable name 'daytime' in assigning the string in your screen.

rayminator
Miko-Class Veteran
Posts: 793
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: datetime change not working right

#3 Post by rayminator »

thanks I got it like this now

Code: Select all

if dtime == 1:
        $ dd = _("Morning")
    if dtime == 2:
        $ dd = _("Afternoon")
    if dtime == 3:
        $ dd = _("Evening")
    if dtime == 4:
        $ dd = _("Night")

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Majestic-12 [Bot]