Is it possible to "lock" a choice?

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
Cotton Blue
Regular
Posts: 117
Joined: Fri May 22, 2015 11:48 am
Projects: メモリーズ~ 女神の保護者
Organization: Cotton Blue
Deviantart: CottonBlueVN
Soundcloud: Cotton Blue
itch: Cotton Blue
Location: Chile
Contact:

Is it possible to "lock" a choice?

#1 Post by Cotton Blue »

For example, the visual novel presents the following choices:

Code: Select all

menu:
        "I trust Kinda":
            jump ktp

        "Kinda es my best friend":
            jump kfp2

But to be able to select the first choice ("I trust Kinda"), it is necessary to have completed the other endings of the character.

How can I make Ren'Py recognize when the player has completed four endings, then that option is available to get the ending #5?
Memories~ Megami no hogo-sha [GxB] [Fantasy, Romance, Drama, Yōkai]

Image

User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: Is it possible to "lock" a choice?

#2 Post by IrinaLazareva »

use persistent data and if-clause...and disabled buttons (optional):

Code: Select all

define config.menu_include_disabled = True #(optional)

    #<.....>
    
label nevermind:
    'Bla'
    menu:
        "I trust Kinda" if persistent.akind and persistent.bkind:
            jump ktp
        "Kinda es my best friend":
            $ persistent.akind = True 
            jump kfp2
        "something else":
            $ persistent.bkind = True
            jump whatever

Post Reply

Who is online

Users browsing this forum: No registered users