Preventing additional points gained on 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
veravee__
Newbie
Posts: 4
Joined: Tue Sep 13, 2022 5:34 pm
itch: veravee
Contact:

Preventing additional points gained on rollback?

#1 Post by veravee__ » Wed Sep 14, 2022 3:39 pm

I'm already back with another question!

In thinking about rollback in a story, it allows the player to go back to a previous point and choose a new option. In theory, a player could spam going back and forth to artificially build points in a given variable, correct? What's the best way to prevent this, so that a player only gets the point gain once?

Would it just be recommended to turn off rollback, in that case? If so, what's the best way to disable rollback within a game?

Thanks in advance!

User avatar
Alex
Lemma-Class Veteran
Posts: 2981
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Preventing additional points gained on rollback?

#2 Post by Alex » Wed Sep 14, 2022 4:13 pm

How your points gaining system works? In most cases when player rolls back the value of variables changes to previous state, so rolling back and forth won't give any advantages.

veravee__
Newbie
Posts: 4
Joined: Tue Sep 13, 2022 5:34 pm
itch: veravee
Contact:

Re: Preventing additional points gained on rollback?

#3 Post by veravee__ » Wed Sep 14, 2022 4:52 pm

Oh! I didn't realize it also rolled back the state at the same time. I'm just using a very simple points system with one-line python statements to add / subtract values upon certain scenes.

User avatar
Andredron
Miko-Class Veteran
Posts: 535
Joined: Thu Dec 28, 2017 2:37 pm
Completed: Kimi ga nozomu renpy-port(demo), Albatross Koukairoku(demo)
Projects: Sisters ~Natsu no Saigo no Hi~(renpy-port)
Location: Russia
Contact:

Re: Preventing additional points gained on rollback?

#4 Post by Andredron » Wed Sep 14, 2022 6:37 pm

veravee__ wrote:
Wed Sep 14, 2022 4:52 pm
Oh! I didn't realize it also rolled back the state at the same time. I'm just using a very simple points system with one-line python statements to add / subtract values upon certain scenes.
https://www.renpy.org/doc/html/save_loa ... after-load

If you do not have this function enabled, then the rollback will return the old value,

if enabled, remove the line
I'm writing a Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18

Help me to register in QQ International

Honest Critique

User avatar
Ocelot
Eileen-Class Veteran
Posts: 1882
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Preventing additional points gained on rollback?

#5 Post by Ocelot » Wed Sep 14, 2022 6:45 pm

retain_after_load has no effect on rollback to previous statement. It only affects changes between beginning and end of single statement.
< < insert Rick Cook quote here > >

User avatar
Andredron
Miko-Class Veteran
Posts: 535
Joined: Thu Dec 28, 2017 2:37 pm
Completed: Kimi ga nozomu renpy-port(demo), Albatross Koukairoku(demo)
Projects: Sisters ~Natsu no Saigo no Hi~(renpy-port)
Location: Russia
Contact:

Re: Preventing additional points gained on rollback?

#6 Post by Andredron » Wed Sep 14, 2022 8:27 pm

Ocelot wrote:
Wed Sep 14, 2022 6:45 pm
retain_after_load has no effect on rollback to previous statement. It only affects changes between beginning and end of single statement.
Ok
I'm writing a Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18

Help me to register in QQ International

Honest Critique

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Majestic-12 [Bot]