Page 1 of 1

How to prevent players from going back

Posted: Wed Mar 16, 2011 2:29 pm
by Sakura02
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

Re: How to prevent players from going back

Posted: Wed Mar 16, 2011 2:36 pm
by luminarious
Please don't do this. Thank You!

-- a player.

Re: How to prevent players from going back

Posted: Wed Mar 16, 2011 2:46 pm
by Lotus
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.

Re: How to prevent players from going back

Posted: Wed Mar 16, 2011 5:16 pm
by papillon
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.

Re: How to prevent players from going back

Posted: Wed Mar 16, 2011 5:52 pm
by Greeny
It's not "taking a feature away" so much as "not putting the feature in in the first place", in my opinion.

Re: How to prevent players from going back

Posted: Wed Mar 16, 2011 6:51 pm
by Anima
That's not really possible, since it's a standard Ren'Py feature.

Re: How to prevent players from going back

Posted: Wed Mar 16, 2011 7:14 pm
by SleepKirby
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.

Re: How to prevent players from going back

Posted: Sun Mar 20, 2011 6:18 pm
by Sakura02
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?

Re: How to prevent players from going back

Posted: Sun Mar 20, 2011 7:00 pm
by Aleema
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.