I'm trying to be fancy with my nvl dialogue menus by introducing sub-screens with more unusual interactions attached to them. So, for example, in some cases instead of using a regular set of choices that operate on i.action, I have a special sub-screen with textbuttons that introduce variable changes, checks, automatic recoloring, branching, tooltip showcases and so on.
Code: Select all
screen interactions_scene_prologue_01():
$ interactions_amount = 0
if not scene_prologue_01_observingbridge:
$ interactions_amount += 1
textbutton _("Examine the bridge.") action SetVariable("meta_image_single_left", "land_prologue_01"), SetVariable("meta_image_single_right", "place_prologue_bridge_01"), SetVariable("scene_prologue_01_picked", scene_prologue_01_picked+1), SetVariable("scene_prologue_01_observingbridge", 1), SetVariable("custom01", scene_prologue_01_observingbridge_description), SelectedIf(Jump("scene_prologue_01_choiceset"))
if not scene_prologue_01_lookingattheothers:
$ interactions_amount += 1
textbutton _("Look at the others.") action SetVariable("meta_image_single_left", "land_prologue_01"), SetVariable("meta_image_single_right", "sprite_ziv_idle_01"), SetVariable("scene_prologue_01_picked", scene_prologue_01_picked+1), SetVariable("scene_prologue_01_lookingattheothers", 1), SetVariable("custom01", scene_prologue_01_lookingattheothers_description), SelectedIf(Jump("scene_prologue_01_choiceset"))
if not scene_prologue_01_talkingtooctavian:
$ interactions_amount += 1
textbutton _("Speak with {color=#fffbe0}the guide{/color}."):
action SetVariable("meta_image_single_left", "place_prologue_bridge_01"), SetVariable("meta_image_single_right", "sprite_octavian_idle_01"), SetVariable("scene_prologue_01_picked", scene_prologue_01_picked+1), SetVariable("scene_prologue_01_talkingtooctavian", 1), SetVariable("custom01", scene_prologue_01_talkingtooctavian_description), SelectedIf(Jump("scene_prologue_01_octavian_choiceset"))
hovered SetVariable("choiceset_comment", "octavian"), Show("choiceset_comment_descriptions", transition=None)
unhovered SetVariable("choiceset_comment", 0), Hide("choiceset_comment_descriptions", transition=None)
if not scene_prologue_01_observingnature:
$ interactions_amount += 1
textbutton _("Pay attention to the surroundings.") action SetVariable("meta_image_single_left", "place_prologue_bridge_01"), SetVariable("meta_image_single_right", "place_prologue_straightroad_01"), SetVariable("scene_prologue_01_picked", scene_prologue_01_picked+1), SetVariable("scene_prologue_01_observingnature", 1), SetVariable("custom01", scene_prologue_01_observingnature_description), SelectedIf(Jump("scene_prologue_01_choiceset"))
if not scene_prologue_01_observingcargo:
$ interactions_amount += 1
textbutton _("Examine the cargo.") action SetVariable("meta_image_single_left", "land_prologue_01"), SetVariable("meta_image_single_right", "sprite_wagon_01"), SetVariable("scene_prologue_01_picked", scene_prologue_01_picked+1), SetVariable("scene_prologue_01_observingcargo", 1), SetVariable("custom01", scene_prologue_01_observingcargo_description), SelectedIf(Jump("scene_prologue_01_choiceset"))
if interactions_amount >= scene_prologue_01_all:
textbutton _("With no patience left, press on.") action SetVariable("custom01", ""), SelectedIf(Jump("scene_prologue_02"))
elif interactions_amount:
textbutton _("Join the rest of the expedition.") action SetVariable("custom01", ""), SelectedIf(Jump("scene_prologue_02"))
else:
textbutton _("The others give us annoyed looks.") action SetVariable("custom01", ""), SelectedIf(Jump("scene_prologue_02"))
Therefore, the game fails to save correctly until the game leaves the current set offered by the screen and gets into actually a new "nvl" interaction.
I've been playing for hours with various ways to force renpy.restart_interaction , or ui.interact() , or adding functions to the textbuttons, or hiding and reshowing some screens. But I simply failed at everything.
Is there some sort of solution I'm missing?