Can't get my clock working :/ [SOLVED]

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
BaraAnta
Newbie
Posts: 3
Joined: Tue Mar 13, 2018 8:08 am
Contact:

Can't get my clock working :/ [SOLVED]

#1 Post by BaraAnta »

Hello,

I only recently started experimenting with Renpy and while I run into like 100 errors a day, I can usually fix them or find a workaround or use some advanced Google-Fu to figure it out. Sadly, this part has me stumped absolutely.

Thing is, I don't want a 'real time' clock, I want to make it pass 30 minutes or an hour based on what the MC does.
Line 16:

Code: Select all

$ clock = 9
This is where my variables/stats block is

Line 28:

Code: Select all

default clock = 900
(This is before label start) and I would use +=30 (for 9 to 9:30), +=100 (for 10:00) or if it's 09:30 go with +=70 (for 10:00)

Line 44-51:

Code: Select all

screen clock():
        vbox:
            if clock ==900:
                show clock/cl0.jpg
                show clock/cl9.jpg
                show clock/cmid.jpg
                show clock/cl0.jpg
                show clock/cl0.jpg
Now I know if this works it would still overlap, but I'd be cool with that, because then I could mess with the aligns etc. since it's a bunch of jpg images (0-9 and : ) in a folder titled clock I figured it made sense to add clock/ before calling on the images.

Line 104-109:

Code: Select all

### game chapter "01 Prologue" begins ###
    scene 0101 at top
    show cov at bot
    label letsgo():
    show screen control()
    show screen clock()
Screen control shows, so that's fine, I just can't get the if function (Line 46) to spit out a series of images. If you wonder why the label isn't titled 'start', it's because I have a chapter 00 Alert message to warn people that there is certain content in there they may not be cool with, so to choose to continue or leave.


Now I have seen some people pull out incredibly difficult 500 line clocks with all kinds of functions I've never even heard of but that's not what I need. I just need renpy to spit out a series of pictures based on the time.
But ALWAYS I get this:

Code: Select all

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/script.rpy", line 47: u'show' is not a keyword argument or valid child for the vbox statement.
    show clock/cl0.jpg
        ^

Ren'Py Version: Ren'Py 6.99.14.1.3218
Tue Mar 13 13:28:31 2018
Thanks to anybody that took the time to read this all, if you have a solution I'd be even more grateful!
Last edited by BaraAnta on Tue Mar 13, 2018 9:30 am, edited 1 time in total.

DannX
Regular
Posts: 99
Joined: Mon Mar 12, 2018 11:15 am
Contact:

Re: Can't get my clock working :/

#2 Post by DannX »

Shouldn't it be 'add' instead of 'show'? And I'm pretty sure the image names should be strings too...

Code: Select all

screen clock():
        vbox:
            if clock == 900:
                add 'clock/cl0.jpg'
                add 'clock/cl9.jpg'
https://www.renpy.org/doc/html/screens.html#add

BaraAnta
Newbie
Posts: 3
Joined: Tue Mar 13, 2018 8:08 am
Contact:

Re: Can't get my clock working :/

#3 Post by BaraAnta »

DannX wrote: Tue Mar 13, 2018 9:04 am Shouldn't it be 'add' instead of 'show'? And I'm pretty sure the image names should be strings too...

Code: Select all

screen clock():
        vbox:
            if clock == 900:
                add 'clock/cl0.jpg'
                add 'clock/cl9.jpg'
https://www.renpy.org/doc/html/screens.html#add
Wow! Such a simple change, and boom it works.. Thank you so much man! I guess this one is solved now! Thanks :)

Post Reply

Who is online

Users browsing this forum: Semrush [Bot]