[Solved] Use Double Action Effect on Button

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
Karas
Newbie
Posts: 4
Joined: Wed Mar 21, 2018 12:06 am
Contact:

[Solved] Use Double Action Effect on Button

#1 Post by Karas » Wed Mar 21, 2018 12:18 am

Hello, I'm really newbie on Ren'Py and a bit new with Phyton, my background is with C+, so there are some things that I can figure out by my self and with the tutorials, but with others I need some help please.

My doubt is if it is possible to use 2 action effects like the follows:

Code: Select all

        
        imagebutton:
            idle "universidad idle"
            hover "universidad hover"
            unhovered "universidad idle"
            action Notify(_("You selected Hobbies."))
            action Jump("university") alt "University"   


I want the button execute 2 effects when clicked 1 notify what was the action chosen and also jump to a Label, but when I do this the script doesn't compile and gives the report "keyword argument 'uaction' appears more than once in a imagebutton statement.

Is there some way or a correct way in where I can do that?

Thanks in advance.
Last edited by Karas on Wed Mar 21, 2018 1:19 am, edited 2 times in total.

User avatar
Milkymalk
Miko-Class Veteran
Posts: 614
Joined: Wed Nov 23, 2011 5:30 pm
Completed: Don't Look (AGS game)
Projects: KANPEKI! ★Perfect Play★
Organization: Crappy White Wings
Location: Germany
Contact:

Re: USe Double Aciion Effect on a Button

#2 Post by Milkymalk » Wed Mar 21, 2018 12:43 am

You can provide actions as a list: action [ action1, action2, ... ]
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)

User avatar
Imperf3kt
Eileen-Class Veteran
Posts: 1409
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: USe Double Aciion Effect on a Button

#3 Post by Imperf3kt » Wed Mar 21, 2018 12:52 am

You don't need the brackets, just use a comma between each action

action Notify('message'), jump 'where_to'
Image

Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

User avatar
Karas
Newbie
Posts: 4
Joined: Wed Mar 21, 2018 12:06 am
Contact:

Re: USe Double Aciion Effect on a Button

#4 Post by Karas » Wed Mar 21, 2018 1:11 am

Thanks! it works flawless!

[Solved]

Post Reply

Who is online

Users browsing this forum: ComputerArt.Club, trooper6