How to prevent players from going back

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
Sakura02
Regular
Posts: 61
Joined: Fri Aug 27, 2010 7:49 pm
Projects: Ecchie Sketchy
Contact:

How to prevent players from going back

#1 Post by Sakura02 » Wed Mar 16, 2011 2:29 pm

I wasn't sure how to do a search if this was asked already.
Is there a code to prevent users from using arrow keys to go back in the dialogue?
Or to have a scene only been once.
Thanks

User avatar
luminarious
Veteran
Posts: 353
Joined: Thu May 01, 2008 1:12 pm
Projects: Winter, winter
Location: Estonia
Contact:

Re: How to prevent players from going back

#2 Post by luminarious » Wed Mar 16, 2011 2:36 pm

Please don't do this. Thank You!

-- a player.

User avatar
Lotus
Veteran
Posts: 298
Joined: Thu Jan 06, 2011 9:28 am
Projects: Unnamed Slenderman VN, Secret 10560
Location: USA
Contact:

Re: How to prevent players from going back

#3 Post by Lotus » Wed Mar 16, 2011 2:46 pm

luminarious wrote:Please don't do this. Thank You!

-- a player.
I lol'ed. You could always make a save for that spot in the game if you're paranoid of messing up.
Sakura02 wrote:I wasn't sure how to do a search if this was asked already.
Is there a code to prevent users from using arrow keys to go back in the dialogue?
Or to have a scene only been once.
Thanks
Does this thread help any? c: http://lemmasoft.renai.us/forums/viewto ... ck#p112729 I just tried it with my game and it works for me.

I added

Code: Select all

config.hard_rollback_limit  = 0
to an init block in my options.rpy file.

User avatar
papillon
Arbiter of the Internets
Posts: 4104
Joined: Tue Aug 26, 2003 4:37 am
Completed: lots; see website!
Projects: something mysterious involving yuri, usually
Organization: Hanako Games
Tumblr: hanakogames
Contact:

Re: How to prevent players from going back

#4 Post by papillon » Wed Mar 16, 2011 5:16 pm

It's a common ongoing argument, you can find tons of threads on the subject, where authors want to stop people rolling back in order to preserve the purity of something or other, and players are rather annoyed about it.

Rolling back isn't just about wanting to change your mind and make a different choice, it's also about "oops, I accidentally double-clicked". It also tends to irritate people that you're intentionally taking features away that they want to use, because you don't want to use them.

There are times where it makes sense, but expect a lot of grumpypants.

User avatar
Greeny
Miko-Class Veteran
Posts: 921
Joined: Sun Dec 20, 2009 10:15 am
Completed: The Loop, The Madness
Projects: In Orbit, TBA
Organization: Gliese Productions
Location: Cantankerous Castle
Contact:

Re: How to prevent players from going back

#5 Post by Greeny » Wed Mar 16, 2011 5:52 pm

It's not "taking a feature away" so much as "not putting the feature in in the first place", in my opinion.
In Orbit [WIP] | Gliese is now doing weekly erratic VN reviews! The latest: Halloween Otome!
Gliese Productions | Facebook | Twitter
Image

User avatar
Anima
Veteran
Posts: 448
Joined: Wed Nov 18, 2009 11:17 am
Completed: Loren
Projects: PS2
Location: Germany
Contact:

Re: How to prevent players from going back

#6 Post by Anima » Wed Mar 16, 2011 6:51 pm

That's not really possible, since it's a standard Ren'Py feature.
Avatar created with this deviation by Crysa
Currently working on:
  • Winterwolves "Planet Stronghold 2" - RPG Framework: Phase III

User avatar
SleepKirby
Veteran
Posts: 255
Joined: Mon Aug 09, 2010 10:02 pm
Projects: Eastern Starlight Romance, Touhou Mecha
Organization: Dai-Sukima Dan
Location: California, USA
Contact:

Re: How to prevent players from going back

#7 Post by SleepKirby » Wed Mar 16, 2011 7:14 pm

A few possibilities:

(1)

Code: Select all

    config.rollback_enabled = False
Disables rollback completely, so that the player can't go back to previous dialogue at all. This gets the same effect as setting config.hard_rollback_limit to 0 (as suggested earlier), though un-enabling rollback like this might be more intuitive.

(2) If you only want to disable rolling back past specific points in your game script, then you can use

Code: Select all

    $ renpy.block_rollback()
at each of those points.

(3) Slightly trickier, but you can do something like automatically disabling rollback after in-game choice menus. If your choice menus are handled by your own custom choice screen, then you can add renpy.block_rollback() to that screen's code. (I haven't tried it myself though, so I don't know the exact details. I know you can also do this without screen language by overriding Ren'Py's default menu handler with your own; it's a hack that should still work now, but it may or may not work in future Ren'Py versions.)

Another trickier thing to try: there's an alternative to rollback, called readback, which lets the player read previous dialogue, but doesn't allow them to "go back in time" in the game. The readback implementation I'm linking here isn't officially supported by the current version of Ren'Py; it was written by forum member delta. But it worked for me after a couple of tweaks or so.

User avatar
Sakura02
Regular
Posts: 61
Joined: Fri Aug 27, 2010 7:49 pm
Projects: Ecchie Sketchy
Contact:

Re: How to prevent players from going back

#8 Post by Sakura02 » Sun Mar 20, 2011 6:18 pm

Lol thanks Sleep Kirby. For the people freaking out, it's ok I'm not going to do it for the entire game. It's for a mini game I'm making where you can only see the animation once and then remember what was on it.

Now for the

Code: Select all

$ renpy.block_rollback()
What do I need to put in the brackets in order to toggle it off and on?

User avatar
Aleema
Lemma-Class Veteran
Posts: 2677
Joined: Fri May 23, 2008 2:11 pm
Organization: happyB
Tumblr: happybackwards
Contact:

Re: How to prevent players from going back

#9 Post by Aleema » Sun Mar 20, 2011 7:00 pm

You don't put anything in the brackets. Block Rollback prevents the player from rolling back any further than that line. It won't turn off rollback. I suggest you put it after the animation shows.

Post Reply

Who is online

Users browsing this forum: Google [Bot]