Setting Game preference on label (syntax)

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
Mirrodin
Regular
Posts: 114
Joined: Sun Mar 19, 2017 2:56 pm
Contact:

Setting Game preference on label (syntax)

#1 Post by Mirrodin »

Hi.

I deleted the choice to the player to set himself the "rollback side preference"
I want to be sure that by default the rollback side is disable.
I want to set preference on my label start but can't find the syntax.

Trying :

Code: Select all

Set Preference("rollback side", "disable")

Define Preference("rollback side", "disable")"
but not working

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Setting Game preference on label (syntax)

#2 Post by Remix »

Code: Select all

label start:
    # stop rollback
    $ renpy.suspend_rollback(True)
    "Some Lines"
    # allow rollback *if* config is set to allow it as well
    $ renpy.suspend_rollback(False)
    "Some More Lines"
More Info and explanation of why blocking rollback is not generally a good idea
Frameworks & Scriptlets:

User avatar
Mirrodin
Regular
Posts: 114
Joined: Sun Mar 19, 2017 2:56 pm
Contact:

Re: Setting Game preference on label (syntax)

#3 Post by Mirrodin »

This article is interresting.
I don't want to disable all rollback, only the one wich work when you click on the left of the screen.
It's a problem with some call screen / imageMap.
It's the one called rollback side in the pref menu.

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Setting Game preference on label (syntax)

#4 Post by Remix »

A few options 'appear' to present themselves...

config.rollback_side_size = 0.0 # reduce the size to zero and reset to default 0.2 after
config.enable_rollback_side = False # and reset to true after

both might (probably do) also appear in _preferences, so it maybe better to set
_preferences.enable_rollback_side = False
... untested

or
if renpy.mobile:
....renpy.game.preferences.mobile_rollback_side = "disable"
else:
....renpy.game.preferences.desktop_rollback_side = "disable"

or similar with
SetField(_preferences, "desktop_rollback_side", "disable")

Not too sure which would be the advised way to do it, not too sure which actually work
Frameworks & Scriptlets:

User avatar
Mirrodin
Regular
Posts: 114
Joined: Sun Mar 19, 2017 2:56 pm
Contact:

Re: Setting Game preference on label (syntax)

#5 Post by Mirrodin »

Thanks !
For the record the

Code: Select all

config.rollback_side_size = 0.0 # reduce the size to zero and reset to default 0.2 after
config.enable_rollback_side = False # and reset to true after
works
but

Code: Select all

_preferences.enable_rollback_side = False
Don't work.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Ocelot