On screens and image buttons

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
maliciousmonster
Newbie
Posts: 2
Joined: Mon Apr 15, 2019 2:55 am
Projects: To the Victor
Location: Australia
Contact:

On screens and image buttons

#1 Post by maliciousmonster » Sun Nov 24, 2019 6:24 am

Okay well I've been trying to get this to work for a couple of days and no matter what I read, watch, or try, nothing appears to be working. I think I have the very basics down but at the moment it just doesn't appear to be working.

What I'm trying to do is make three images able to be selective, however, I appear to be having trouble making it jump to a certain point in the code when I call the screen. I'm not sure if this is a problem with my coding—the most likely scenario—or if something else is going on.

My code is as such:

Code: Select all

screen class_select():
        imagebutton:
            idle "IMAGEBUTTONS/Soldier dark.png"
            selected_idle "IMAGEBUTTONS/Soldier Symbol1.png"
            action jump ('soldier')
However, the error I get back from this is:

Code: Select all

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


File "game/myscreens.rpy", line 5: u'jump' is not a keyword argument or valid child for the imagebutton statement.
    action jump ('soldier')
               ^

Ren'Py Version: Ren'Py 6.99.12.4.2187
From what I've read it looks right but also knowing me I completely overlooked something in my code. So I either need to figure out how to fix it or find some kind of workaround for what I want to do. Any help you can give me would be appreciated, thanks.

User avatar
Alex
Lemma-Class Veteran
Posts: 2981
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: On screens and image buttons

#2 Post by Alex » Sun Nov 24, 2019 6:38 am

Screen actions are start with capital letter, so that's why Ren'Py complains about 'jump' - it must be 'Jump'.
https://www.renpy.org/doc/html/screen_actions.html#Jump

User avatar
deltadidirac
Regular
Posts: 123
Joined: Fri Nov 30, 2018 5:00 am
Projects: Artworks and Comics
Tumblr: deltadidirac
Deviantart: Deltadidirac67
Location: Europe
Contact:

Re: On screens and image buttons

#3 Post by deltadidirac » Sun Nov 24, 2019 7:27 am

maliciousmonster wrote:
Sun Nov 24, 2019 6:24 am
Okay well I've been trying to get this to work for a couple of days and no matter what I read, watch, or try, nothing appears to be working. I think I have the very basics down but at the moment it just doesn't appear to be working.

What I'm trying to do is make three images able to be selective, however, I appear to be having trouble making it jump to a certain point in the code when I call the screen. I'm not sure if this is a problem with my coding—the most likely scenario—or if something else is going on.

My code is as such:

Code: Select all

screen class_select():
        imagebutton:
            idle "IMAGEBUTTONS/Soldier dark.png"
            selected_idle "IMAGEBUTTONS/Soldier Symbol1.png"
            action jump ('soldier')
However, the error I get back from this is:

Code: Select all

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


File "game/myscreens.rpy", line 5: u'jump' is not a keyword argument or valid child for the imagebutton statement.
    action jump ('soldier')
               ^

Ren'Py Version: Ren'Py 6.99.12.4.2187
From what I've read it looks right but also knowing me I completely overlooked something in my code. So I either need to figure out how to fix it or find some kind of workaround for what I want to do. Any help you can give me would be appreciated, thanks.
Perhaps your problem is this... try to write correctly this:

Code: Select all

action [Hide ("class_select"), Jump ("slodier")]
I add the "Hide" command to close the screen when you jump to your label, but if you want that the screen must be shown, so don't add this command.

User avatar
maliciousmonster
Newbie
Posts: 2
Joined: Mon Apr 15, 2019 2:55 am
Projects: To the Victor
Location: Australia
Contact:

Re: On screens and image buttons

#4 Post by maliciousmonster » Sun Nov 24, 2019 9:38 am

I, er, actually ended up figuring out how to fix my problem just before I got this reply but thanks for the help anyway!

Post Reply

Who is online

Users browsing this forum: Ocelot