[Solved] Scrolling Credits Help

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
HoorEnglish
Newbie
Posts: 8
Joined: Mon Feb 22, 2021 8:00 pm
Contact:

[Solved] Scrolling Credits Help

#1 Post by HoorEnglish » Mon Mar 01, 2021 6:13 am

Hello! I want to have some scrolling credits for my game. I am currently using the code from over here: viewtopic.php?t=42667

But when testing it and the credits finish scrolling, it seems to just stop on the black screen and not return to the main menu automatically. I've been trying to use the timer that Divona linked

Code: Select all

timer 5.0 action Return()
but whenever I test it I get this error:

Code: Select all

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


File "game/credits.rpy", line 34: expected statement.
    timer 0.5 action Return(return)
           ^

Ren'Py Version: Ren'Py 7.4.0.1167
Mon Mar  1 05:10:07 2021
```
Just in case it doesn't show here, the error looks like "timer 0-->.5 action Return(return)"

Is there any way to fix this error?
Last edited by HoorEnglish on Mon Mar 01, 2021 11:50 pm, edited 1 time in total.

User avatar
hell_oh_world
Miko-Class Veteran
Posts: 777
Joined: Fri Jul 12, 2019 5:21 am
Projects: The Button Man
Organization: NILA
Github: hell-oh-world
Location: Philippines
Contact:

Re: Scrolling Credits Help

#2 Post by hell_oh_world » Mon Mar 01, 2021 9:10 am

the `return` word is a part of python syntax, so technically its reserved, you cant use that to name your variables etc.
doing just simply `Return()` would solve your problem.

User avatar
HoorEnglish
Newbie
Posts: 8
Joined: Mon Feb 22, 2021 8:00 pm
Contact:

Re: Scrolling Credits Help

#3 Post by HoorEnglish » Mon Mar 01, 2021 8:14 pm

hell_oh_world wrote:
Mon Mar 01, 2021 9:10 am


I still get the same error.

User avatar
hell_oh_world
Miko-Class Veteran
Posts: 777
Joined: Fri Jul 12, 2019 5:21 am
Projects: The Button Man
Organization: NILA
Github: hell-oh-world
Location: Philippines
Contact:

Re: Scrolling Credits Help

#4 Post by hell_oh_world » Mon Mar 01, 2021 9:20 pm

is that the full traceback? if not please paste the full traceback.
also, share parts of your current code now? the error might be coming from the other part.

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

Re: Scrolling Credits Help

#5 Post by rayminator » Mon Mar 01, 2021 10:16 pm

I would suggest to use this one here I have used it and it works
viewtopic.php?f=51&t=22481#p283922

User avatar
HoorEnglish
Newbie
Posts: 8
Joined: Mon Feb 22, 2021 8:00 pm
Contact:

Re: Scrolling Credits Help

#6 Post by HoorEnglish » Mon Mar 01, 2021 11:14 pm

hell_oh_world wrote:
Mon Mar 01, 2021 9:20 pm
It doesn't allow me to do a full traceback for some reason. There's barely any code in my script file. It's just character dialogue really.

Code: Select all

#This part of my code is in my custom_atl.rpy file.
transform credits_scroll(speed):
    ypos 720
    linear speed ypos -720

Code: Select all

#this is in a credits.rpy file
screen credits():
    style_prefix "credits"

    add "#000"

    frame at credits_scroll(5.0):
        background None
        xalign 0.5

        vbox:
            label "Credits"

            null height 20

            hbox:
                text "CHARACTER"
                text "VA"

            hbox:
                text "CHARACTER"
                text "VA"


style credits_hbox:
    spacing 40
    ysize 30

style credits_label:
    xalign 0.5

style credits_text:
    xalign 0.5

timer 0.5 action Return()

Code: Select all

#and this is at the very end of my script.rpy file
call screen credits
return 

User avatar
HoorEnglish
Newbie
Posts: 8
Joined: Mon Feb 22, 2021 8:00 pm
Contact:

Re: Scrolling Credits Help

#7 Post by HoorEnglish » Mon Mar 01, 2021 11:15 pm

rayminator wrote:
Mon Mar 01, 2021 10:16 pm
I'd be willing to give it a try! Do you know where you put the official credits at?

User avatar
midgethetree
Regular
Posts: 39
Joined: Wed Dec 30, 2020 3:51 pm
Completed: Appetité Amor, The Mother of Pearls, Anise Flowers, Sinless: on Middle Ground, Back When, I'm Just Here to Change the Lights, DUFE: Masquerade
Projects: When Everyone's Watching
Github: midgethetree
itch: midge-the-tree
Discord: rainafc#3353
Contact:

Re: Scrolling Credits Help

#8 Post by midgethetree » Mon Mar 01, 2021 11:17 pm

That timer needs to be in a screen. It is currently outside of any. Move it inside the credits screen as demonstrated below:

Code: Select all

screen credits():
    style_prefix "credits"

    add "#000"

    frame at credits_scroll(5.0):
        background None
        xalign 0.5

        vbox:
            label "Credits"

            null height 20

            hbox:
                text "CHARACTER"
                text "VA"

            hbox:
                text "CHARACTER"
                text "VA"

    timer 0.5 action Return()

style credits_hbox:
    spacing 40
    ysize 30

style credits_label:
    xalign 0.5

style credits_text:
    xalign 0.5

User avatar
HoorEnglish
Newbie
Posts: 8
Joined: Mon Feb 22, 2021 8:00 pm
Contact:

Re: Scrolling Credits Help

#9 Post by HoorEnglish » Mon Mar 01, 2021 11:23 pm

midgethetree wrote:
Mon Mar 01, 2021 11:17 pm
That was exactly the problem! I'm so mad I didn't try that beforehand. Thank you so much!

Post Reply

Who is online

Users browsing this forum: Ocelot