can screen be disable temporary?

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
edouardlicn
Regular
Posts: 57
Joined: Tue Feb 05, 2013 8:19 pm
Projects: April
Contact:

can screen be disable temporary?

#1 Post by edouardlicn »

Hi

I want to disable some screen like save in game procession,not disable a key.How can I make it?

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: can screen be disable temporary?

#2 Post by Donmai »

Just a suggestion: it would be better if you first tell us why do you need to do it, then someone would be able to give you the best answer.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

pwisaguacate
Veteran
Posts: 356
Joined: Mon Mar 11, 2013 11:03 pm
Contact:

Re: can screen be disable temporary?

#3 Post by pwisaguacate »

The codes below will do the following when $ allow_save = False:
  1. Make the save button inactive in the game menu
  2. Disable the save and quick save buttons in the quick menu
  3. Show the load screen when the user enters the game menu
  4. Set allow_save = True when toggle_save is called
script.rpy:

Code: Select all

init:
    $ allow_save = True

label toggle_save:
    if allow_save:
        $ _game_menu_screen = "load"
        $ allow_save = False
    else:
        $ _game_menu_screen = "save"
        $ allow_save = True
    return

label start:
    "The save screen will be disabled."
    call toggle_save # Disable save
    "The save screen is disabled."

    "The save screen will be re-enabled."
    call toggle_save # Re-enable save
    "The save screen is reenabled."

    return
screens.rpy:

Code: Select all

# Navigation (sixth screen)
screen navigation:
    [...]

        if allow_save:
            textbutton _("Save Game") action ShowMenu("save")
        else:
            textbutton _("Save Game") action None
        [...]

# Quick Menu (last screen)
screen quick_menu:
    [...]

        if allow_save:
            textbutton _("Q.Save") action QuickSave()
        else:
            textbutton _("Q.Save") action None
        textbutton _("Q.Load") action QuickLoad()
        if allow_save:
            textbutton _("Save") action ShowMenu('save')
        else:
            textbutton _("Save") action None
        [...]

Janto
Newbie
Posts: 21
Joined: Wed Apr 11, 2012 10:48 am
Projects: Fire in the Night
Location: Florence, Italy
Contact:

Re: can screen be disable temporary?

#4 Post by Janto »

Thanks pwisaguacate, that should help with a related issue involving imagebuttons!

edouardlicn
Regular
Posts: 57
Joined: Tue Feb 05, 2013 8:19 pm
Projects: April
Contact:

Re: can screen be disable temporary?

#5 Post by edouardlicn »

I need it for if game goes to a choise,ban the save funtion to prevent player use save to try choice again.That would make choice useless.

apricotorange
Veteran
Posts: 479
Joined: Tue Jun 05, 2012 2:01 am
Contact:

Re: can screen be disable temporary?

#6 Post by apricotorange »

edouardlicn wrote:I need it for if game goes to a choise,ban the save funtion to prevent player use save to try choice again.That would make choice useless.
That's a terrible reason to temporarily disable saves. All you accomplish is making players compulsively save all the time in case they run into a choice.

I mean, there are games which don't have conventional saves at all (a recent example is FTL), but that isn't really appropriate for a visual novel.

User avatar
ShippoK
Veteran
Posts: 348
Joined: Wed Mar 28, 2012 8:59 pm
Projects: Eyes of Gold (In-Progress)
Organization: (Red Moon)
Location: Glorious Nippon (A.K.A the USA)
Contact:

Re: can screen be disable temporary?

#7 Post by ShippoK »

If you want to do something like that, why not try $ renpy.block_rollback() after someone makes a choice.
Then they can only load up from the last point to do the choice again without rolling back.

Code: Select all

menu:
 "Let him be":
    $ renpy.block_rollback()
    "Blahblah"
 "Ask if you could walk with him.":
    $ renpy.block_rollback()
    "Blahblah"
Just a suggestion...
Much Appreciated for those who took the Survey!

Image Image
Eyes of Gold [BL (Suspense) (+18)] IN-PROGRESS
Alternate Online [(Friendship) (+10)] ON-HOLD
DeviantART• •[Honest critique] - 'Honesty is its own reward.'

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: can screen be disable temporary?

#8 Post by nyaatrap »

This is the best for that purpose. Don't disable save entirely.
http://www.renpy.org/doc/html/save_load ... g-rollback

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: can screen be disable temporary?

#9 Post by Donmai »

nyaatrap wrote:This is the best for that purpose. Don't disable save entirely.
http://www.renpy.org/doc/html/save_load ... g-rollback
Couldn't agree more! That's what I'm using since I saw this thread: http://lemmasoft.renai.us/forums/viewto ... =8&t=19863
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

User avatar
neometalero
Regular
Posts: 198
Joined: Sun Oct 23, 2016 3:51 am
Completed: My Dream Sport Dating Simulator, Attack Helicopter Dating Simulator
Projects: My Dream Sport Dating Simulator, Attack Helicopter Dating Simulator
Deviantart: neometalero
Contact:

Re: can screen be disable temporary?

#10 Post by neometalero »

edouardlicn wrote: Thu May 09, 2013 5:08 am Hi

I want to disable some screen like save in game procession,not disable a key.How can I make it?
I was having the same trouble and this worked. Maybe it can help you?

viewtopic.php?f=8&t=66591&p=560451#p560451
Working on many weird narrative games at Curse Box Studios
Image
https://www.curseboxstudios.com/

Post Reply

Who is online

Users browsing this forum: No registered users