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.
-
HoorEnglish
- Newbie
- Posts: 8
- Joined: Mon Feb 22, 2021 8:00 pm
-
Contact:
#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
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.
-
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:
#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.
-
HoorEnglish
- Newbie
- Posts: 8
- Joined: Mon Feb 22, 2021 8:00 pm
-
Contact:
#3
Post
by HoorEnglish » Mon Mar 01, 2021 8:14 pm
I still get the same error.
-
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:
#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.
-
HoorEnglish
- Newbie
- Posts: 8
- Joined: Mon Feb 22, 2021 8:00 pm
-
Contact:
#6
Post
by HoorEnglish » Mon Mar 01, 2021 11:14 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
-
HoorEnglish
- Newbie
- Posts: 8
- Joined: Mon Feb 22, 2021 8:00 pm
-
Contact:
#7
Post
by HoorEnglish » Mon Mar 01, 2021 11:15 pm
I'd be willing to give it a try! Do you know where you put the official credits at?
-
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:
#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
-
HoorEnglish
- Newbie
- Posts: 8
- Joined: Mon Feb 22, 2021 8:00 pm
-
Contact:
#9
Post
by HoorEnglish » Mon Mar 01, 2021 11:23 pm
That was exactly the problem! I'm so mad I didn't try that beforehand. Thank you so much!
Users browsing this forum: Ocelot