Passing variable value from new "context" back to main game? [SOLVED]

appelflappel

New Member
Mar 10, 2019
4
3
Maybe a persistent variable would work? Then the variable should also be independent of which save file you are on. You also need to make sure to save the persistent variables after changing. So this would be

Python:
action [SetVariable("persistent.cumsoundon", True), renpy.save_persistent(), Hide("mcchoosesound"), Return]
And similarly for disabling it. Then you can again use persistent.cumsoundon to get the current value of the variable. This should also work with call_in_new_context
 
  • Like
Reactions: EpicLust

EpicLust

Dev of Cockham Superheroes
Game Developer
May 30, 2017
3,779
7,198
Maybe a persistent variable would work? Then the variable should also be independent of which save file you are on. You also need to make sure to save the persistent variables after changing. So this would be

Python:
action [SetVariable("persistent.cumsoundon", True), renpy.save_persistent(), Hide("mcchoosesound"), Return]
And similarly for disabling it. Then you can again use persistent.cumsoundon to get the current value of the variable. This should also work with call_in_new_context
Thank you, I like that and it works!
 
  • Like
Reactions: appelflappel