Yes I would believe you. And it's also so great that you came up with this idea!Would you believe I originally came up with this as a way for the player to see how far they were in the game?
[Tutorial] Making a Contents page / screen
Forum rules
Do not post questions here!
This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Do not post questions here!
This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
- Lockvia
- Regular
- Posts: 124
- Joined: Wed Mar 26, 2014 8:02 pm
- Projects: Prank Masters
- Organization: Lockvia Studios
- Tumblr: lockvia
- itch: lockvia
- Location: Australia
- Contact:
Re: [Tutorial] Making a Contents page / screen
- SilverSnow
- Regular
- Posts: 182
- Joined: Tue Aug 27, 2013 6:28 am
- Completed: Bus Stop, Before the Tale, White Book Complete Volume, See You, The Raven
- Projects: Secrets...
- Tumblr: stchematelier
- itch: st-chem-atelier
- Location: Edge of Black Hole
- Discord: SHatsuyuki#1452
- Contact:
Re: [Tutorial] Making a Contents page / screen
I tried applying the code and it works fine, but my only problem is, it doesn't seem to remember the unlocked parts. I tried checking again if it works as a release type but I still get the same results.
- Broodelin
- Regular
- Posts: 193
- Joined: Wed May 14, 2014 9:26 pm
- Completed: A Harder Battle
- Projects: Too many to list
- Location: Eagleland
- Contact:
Re: [Tutorial] Making a Contents page / screen
SilverSnow wrote:I tried applying the code and it works fine, but my only problem is, it doesn't seem to remember the unlocked parts. I tried checking again if it works as a release type but I still get the same results.
ex:
Code: Select all
$ var1 = persistent."complete"
See PyTom's post below.
Last edited by Broodelin on Wed May 21, 2014 10:07 am, edited 1 time in total.
- PyTom
- Ren'Py Creator
- Posts: 16093
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: [Tutorial] Making a Contents page / screen
Actually, persistent variables are fields on the persistent object. (For convenience, if fields on the persistent object are not set, they default to None.)
Code: Select all
$ persistent.complete = True
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
- SilverSnow
- Regular
- Posts: 182
- Joined: Tue Aug 27, 2013 6:28 am
- Completed: Bus Stop, Before the Tale, White Book Complete Volume, See You, The Raven
- Projects: Secrets...
- Tumblr: stchematelier
- itch: st-chem-atelier
- Location: Edge of Black Hole
- Discord: SHatsuyuki#1452
- Contact:
Re: [Tutorial] Making a Contents page / screen
I'm sorry but I don't think I get it... Can you please explain it again once more?PyTom wrote:Actually, persistent variables are fields on the persistent object. (For convenience, if fields on the persistent object are not set, they default to None.)
Code: Select all
$ persistent.complete = True
Excuse me for being so annoying heheh ^-^u
- OokamiKasumi
- Eileen-Class Veteran
- Posts: 1779
- Joined: Thu Oct 14, 2010 3:53 am
- Completed: 14 games released -- and Counting.
- Organization: DarkErotica Games
- Deviantart: OokamiKasumi
- Location: NC, USA
- Contact:
Re: [Tutorial] Making a Contents page / screen
A persistent variable is a variable that doesn't get erased or reset when the game is closed, the way other variables do. (That's why they're called persistent.)SilverSnow wrote:I'm sorry but I don't think I get it... Can you please explain it again once more?PyTom wrote:Actually, persistent variables are fields on the persistent object. (For convenience, if fields on the persistent object are not set, they default to None.)
Code: Select all
$ persistent.complete = True
Excuse me for being so annoying hehehe ^-^u
The way to use this is when you reach a point in your game that you want to Permanently set to accessible (or not accessible,) you add persistent. to your variable. (Don't forget the dot!)
Example:
Code: Select all
$ persistent.ch01 = True
Last edited by OokamiKasumi on Sun May 25, 2014 6:23 pm, edited 1 time in total.
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed:
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Most recent Games Completed:
- The Walk[Psychological][NanoWinter] ~ PG New!
- Trap! [ModernFantasy][VN] ~ PG16
- The Adventures of Prince Ivan [Fant/Adv/VN] ~ PG
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
- SilverSnow
- Regular
- Posts: 182
- Joined: Tue Aug 27, 2013 6:28 am
- Completed: Bus Stop, Before the Tale, White Book Complete Volume, See You, The Raven
- Projects: Secrets...
- Tumblr: stchematelier
- itch: st-chem-atelier
- Location: Edge of Black Hole
- Discord: SHatsuyuki#1452
- Contact:
Re: [Tutorial] Making a Contents page / screen
Thanks for your help I figured the problem was where I was putting the persistent data. I was suppose to do:OokamiKasumi wrote:
A persistent variable is a variable that doesn't get erased or reset when the game is closed, the way other variables do. (That's why they're called persistent.)
The way to use this is when you reach a point in your game that you want to Permanently set to accessible (or not accessible,) you add .persistent to your variable. (Don't forget the dot!)
Example:This should set ch01 to True even if you start the game over.Code: Select all
$ persistent.ch01 = True
Code: Select all
label start:
$ persistent.end0 = False
$ persistent.end1 = False
$ persistent.end2 = False
$ persistent.end3 = False
$ persistent.end4 = False
Code: Select all
init:
$ persistent.end0 = False
$ persistent.end1 = False
$ persistent.end2 = False
$ persistent.end3 = False
$ persistent.end4 = False
- PyTom
- Ren'Py Creator
- Posts: 16093
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: [Tutorial] Making a Contents page / screen
You generally don't want to set persistent data to False. This will clear the persistent data at the start of every game. If you're going to do that, normal variables work better.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
- Dylan_Bain
- Regular
- Posts: 101
- Joined: Mon Mar 09, 2015 2:05 pm
- Organization: Dylan Bain Games
- Location: Scotland
- Contact:
Re: [Tutorial] Making a Contents page / screen
Hey!
This tutorial is really helpful, but as I am new to Ren'Py, can you help me with something?
How do I edit a chapter_list.rpy page?
Thank you!
This tutorial is really helpful, but as I am new to Ren'Py, can you help me with something?
How do I edit a chapter_list.rpy page?
Thank you!
- OokamiKasumi
- Eileen-Class Veteran
- Posts: 1779
- Joined: Thu Oct 14, 2010 3:53 am
- Completed: 14 games released -- and Counting.
- Organization: DarkErotica Games
- Deviantart: OokamiKasumi
- Location: NC, USA
- Contact:
Re: [Tutorial] Making a Contents page / screen
Edit...?Dylan_Bain wrote:THow do I edit a chapter_list.rpy page?
-- As in:
1. Change the code in a finished game that you did not make?
-- Or--
2. You've put all the code on a chapter_list.rpy page and now you can't find it to edit it?
For 1. You Don't.
For 2. Open the Renpy launcher and select: All script files. This will open all the rpy files in the game folder and display them in tabs at the top of the page. As long as the chapter_list.rpy page is in your game folder, Editra will open that one too.
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed:
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Most recent Games Completed:
- The Walk[Psychological][NanoWinter] ~ PG New!
- Trap! [ModernFantasy][VN] ~ PG16
- The Adventures of Prince Ivan [Fant/Adv/VN] ~ PG
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
- Dylan_Bain
- Regular
- Posts: 101
- Joined: Mon Mar 09, 2015 2:05 pm
- Organization: Dylan Bain Games
- Location: Scotland
- Contact:
Re: [Tutorial] Making a Contents page / screen
Yeah... sorry, that doesn't really help me... sorry!OokamiKasumi wrote:Edit...?Dylan_Bain wrote:THow do I edit a chapter_list.rpy page?
-- As in:
1. Change the code in a finished game that you did not make?
-- Or--
2. You've put all the code on a chapter_list.rpy page and now you can't find it to edit it?
For 1. You Don't.
For 2. Open the Renpy launcher and select: All script files. This will open all the rpy files in the game folder and display them in tabs at the top of the page. As long as the chapter_list.rpy page is in your game folder, Editra will open that one too.
I mean that I am trying to create a chapter_list.rpy page. I am making my own game and haven't done it yet, as I don't know how. Also, if you know, is it possible to add the chapter select button to the main menu, instead of the in-game menu?
Just so u know i use jEdit.
- OokamiKasumi
- Eileen-Class Veteran
- Posts: 1779
- Joined: Thu Oct 14, 2010 3:53 am
- Completed: 14 games released -- and Counting.
- Organization: DarkErotica Games
- Deviantart: OokamiKasumi
- Location: NC, USA
- Contact:
Re: [Tutorial] Making a Contents page / screen
Then we have a problem since I use Editra, the one that comes with Renpy.Dylan_Bain wrote:I mean that I am trying to create a chapter_list.rpy page. I am making my own game and haven't done it yet, as I don't know how. Just so u know i use jEdit.
-- I tried opening an older version of Renpy to get to jEdit, but the Java on my computer has updated (8.0) beyond what jEdit uses (7.0,) so it no longer functions.
In essence, what you have to do is Open a Blank Page in your editing software (file > new page/tab?) Copy the text for the chapter screen onto that blank page then SAVE that page in your Game Folder as an .rpy file.
Don't forget to Change or Remove the image names and file names to what you actually Have or it will cough up errors like you wouldn't believe.
Last edited by OokamiKasumi on Sun Mar 15, 2015 2:32 pm, edited 1 time in total.
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed:
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Most recent Games Completed:
- The Walk[Psychological][NanoWinter] ~ PG New!
- Trap! [ModernFantasy][VN] ~ PG16
- The Adventures of Prince Ivan [Fant/Adv/VN] ~ PG
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
- Dylan_Bain
- Regular
- Posts: 101
- Joined: Mon Mar 09, 2015 2:05 pm
- Organization: Dylan Bain Games
- Location: Scotland
- Contact:
Re: [Tutorial] Making a Contents page / screen
Thanks!Then we have a problem since I use Editra, the one that comes with Renpy.
-- I tried opening an older version of Renpy to get to jEdit, but since the Java had updated on my computer, it no longer functions.
In essence, what you have to do is Open a Blank Page in your editing software (file > new page/tab?) Copy the text for the chapter screen onto that blank page then SAVE that page in your Game Folder as an .rpy file.
Don't forget to Remove the image names and file names that You Don't Have or it will cough up errors like you wouldn't believe.
- OokamiKasumi
- Eileen-Class Veteran
- Posts: 1779
- Joined: Thu Oct 14, 2010 3:53 am
- Completed: 14 games released -- and Counting.
- Organization: DarkErotica Games
- Deviantart: OokamiKasumi
- Location: NC, USA
- Contact:
Re: [Tutorial] Making a Contents page / screen
Oh, I almost forgot your other question!
-- However, if you go to the main menu at any time while playing, it Does Not Save that game. The player will lose all the progress in whatever game they're in.
-- Also, Starting a game at a specific chapter is not the same as starting from a Save point! Whatever the flags were set to at Game Start is what they will Still Be when that chapter starts because you are technically starting a whole new game from that point.
Yes! You add a link to the Main Menu exactly the same way you would to the Navigation (in-game) menu.Dylan_Bain wrote:... if you know, is it possible to add the chapter select button to the main menu, instead of the in-game menu?
-- However, if you go to the main menu at any time while playing, it Does Not Save that game. The player will lose all the progress in whatever game they're in.
-- Also, Starting a game at a specific chapter is not the same as starting from a Save point! Whatever the flags were set to at Game Start is what they will Still Be when that chapter starts because you are technically starting a whole new game from that point.
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed:
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Most recent Games Completed:
- The Walk[Psychological][NanoWinter] ~ PG New!
- Trap! [ModernFantasy][VN] ~ PG16
- The Adventures of Prince Ivan [Fant/Adv/VN] ~ PG
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Re: [Tutorial] Making a Contents page / screen
Great tutorial! This was exactly what I needed!
Who is online
Users browsing this forum: No registered users