This keeps happening to me a lot:
Tries this, does not work:
After checking this var it always seems to be True. So it's the wrong switch?
So I have to find the function/flag that is called/set by pressing SHIFT+R
*sigh* Nooo! I don't want to dig through the Ren'Py source agaaaain.
How can I force enable this programmatically?
edit:
Found renpy.set_autoreload(True) after checking what's mapped to SHIFT + R in 00keymap.rpy. This leads to the function _reload_game() that calls set_autoreload(). Tested it in my project and it shows autoreload in the titlebar now ... but still doesn't reload automatically without using SHIFT + R.
edit 2:
Solved:
Apparently it's required to call renpy.exports.reload_script() once.
- Ren'Py exits with exception while scripting/testing
- I restart the project and forget to enable SHIFT+R autoreload
- I keep scripting and expect Ren'Py to reload my changes in the background automatically
- Something isn't working the way I expect and I start looking for errors in scripts ...
- ... until I realize autoreload is off *rage because time wasted*
Tries this, does not work:
Python:
if config.developer:
$ config.autoreload = True
You must be registered to see the links
After checking this var it always seems to be True. So it's the wrong switch?
So I have to find the function/flag that is called/set by pressing SHIFT+R
*sigh* Nooo! I don't want to dig through the Ren'Py source agaaaain.
How can I force enable this programmatically?
edit:
Found renpy.set_autoreload(True) after checking what's mapped to SHIFT + R in 00keymap.rpy. This leads to the function _reload_game() that calls set_autoreload(). Tested it in my project and it shows autoreload in the titlebar now ... but still doesn't reload automatically without using SHIFT + R.
edit 2:
Solved:
Python:
label splashscreen:
if config.developer:
# check autoreload flag to not end up in endless script reload loop
if renpy.get_autoreload() == False:
# enable autoreload on first start only
$ renpy.set_autoreload(True)
$ renpy.exports.reload_script()
return # skip splashscreen in developer mode
# actual splashscreen content goes here ...