locking a book?
Forum rules
Questions about Ren'Py should go in the Ren'Py Questions and Announcements forum.
Questions about Ren'Py should go in the Ren'Py Questions and Announcements forum.
-
- Newbie
- Posts: 4
- Joined: Mon Jun 03, 2019 3:30 pm
- Contact:
locking a book?
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
-
- Veteran
- Posts: 344
- Joined: Tue Nov 21, 2017 2:23 am
- Completed: Eidolon, Minion!, Love Furever, Epilogue
- Contact:
Re: locking a book?
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:
Then your code might read something like where you wanted to ask the player which book they wanted to play through:
There are a lot of ways of doing this, though, depending on precisely how you want your game/code to look.
Code: Select all
$ persistent.book3unlocked = True
Code: Select all
$ persistent.book1 = True
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
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
Enjoy Eidolon, my free to play game at: https://mutive.itch.io/eidolon, Minion! at: https://mutive.itch.io/minion or Epilogue at: https://mutive.itch.io/epilogue
-
- Newbie
- Posts: 4
- Joined: Mon Jun 03, 2019 3:30 pm
- Contact:
Re: locking a book?
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:Code: Select all
$ persistent.book3unlocked = True
And then do the same for book2 (just change the variable to persistent.book2).Code: Select all
$ persistent.book1 = True
Then at the top of your game (probably after "label start:", you'd have something like:
Then your code might read something like where you wanted to ask the player which book they wanted to play through:Code: Select all
if persistent.book1 == true and persistent.book2 == True: $ persistent.book3unlocked = True
There are a lot of ways of doing this, though, depending on precisely how you want your game/code to look.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
thank you ill finagle it from here
Who is online
Users browsing this forum: No registered users