Temporarily disable save function?
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.
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.
- ForeverAScone
- Newbie
- Posts: 22
- Joined: Sat May 23, 2020 8:08 pm
- Location: Under your bed
- Contact:
Temporarily disable save function?
Does anyone know a way to temporarily disable the save function? For example, I have a rpg-styled battle in my game and I don’t want the player to be able to save during the battle until it is over. Thank you
Artist for hire!! Check out my post with details here!
viewtopic.php?f=61&t=65610
Portfolio here!
https://sprinklebara.crevado.com/artwork
viewtopic.php?f=61&t=65610
Portfolio here!
https://sprinklebara.crevado.com/artwork
Re: Temporarily disable save function?
Use a global variable at the start of the script, maybe called "can_save".
Set it to False at the start of the battle and back to True at the end of combat.
In the NAVIGATION screen, add a check to disable SAVE/LOAD screens.
Then, to be fully compliant, change what you reach with the right clicking just after start.
I dunno if the quick menu is there, if you had one during battle use the same check for the navigation screen to disable the save button.
Code: Select all
default can_save = True
In the NAVIGATION screen, add a check to disable SAVE/LOAD screens.
Code: Select all
action [ShowMenu("save"), SensitiveIf(can_save)]
Code: Select all
label start:
$ _game_menu = "preferences"
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.
10 ? "RENPY"
20 GOTO 10
RUN
10 ? "RENPY"
20 GOTO 10
RUN
- ForeverAScone
- Newbie
- Posts: 22
- Joined: Sat May 23, 2020 8:08 pm
- Location: Under your bed
- Contact:
Re: Temporarily disable save function?
Hi, thanks for the response (even though I'm a month late at getting back to it lol >_<) I keep getting this error message:
Code: Select all
File "game/screens.rpy", line 291: expected statement.
action [ShowMenu("save"), SensitiveIf(can_save)]
^
Ren'Py Version: Ren'Py 7.3.5.606
Fri Jul 10 16:15:19 2020
Artist for hire!! Check out my post with details here!
viewtopic.php?f=61&t=65610
Portfolio here!
https://sprinklebara.crevado.com/artwork
viewtopic.php?f=61&t=65610
Portfolio here!
https://sprinklebara.crevado.com/artwork
-
- Miko-Class Veteran
- Posts: 793
- Joined: Fri Feb 09, 2018 12:05 am
- Location: Canada
- Contact:
Re: Temporarily disable save function?
can you post the full error code
- ForeverAScone
- Newbie
- Posts: 22
- Joined: Sat May 23, 2020 8:08 pm
- Location: Under your bed
- Contact:
Re: Temporarily disable save function?
That is the full error code. I only got rid of "I'm sorry, but errors were detected in your script. Please correct the errors listed below, and try again."
But here it is again if you want it.
Code: Select all
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.
File "game/screens.rpy", line 291: expected statement.
action [ShowMenu("save"), SensitiveIf(can_save)]
^
Ren'Py Version: Ren'Py 7.3.5.606
Fri Jul 10 16:15:19 2020
Artist for hire!! Check out my post with details here!
viewtopic.php?f=61&t=65610
Portfolio here!
https://sprinklebara.crevado.com/artwork
viewtopic.php?f=61&t=65610
Portfolio here!
https://sprinklebara.crevado.com/artwork
-
- Miko-Class Veteran
- Posts: 793
- Joined: Fri Feb 09, 2018 12:05 am
- Location: Canada
- Contact:
Re: Temporarily disable save function?
do you see a traceback.txt or log.txt the traceback here if you do see it error.txt only give some info
what are put the action [ShowMenu("save"), SensitiveIf(can_save)] (whish they have the in-line bbcode) to textbutton/imagebutton??
what's the full code for it?
what are put the action [ShowMenu("save"), SensitiveIf(can_save)] (whish they have the in-line bbcode) to textbutton/imagebutton??
what's the full code for it?
- ForeverAScone
- Newbie
- Posts: 22
- Joined: Sat May 23, 2020 8:08 pm
- Location: Under your bed
- Contact:
Re: Temporarily disable save function?
You mean you want to see the full traceback code? For some reason this error is not showing up in log.txt or traceback.txt. I'm not really sure what you mean by the your question about the textbutton/imagebutton, sorryrayminator wrote: ↑Sat Jul 11, 2020 5:17 pm do you see a traceback.txt or log.txt the traceback here if you do see it error.txt only give some info
what are put the action [ShowMenu("save"), SensitiveIf(can_save)] (whish they have the in-line bbcode) to textbutton/imagebutton??
what's the full code for it?
Artist for hire!! Check out my post with details here!
viewtopic.php?f=61&t=65610
Portfolio here!
https://sprinklebara.crevado.com/artwork
viewtopic.php?f=61&t=65610
Portfolio here!
https://sprinklebara.crevado.com/artwork
-
- Miko-Class Veteran
- Posts: 793
- Joined: Fri Feb 09, 2018 12:05 am
- Location: Canada
- Contact:
Re: Temporarily disable save function?
you have to put the action in a textbutton
something like this you can't just have the action only you need something before it
something like this you can't just have the action only you need something before it
Code: Select all
textbutton _("Save") action [ShowMenu("save"), SensitiveIf(can_save)]
- RicharDann
- Veteran
- Posts: 286
- Joined: Thu Aug 31, 2017 11:47 am
- Contact:
Re: Temporarily disable save function?
I tried this too but oddly it doesn't seem to work. The textbutton is disabled properly in navigation and quick menu screen, using the method you mentioned with can_save global variable, but right-clicking keeps sending me straight to the save screen. Tried using define and default too before labels, none of them worked. Is there another solution?gas wrote: ↑Sat May 30, 2020 7:09 am Then, to be fully compliant, change what you reach with the right clicking just after start.
Code: Select all
label start: $ _game_menu = "preferences"
EDIT: Found it, seems the variable's name was changed to _game_menu_screen.
Code: Select all
label start:
$ _game_menu_screen = "preferences"
The most important step is always the next one.
Who is online
Users browsing this forum: Semrush [Bot]