Multiple actions for 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
SundownKid
Lemma-Class Veteran
Posts: 2294
Joined: Mon Feb 06, 2012 9:50 pm
Completed: Icebound, Selenon Rising Ep. 1-2
Projects: Selenon Rising Ep. 3-4
Organization: Fastermind Games
Deviantart: sundownkid
Location: NYC
Contact:

Multiple actions for buttons?

#1 Post by SundownKid » Fri Mar 30, 2012 10:15 am

Is it possible to make a button perform multiple actions when pressed? For example, if I wanted a button to perform

Code: Select all

action Jump("Stuff")
and

Code: Select all

action Hide("Stuff")
at the same time?

User avatar
nyaatrap
Crawling Chaos
Posts: 1823
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Multiple actions for buttons?

#2 Post by nyaatrap » Fri Mar 30, 2012 10:22 am

You can use the list of functions like:

Code: Select all

 action [Jump'"Stuff", Hide("Stuff")]
:)

User avatar
PyTom
Ren'Py Creator
Posts: 15271
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Multiple actions for buttons?

#3 Post by PyTom » Sat Mar 31, 2012 10:21 pm

Actually, this one won't work. Jump has to be the last one in a list. So [ Hide("stuff"), Jump("stuff") ] will work, but the code above won't.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: No registered users