How to update data without end_interaction

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
User avatar
barsunduk
Regular
Posts: 33
Joined: Fri Jul 18, 2014 1:06 pm
Completed: «Crystal City», «Mega City», «Kilmonger», «Neuronaut», «Love, Death & Veggies», «Arrow Tourney», «Big Red Hood: Halloween», «Succubus Throne»
Projects: «Swordsman Tourney», «This Tiny Galaxy»
Organization: 7DOTS
itch: 7dots
Contact:

How to update data without end_interaction

#1 Post by barsunduk »

Here's the simple code:

Code: Select all

define config.default_fullscreen = True

screen test:
    button:
        xfill True
        yfill True
        action NullAction()

        vbox:
            align(.5, .5)

            textbutton "next stage (dismiss)" action Function(renpy.end_interaction, True) text_size 77 xalign .5

            hbox:
                xalign .5

                textbutton "save" action QuickSave() text_size 77
                null width 422
                textbutton "load" action QuickLoad(confirm=False) text_size 77

            hbox:
                xalign .5

                if change:
                    textbutton "–" action SetVariable("x", x - 1), Function(renpy.retain_after_load) text_size 222
                label "[x]" text_size 222
                if change:
                    textbutton "+" action SetVariable("x", x + 1), Function(renpy.retain_after_load) text_size 222

label start:
    $ change = True
    $ x = 0
    $ renpy.retain_after_load()

    show screen test

    "Stage 1. If you save the game to a slot, then after loading from the slot the variable will be reset.\nPress 'save' and then 'load'."

    $ change = False

    "Stage 2. The variable is now updated and can be stored in the slot.\nPress 'save' and then 'load'."
    return
What should I do to keep store variables in a slot without dismiss (renpy.end_interaction)? The game should remain at stage 1.
(renpy.retain_after_load doesn't work...)

Image

User avatar
barsunduk
Regular
Posts: 33
Joined: Fri Jul 18, 2014 1:06 pm
Completed: «Crystal City», «Mega City», «Kilmonger», «Neuronaut», «Love, Death & Veggies», «Arrow Tourney», «Big Red Hood: Halloween», «Succubus Throne»
Projects: «Swordsman Tourney», «This Tiny Galaxy»
Organization: 7DOTS
itch: 7dots
Contact:

Re: How to update data without end_interaction

#2 Post by barsunduk »

Ha, this only doesn’t work on 8.1.2 and 8.1.3. On 7.5.3 and 8.1.1 everything is fine.
It's just a bug.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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: How to update data without end_interaction

#3 Post by PyTom »

Can you check out the latest nightly, from https://nightly.renpy.org ? There have been a number of fixes in this area.
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

User avatar
barsunduk
Regular
Posts: 33
Joined: Fri Jul 18, 2014 1:06 pm
Completed: «Crystal City», «Mega City», «Kilmonger», «Neuronaut», «Love, Death & Veggies», «Arrow Tourney», «Big Red Hood: Halloween», «Succubus Throne»
Projects: «Swordsman Tourney», «This Tiny Galaxy»
Organization: 7DOTS
itch: 7dots
Contact:

Re: How to update data without end_interaction

#4 Post by barsunduk »

PyTom wrote: Mon Nov 06, 2023 1:05 am Can you check out the latest nightly, from https://nightly.renpy.org ? There have been a number of fixes in this area.
Doesn't work =(
Last edited by barsunduk on Tue Nov 21, 2023 2:39 pm, edited 1 time in total.

User avatar
barsunduk
Regular
Posts: 33
Joined: Fri Jul 18, 2014 1:06 pm
Completed: «Crystal City», «Mega City», «Kilmonger», «Neuronaut», «Love, Death & Veggies», «Arrow Tourney», «Big Red Hood: Halloween», «Succubus Throne»
Projects: «Swordsman Tourney», «This Tiny Galaxy»
Organization: 7DOTS
itch: 7dots
Contact:

Re: How to update data without end_interaction

#5 Post by barsunduk »

renpy-8.2.0.24012001+nightly-sdk
renpy.retain_after_load() works!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Amazon [Bot], decocloud