[Solved] A button in the options that let's you skip certain type of scenes?
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.
[Solved] A button in the options that let's you skip certain type of scenes?
Hi. I am curious if anyone knows how to do this? Can I add a button in the main menu's options (where the music volume is and so on) that when turned off will let the player skip a particular type of scenes?
Like for example if he enabled Gore on he will see scenes that contain gore, but if it's off the game will skip that content until it shows no gore in the story and so on. Thanks in advance!
Like for example if he enabled Gore on he will see scenes that contain gore, but if it's off the game will skip that content until it shows no gore in the story and so on. Thanks in advance!
Last edited by Ace94 on Mon Apr 02, 2018 11:20 pm, edited 1 time in total.
- starshine001
- Newbie
- Posts: 23
- Joined: Fri Feb 02, 2018 9:16 am
- Completed: None
- Projects: The Nightfall [Vampire Thriller]
- Organization: None
- Contact:
Re: A button in the options that let's you skip certain type of scenes?
I would just define a variable "gore" and let the player set it to True/False. Before scenes that contain gore I would let Ren'py check and, if "gore" is false, skip the scene. Once I'm home I can give a more detailed explanation.
Re: A button in the options that let's you skip certain type of scenes?
Thank you for the reply! Whenever you can give a more detailed explanation I'd love to see it! Since I am not the best in the coding I'd love to get any help I can get.starshine001 wrote: ↑Sun Apr 01, 2018 1:33 pm I would just define a variable "gore" and let the player set it to True/False. Before scenes that contain gore I would let Ren'py check and, if "gore" is false, skip the scene. Once I'm home I can give a more detailed explanation.
Re: A button in the options that let's you skip certain type of scenes?
So the only way I see I can do this is by using conditional switch like so:
and then whenever a gore scenes in the story appear I check with the if statement? Is there any other better way to do this? I was hoping to add an option in the main menu and then check it with a simple command if the player has chosen one or the other and have the default to true.
Code: Select all
"Do you want to see Gore scenes?"
"Yes":
$ gore = True
"No":
$ gore = False
- erickcire95
- Regular
- Posts: 33
- Joined: Tue Dec 26, 2017 7:38 pm
- Contact:
Re: A button in the options that let's you skip certain type of scenes?
It is possible to add an option in the Main menu or in the Preferences (which I think is better). First of all you need to create a new persistent variable, call it show_gore or something, and set it default to True or False (It might be better to set it False as default).
Do this by adding
at the top of your script.rpy file
Then let's add the option in the Preferences screen. open your screens.rpy file, around line 758 you'll find some commented lines like this
You there place a check box to toggle the show_gore variable. This way.
Make sure to have proper identation (it should match the previous vbox) and there is it!
Now you can use it, in your game script, before a Gore scene you can check if the persistent variable show_gore is activated and then skip the Gore scene.
Something like this:
and make a label after the gore scene is finished
And now you have an option in the preferences screen to skip gore
Do this by adding
Code: Select all
default persistent.show_gore = True
Then let's add the option in the Preferences screen. open your screens.rpy file, around line 758 you'll find some commented lines like this
Code: Select all
## Additional vboxes of type "radio_pref" or "check_pref" can be
## added here, to add additional creator-defined preferences.
Code: Select all
vbox:
style_prefix "check"
label _("Gore Scenes")
textbutton _("Gore On") action ToggleField(persistent, "show_gore")
Now you can use it, in your game script, before a Gore scene you can check if the persistent variable show_gore is activated and then skip the Gore scene.
Something like this:
Code: Select all
#A gore scene is about to start
if not persistent.show_gore:
jump aftergore1
#Here starts the gore scene
#...
Code: Select all
#Here ends the gore scene
label aftergore1:
#continue here
Last edited by erickcire95 on Mon Apr 02, 2018 10:33 pm, edited 3 times in total.
Re: A button in the options that let's you skip certain type of scenes?
erick Thank you so much!!! I will be trying this a bit later, but the code looks great and I am sure it will work. Thank you again.
- erickcire95
- Regular
- Posts: 33
- Joined: Tue Dec 26, 2017 7:38 pm
- Contact:
Re: A button in the options that let's you skip certain type of scenes?
Just tested it, it works fine, however I edited it to make a little changes and offer an alternative way for the last part.
Instead of creating a label and jumping to it, it might be a bit simpler to change the "if not" to an "if" and then just indent the gore scene. For example:
This way, the indented block will show only when the variable show_gore is True and it will show the non-indented block in any case.
It is up to you to chose which way you want to use. It depends on how you feel more comfortable (creating labels vs indenting lines)
Instead of creating a label and jumping to it, it might be a bit simpler to change the "if not" to an "if" and then just indent the gore scene. For example:
Code: Select all
#A gore scene is about to start
if persistent.show_gore:
#Gore scene
"This is a bloody scene"
"Blood, blood, blood..."
#Here continues the non gore scene
"At the next day..."
#...
It is up to you to chose which way you want to use. It depends on how you feel more comfortable (creating labels vs indenting lines)
Re: A button in the options that let's you skip certain type of scenes?
Amazing! Thank you very much eric. I did test it and it works wonderful. I am very thankful for your help!
- starshine001
- Newbie
- Posts: 23
- Joined: Fri Feb 02, 2018 9:16 am
- Completed: None
- Projects: The Nightfall [Vampire Thriller]
- Organization: None
- Contact:
Re: [Solved] A button in the options that let's you skip certain type of scenes?
Oof, I completely forgot that I promised to help on this xD
Sorry, Ace. But it seems your question's already been answered. I hope you project will turn out well.
Sorry, Ace. But it seems your question's already been answered. I hope you project will turn out well.
Who is online
Users browsing this forum: Bing [Bot], elcharlo, Google [Bot]