[Solved] Keeping text loop out of history/rollback

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
nature1996
Regular
Posts: 62
Joined: Wed Jun 21, 2017 10:35 am
Contact:

[Solved] Keeping text loop out of history/rollback

#1 Post by nature1996 » Tue May 07, 2019 1:29 am

Hello,

In my game, I have a tutorial that loop until a certain action has been done, but I want it to only appear once in the history and rollback (aka you don't have to back for a year to get to the line before the tutorial). Is that possible, and how would I do that?
Last edited by nature1996 on Tue May 07, 2019 8:53 am, edited 1 time in total.
Je parle aussi français

User avatar
Matalla
Veteran
Posts: 202
Joined: Wed Mar 06, 2019 6:22 pm
Completed: The Lost Smile
itch: matalla-interactive
Location: Spain
Contact:

Re: Keeping text loop out of history/rollback

#2 Post by Matalla » Tue May 07, 2019 1:48 am

I'm not sure if this is exactly what you want, but you can deactivate history before the tutorial with this
https://www.renpy.org/doc/html/store_va ... r-_history

Then, after the tutorial is finished, manually add the entry as you want with something like this and reactivate history afterwards.

Code: Select all

$ narrator.add_history(kind="adv", who=None, what="whatever")
Or, if you know exactly how and when the user make the proper choice, activate history then without the need to manually add the entry.

I don't know exactly how to deal with the rollback thing, sorry. Maybe using this?
https://www.renpy.org/doc/html/save_loa ... d_rollback
Comunidad Ren'Py en español (Discord)
Honest Critique

User avatar
nature1996
Regular
Posts: 62
Joined: Wed Jun 21, 2017 10:35 am
Contact:

Re: Keeping text loop out of history/rollback

#3 Post by nature1996 » Tue May 07, 2019 8:03 am

For the history, I ended up using the variable just under it:https://www.renpy.org/doc/html/store_va ... story_list
By doing history.pop() for each statement before the jump, I can remove the double before they happens.

Doesn't work for the rollback though... Still no solution.
Je parle aussi français

User avatar
nature1996
Regular
Posts: 62
Joined: Wed Jun 21, 2017 10:35 am
Contact:

Re: Keeping text loop out of history/rollback

#4 Post by nature1996 » Tue May 07, 2019 8:52 am

Finally, upon reconsideration, I made this out:

Code: Select all

label tutorial_1:

    tutorial "Describe the game mechanic."

    if not test_to_continue:

        $ _history = False

        $ renpy.suspend_rollback(True)

        jump tutorial_1

    $ renpy.suspend_rollback(False)

    $ _history = True
    
    #the rest of the story
Je parle aussi français

Post Reply

Who is online

Users browsing this forum: No registered users