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.
Each of the three mix buttons fires off a function that should eventually keep track of what was added to the machine. It also toggles the two bools for whether the maching is not empty and when its full (mixer_empty and mixer_full). Right now it's just hardwired to flip the bools while I try to figure out my issue.
The log seems to fire fine but my "sensitive" conditional isn't recalculating. If I change one of the Imagebuttons to this then the sensitive portion works just fine
It seems like there is some issue with trying to manipulate the variables in the function that is causing an issue. I found this thread (viewtopic.php?f=8&t=30849) and thought maybe I'd found a solution but no dice.
Any thoughts?
Last edited by terrordoll on Thu May 25, 2017 6:04 pm, edited 1 time in total.
terrordoll wrote:
Each of the three mix buttons fires off a function that should eventually keep track of what was added to the machine. It also toggles the two bools for whether the maching is not empty and when its full (mixer_empty and mixer_full). Right now it's just hardwired to flip the bools while I try to figure out my issue.
That isn't working because functions are there own space. What you've done there is create a brand new variable called mixer_full and mixer_empty that only exists within that function and given them some values. To access the variables that the rest of the game is using, you need to tell the function that. So change your function like so:
def MixAdd():
global mixer_full
global mixer_empty
mixer_full = True
mixer_empty = False
renpy.log("mix add fired")
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
terrordoll wrote:
Each of the three mix buttons fires off a function that should eventually keep track of what was added to the machine. It also toggles the two bools for whether the maching is not empty and when its full (mixer_empty and mixer_full). Right now it's just hardwired to flip the bools while I try to figure out my issue.
That isn't working because functions are there own space. What you've done there is create a brand new variable called mixer_full and mixer_empty that only exists within that function and given them some values. To access the variables that the rest of the game is using, you need to tell the function that. So change your function like so: