Upgrading to 6.18 broke my screen code. [Solved]

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
ForklessAnon
Regular
Posts: 49
Joined: Fri Sep 06, 2013 1:13 am
Contact:

Upgrading to 6.18 broke my screen code. [Solved]

#1 Post by ForklessAnon »

I recently got back into development after a hiatus and upgraded to 6.18 from 6.17. In 6.17 (I believe it was the February release) the following code worked properly. {Removed}
After I updated to the most recent release it stopped working properly. The buttons operate correctly but the audio is messed up. Now instead of running through the conditionals to determine what to execute, it seems to execute all python statements in order no matter where it's located.

I've tried commenting out the stop audio line and others, but that only ignored the line and the previous statement is executed (even if it wasn't allowed to from the conditionals).

If anyone has any idea on how to get it working again, I'd be very grateful.
Last edited by ForklessAnon on Sat Nov 22, 2014 1:56 pm, edited 1 time in total.

User avatar
PyTom
Ren'Py Creator
Posts: 16093
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: Upgrading to 6.18 broke my screen code.

#2 Post by PyTom »

In screens, you're not allowed to put code in python blocks that has a side effect. You want to use the Play action, not the play function.

Actually, you may want to move the code that manages music out of the screen entirely, and into a function that's added to config.interact_callbacks.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

ForklessAnon
Regular
Posts: 49
Joined: Fri Sep 06, 2013 1:13 am
Contact:

Re: Upgrading to 6.18 broke my screen code.

#3 Post by ForklessAnon »

Oh. Good. config.interact_callbacks works. Thanks Tom!

Post Reply

Who is online

Users browsing this forum: No registered users