Hey there
I want to make an Imagebutton but something is wrong with my code. It says "File "game/script.rpy", line 147: expected statement. (see PNG)
I also attached my script....
This is where its not working;
if scene w17:
imagebutton auto "images/mm_w171a_%s.jpg"
action jump w17a
"Jason""Eine Leiche?"
" ""Gulp"
"Jason""Ich sollte an die Tür gehen"
show w17
Im really new into coding so im trying to get every expertise or help i become. If there is something fundamentally missing pls tell me!
Imagebutton Code Problem
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.
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.
Imagebutton Code Problem
- Attachments
-
- script.rpy
- (4.39 KiB) Downloaded 4 times
Re: Imagebutton Code Problem
First thing is that imagebutton should be a part of the screen. Then you need to show or call this screen to let player interact with it. And 'jump' is not valid action for imagebutton - should be 'Jump".
https://www.renpy.org/doc/html/screen_actions.html#Jump
Also, 'if scene w17:' will not work, 'cause name of variable should be a single word (that must start from letter and may have letters, digits and underscores).
So, try
Code: Select all
default flag_variable = False
screen some_screen_name():
imagebutton auto "images/mm_w171a_%s.jpg" action Jump('w17a') align(0.5, 0.5)
label w17a:
hide screen some_screen_name
"Secret ending."
return
label start:
"no button on screen"
menu:
"Want to see the button?"
"Yes":
$ flag_variable = True
"No":
pass
if flag_variable:
show screen some_screen_name
"now you can click the button..."
"...if you wish."
hide screen some_screen_name
"well..."
"neutral ending"
returnhttps://www.renpy.org/doc/html/screen_actions.html
https://www.renpy.org/doc/html/python.html
https://www.renpy.org/doc/html/language ... statements
Who is online
Users browsing this forum: Bing [Bot], Google [Bot]