I'm currently creating a visual novel using ren'py and I want to know how it would be possible to create different chapters for my story, instead of using the standard save option.
This visual novel has the layout which I'm basing my ideas off of, and my story line also consists of chapters but I'm completely lost on how to make this happen
Ren'py chapter customization
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.
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.
-
- Newbie
- Posts: 3
- Joined: Fri Dec 28, 2018 3:57 pm
- Contact:
- papillon
- Arbiter of the Internets
- Posts: 4107
- Joined: Tue Aug 26, 2003 4:37 am
- Completed: lots; see website!
- Projects: something mysterious involving yuri, usually
- Organization: Hanako Games
- Tumblr: hanakogames
- Contact:
Re: Ren'py chapter customization
It'll help more if you describe how you want it to operate.
Do you want people to not be able to save at all, only to load individual chapters from the beginning?
Do you want people able to save as normal, but when they reach the end of a chapter they get sent back to the main menu and the next chapter is unlocked?
Do you want people to not be able to save at all, only to load individual chapters from the beginning?
Do you want people able to save as normal, but when they reach the end of a chapter they get sent back to the main menu and the next chapter is unlocked?
-
- Newbie
- Posts: 3
- Joined: Fri Dec 28, 2018 3:57 pm
- Contact:
Re: Ren'py chapter customization
Yes, I apologize I should have been more clear. I only want users to be able to load a sub-chapter within each main chapter. I want more of an auto save option so that you can exit and come back to the part of the chapter you were previously reading. As well as this the other chapters shouldn't be accessible until the chapters prior to it are completed.
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3791
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Ren'py chapter customization
This is a relatively large amount of work, and I don't know enough about it to give you much help, but maybe I can point you in the right direction?
first up, you'll want to look into how the autosave works, and how to force an autosave.
From there, you need to force an autosave on quit. I believe there is a thread here somewhere detailing how to make a game "continue" using this method.
Then you'll need to make the game load the autosave.
The chapters screen is the easy part, you just need some buttons which have a conditional (if/elif/else) to check if they've been unlocked, and a persistent variable to set whether they've been unlocked during normal play.
first up, you'll want to look into how the autosave works, and how to force an autosave.
From there, you need to force an autosave on quit. I believe there is a thread here somewhere detailing how to make a game "continue" using this method.
Then you'll need to make the game load the autosave.
The chapters screen is the easy part, you just need some buttons which have a conditional (if/elif/else) to check if they've been unlocked, and a persistent variable to set whether they've been unlocked during normal play.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
-
- Newbie
- Posts: 3
- Joined: Fri Dec 28, 2018 3:57 pm
- Contact:
Re: Ren'py chapter customization
Thank you, but how would I write parts of the story into each specific chapter? I'm not sure where I could place these lines of code and in what format
- Scribbles
- Miko-Class Veteran
- Posts: 636
- Joined: Wed Sep 21, 2016 4:15 pm
- Completed: Pinewood Island, As We Know It
- Projects: In Blood
- Organization: Jaime Scribbles Games
- Deviantart: breakfastdoodles
- itch: scribbles
- Location: Ohio
- Contact:
Re: Ren'py chapter customization
you can split the characters up into separate .rpy files, or split the chapters up into separate .rpy filesJane Meyer wrote: ↑Sun Dec 30, 2018 9:27 am Thank you, but how would I write parts of the story into each specific chapter? I'm not sure where I could place these lines of code and in what format
then call/jump as needed
Code: Select all
default num = 1
default chapters_end = 10
label start:
while not end:
call expression chapter_ + num
$ num += 1
if num >= chapters_end:
break
label chapter_1:
"chapter one stuff"
return
## and so on
as for messing with the saves I have no idea, I wouldn't recommend it. As a player I hate not being able to save as I need to. If you really wanted to though I'm sure there is a way but I wouldn't even begin to know how ^^; sorry!
-
- Regular
- Posts: 91
- Joined: Mon Jul 31, 2017 8:33 am
- Deviantart: LedianWithACamera
- Contact:
Re: Ren'py chapter customization
For the autosave: I've played The Arcana (it's FANTASTIC 100% would recommend Julian is best boy), and it doesn't actually save the specific line you were reading. When you quit in the middle of a chapter and load it back up, more often than not puts you right after the last choice you made or the last major scene change (like, when you go to a different area and the background changes), not on the exact line you were on. (I've abused this feature a lot to reread cute moments... sue me) In theory, working based off of that should be much easier than working based off of any given line in the chapter since there's only a small amount of choices and scene changes per chapter- much less than the total line count, at least.
I know there's a way to tell if you've seen a certain label, it's a part of a code I'm using in my own project, so maybe you could use that. Make every chapter it's own file, for organization purposes, and then put a label at every checkpoint (after a choice or a scene change). When you're going into a chapter, after you check if it's unlocked, go through every label backwards, checking if any of them have been seen, and when you come across one the player has seen, jump to that one. If they haven't seen any, jump to the very beginning.
There's probably a way more elegant way to go about that, but I just thought I'd throw my hat into the ring, because the prospect of a The Arcana fangame is one that I am very excited about and want to help in any way possible.
Like Imperf3kt said, unlocking chapters is very simple, just done by variables. You'll need the menu, which I cannot help you with at all, but once you've got that set up, you can just have a variable for if each chapter is unlocked or not, and at the end of every chapter, switch the variable to unlock the next one.
However, on the subject of chapters, there's one little complication that occured to me... Are you going to try and implement the keys system?
Using keys shouldn't be a problem- you could just check if your amount of keys > 0 after you check if the chapter is unlocked, and then subtract one before jumping in.
However, recharging keys could be very hard, since it would need to run in the background even while the game is closed to best emulate the original way it worked, and I can't think of any Ren'py feature that does that. All the methods I can come up with would be incredibly susceptible to cheating by just changing the clock on your computer (which, in fairness, I don't know is something The Arcana protects against, since I've never tried to time travel).
You could always forego the keys system, of course- that would make the game feel a whole lot less frustrating, but also make the game a rather fast experience if your chapters are as short as The Arcana's are. You could have a compromise by increasing the maximum amount of keys, decreasing the time it takes for them to recharge, or making the player play a minigame in order to earn them faster- after all, the player won't be able to pay to recharge them.
I know there's a way to tell if you've seen a certain label, it's a part of a code I'm using in my own project, so maybe you could use that. Make every chapter it's own file, for organization purposes, and then put a label at every checkpoint (after a choice or a scene change). When you're going into a chapter, after you check if it's unlocked, go through every label backwards, checking if any of them have been seen, and when you come across one the player has seen, jump to that one. If they haven't seen any, jump to the very beginning.
There's probably a way more elegant way to go about that, but I just thought I'd throw my hat into the ring, because the prospect of a The Arcana fangame is one that I am very excited about and want to help in any way possible.
Like Imperf3kt said, unlocking chapters is very simple, just done by variables. You'll need the menu, which I cannot help you with at all, but once you've got that set up, you can just have a variable for if each chapter is unlocked or not, and at the end of every chapter, switch the variable to unlock the next one.
However, on the subject of chapters, there's one little complication that occured to me... Are you going to try and implement the keys system?
Using keys shouldn't be a problem- you could just check if your amount of keys > 0 after you check if the chapter is unlocked, and then subtract one before jumping in.
However, recharging keys could be very hard, since it would need to run in the background even while the game is closed to best emulate the original way it worked, and I can't think of any Ren'py feature that does that. All the methods I can come up with would be incredibly susceptible to cheating by just changing the clock on your computer (which, in fairness, I don't know is something The Arcana protects against, since I've never tried to time travel).
You could always forego the keys system, of course- that would make the game feel a whole lot less frustrating, but also make the game a rather fast experience if your chapters are as short as The Arcana's are. You could have a compromise by increasing the maximum amount of keys, decreasing the time it takes for them to recharge, or making the player play a minigame in order to earn them faster- after all, the player won't be able to pay to recharge them.
Who is online
Users browsing this forum: Google [Bot], Rhapsy