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.
Thanks for reading this! As the title says, I can't seem to get my characters voice to toggle off (as in the " hotspot (556,300,87,56) action ToggleVoiceMute("m") and ToggleVoiceMute("g") and Return(value=None)" button does nothing, the voices still play as normal.
It might be time to debug or consider just muting the entire voice channel ( ToggleMute("voice") )
Debug would be just an overlay screen showing the persistent._voice_mute data...
Tried that as well, but the debug screen doesn't display anything but "Mute:". I suspect there's a problem with the "off" button for whatever reason but I can't seem to figure out why.
"
hotspot (556,300,87,56) action ToggleVoiceMute("m") and ToggleVoiceMute("g") and Return(value=None)
probably caused the program to run "ToggleVoiceMute("m")" and "Return(value=None)" at the same time so the return overrided the mute. (At least that's what my programmer friend said, he's not too sure about it either.)
But making another separate button like "Confirm" as Return solved this problem, so yay!
Thanks Remix for your help!
Tbh, using a list --- action [ Action, Action, Action ] --- would still semantically be better as python uses 'and' within conditional logic...
>>> print 1 and 1 and 1
1
>>> print 1 and 1 and 0
0
>>> print (1 and 0) and 1
0
Using and within the action could be interpreted as returning the result of the conditional rather than just running each action. I've never before seen anyone use and within multiple actions and I would be dubious of the return value if you needed a not None/False/0 result.