[SOLVED] Issue with imagebutton and jump as a child(?)

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
mieauk
Newbie
Posts: 4
Joined: Sat Jul 13, 2019 12:00 pm
Contact:

[SOLVED] Issue with imagebutton and jump as a child(?)

#1 Post by mieauk »

Hello!

I'm trying to learn how to implement a navigation system in my game, by adding arrow buttons that lead you to other rooms (labels). However, I'm very new to this and it doesn't seem to work out no matter what I do.

Those below are two examples of screens with the buttons:

Code: Select all

screen sc_street:
    modal True
    imagebutton auto "hud/button_%s.png" xalign 0.2 yalign 0.5 focus_mask True jump("bg2")
    imagebutton auto "hud/button_%s.png" xalign 0.5 yalign 0.5 focus_mask True jump("vending_machine")
    imagebutton auto "hud/button_%s.png" xalign 0.8 yalign 0.5 focus_mask True jump("bg2")

screen sc_bg2:
    modal True
    imagebutton auto "hud/button_%s.png" xalign 0.5 yalign 0.5 focus_mask True jump("street")
But that leads to an error that says "u'jump' is not a keyword argument or valid child for the imagebutton statement".

Could anyone tell me what I can do to fix it? What did I do wrong and what action should I use, if not jump? If possible, please keep the explanation as simple as possible as I am a total beginner.

Thanks in advance! :>
Last edited by mieauk on Sat Jul 13, 2019 12:58 pm, edited 1 time in total.

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

Re: Issue with imagebutton and jump as a child(?)

#2 Post by Alex »

You've got this error 'cause you didn't specified that 'Jump' is an action for the button - should be

Code: Select all

imagebutton auto "hud/button_%s.png" xalign 0.5 yalign 0.5 focus_mask True action Jump("street")
https://www.renpy.org/doc/html/screens.html#imagebutton


Also, check the list of actions ('Jump' action has capital 'J') - https://www.renpy.org/doc/html/screen_actions.html

User avatar
mieauk
Newbie
Posts: 4
Joined: Sat Jul 13, 2019 12:00 pm
Contact:

Re: Issue with imagebutton and jump as a child(?)

#3 Post by mieauk »

You've got this error 'cause you didn't specified that 'Jump' is an action for the button - should be
I had "action" there in my code but for some reason, my dumb*ss didn't transcript it here.
Also, check the list of actions ('Jump' action has capital 'J')
This fixed it! I'm new to programming and thought that having it all lower case was aesthetically pleasing. Didn't even imagine anything there was case sensitive.
Thank you so so much!

Post Reply

Who is online

Users browsing this forum: Mica