Page 1 of 1
locking a book?
Posted: Mon Jun 24, 2019 10:41 am
by lunawolf86
been working awhile on this and now i have run into another problem... i got the prologue done to my novel and i set up the 3 separate books i needed but i want it set up where the third book is locked until the first two are finished any ideas would help.. and yes for the most part i am learning renpy/coding on my own so that being said it takes a bit for me to figure things out if not i do ask for help haha
Re: locking a book?
Posted: Mon Jun 24, 2019 12:30 pm
by Mutive
You'd want to use some kind of persistent condition. You'd wait until whatever conditions you needed for the book to be unlocked to be achieved, then would do something along the lines of:
Let's say that the conditions you wanted were for book1 and book2 to be completed before the player could open book3. At the bottom of book1's playthrough you'd put something like:
And then do the same for book2 (just change the variable to persistent.book2).
Then at the top of your game (probably after "label start:", you'd have something like:
Code: Select all
if persistent.book1 == true and persistent.book2 == True:
$ persistent.book3unlocked = True
Then your code might read something like where you wanted to ask the player which book they wanted to play through:
Code: Select all
menu:
"Which book do you want to play through?"
"Book 1":
jump book1
"Book 2":
jump book2
"Book 3" if persistent.book3unlocked == True:
jump book3
There are a lot of ways of doing this, though, depending on precisely how you want your game/code to look.
Re: locking a book?
Posted: Mon Jun 24, 2019 6:12 pm
by lunawolf86
Mutive wrote: ↑Mon Jun 24, 2019 12:30 pm
You'd want to use some kind of persistent condition. You'd wait until whatever conditions you needed for the book to be unlocked to be achieved, then would do something along the lines of:
Let's say that the conditions you wanted were for book1 and book2 to be completed before the player could open book3. At the bottom of book1's playthrough you'd put something like:
And then do the same for book2 (just change the variable to persistent.book2).
Then at the top of your game (probably after "label start:", you'd have something like:
Code: Select all
if persistent.book1 == true and persistent.book2 == True:
$ persistent.book3unlocked = True
Then your code might read something like where you wanted to ask the player which book they wanted to play through:
Code: Select all
menu:
"Which book do you want to play through?"
"Book 1":
jump book1
"Book 2":
jump book2
"Book 3" if persistent.book3unlocked == True:
jump book3
There are a lot of ways of doing this, though, depending on precisely how you want your game/code to look.
thank you ill finagle it from here
