How to make a character unlockable?

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
LPRe
Newbie
Posts: 19
Joined: Mon Feb 23, 2015 1:37 am

How to make a character unlockable?

#1 Post by LPRe »

How would I go about making a character unlockable if the player's achieved any of the other endings -- or just a specific ending? Would I just make a true/false sort of thing or is there a better way of going about it?

User avatar
Luxliev
Veteran
Posts: 242
Joined: Sat Feb 07, 2015 11:01 am
Soundcloud: Luxliev
Contact:

Re: How to make a character unlockable?

#2 Post by Luxliev »

True false is good idea.

Place new variable in init block

Code: Select all

init:
    $ new_unlocked_character_john = False
Place this code with good indentation at the moment character is unlocked

Code: Select all

$ new_unlocked_character_john = True
At the start of the game at any moment in the code you can do something like this to add for example text of new character or just show him at any point

Code: Select all

if $ new_unlocked_character_john == True:
    show john
    john "Wasup."
You can now ask game at any time to run specfic code if something is true (in this case unlocked john)
Newest classical cover: Advance Wars - Sami Theme: https://www.youtube.com/watch?v=657Jt7hJRVc

Forum with my music: http://luxliev.proboards.com/

User avatar
Zetsubou
Miko-Class Veteran
Posts: 522
Joined: Wed Mar 05, 2014 1:00 am
Completed: See my signature
Github: koroshiya
itch: zetsuboushita
Contact:

Re: How to make a character unlockable?

#3 Post by Zetsubou »

I don't think regular variables will do the trick. You'll need persistent data.
Finished games
-My games: Sickness, Wander No More, Max Massacre, Humanity Must Perish, Tomboys Need Love Too, Sable's Grimoire, My Heart Grows Fonder, Man And Elf, A Dragon's Treasure, An Adventurer's Gallantry
-Commissions: No One But You, Written In The Sky, Diamond Rose, To Libertad, Catch Canvas, Love Ribbon, Happy Campers, Wolf Tails

Working on:
Sable's Grimoire 2

https://zetsubou.games

Post Reply

Who is online

Users browsing this forum: Bing [Bot]