Page 1 of 1

organizing labels

Posted: Wed Jan 16, 2019 2:09 pm
by Guidman64
I am doing my first VN and (when I learn to code better) I want to add a day and a hour system but for now I just have narrator saying morning, afternoon, etc.
My concerns are when you jump to a new label, that there will be so many labels that my head will get jumbled. What is the best way to keep labels organized?

I am using this: label d1m1, then d1a1, d2m1, etc. when starting new days and periods of day. When starting new conversation blocks after menus I used things like d1m2 (day 1, morning 2 (second conversation block in morning)).

I am sure that there is a much simpler/efficient way to organize labels so I figured I would ask what has worked best for the experienced novelists?

Re: organizing labels

Posted: Wed Jan 16, 2019 4:35 pm
by Marionette
If you're having trouble with them getting mixed up in your head it's likely because they're all very similar.

You might want to make them longer to start with, there's no real character limit for labels and for the most games you won't be calling them so often that they really need shortening. Also if you want to be able to tell them apart easier how about using the content of the conversation in the label rather than 1, 2 etc. ?

For example labels like d1m1, d1a1, d2m1 etc becomes something like:
label day_1_morning_wakeup
label day_1_morning_toast
label day_1_morning_eggs
label day_1_afternoon_discovery
label day_2_morning_breakfast

etc.

Hopefully, this helps.

Re: organizing labels

Posted: Wed Jan 16, 2019 9:45 pm
by Guidman64
thank you Marionette, I think that will help a ton with the organization. I knew there had to be something simpler than my thought process, sometimes longer is better. (that's what she said moment there).

Re: organizing labels

Posted: Wed Jan 16, 2019 10:29 pm
by trooper6
You can also have multiple .rpy files in your game. RenPy will treat them all as one big file so you can break up your code how you like. For example, some people like to put all their Day 1 labels in one file, say day1.rpy, and put all their Day 2 labels in a different file, say a day2.rpy...and so on.

Re: organizing labels

Posted: Thu Jan 17, 2019 11:28 am
by DragoonHP
Also, you can also have sub/child/local label for more organisation. Something like:

Code: Select all

label day_1:
    label .morning_wakeup:
        #script
    label .morning_toast:
        #script
Rinse and repeat.

For more details, read this > https://www.renpy.org/doc/html/label.ht ... -statement
Also and as @trooper6 said, seperate your script into seperate files as much as possible.

Re: organizing labels

Posted: Fri Jan 18, 2019 12:58 pm
by Guidman64
trooper6 wrote: Wed Jan 16, 2019 10:29 pm You can also have multiple .rpy files in your game. RenPy will treat them all as one big file so you can break up your code how you like. For example, some people like to put all their Day 1 labels in one file, say day1.rpy, and put all their Day 2 labels in a different file, say a day2.rpy...and so on.
That could be interesting, I could see it being really easy to go back and correct code if needed. What other benefits might this have?

Also, how would that look in main script? I can't remember exactly how to show that. something like this?:

Code: Select all

[/
label day_1:
	show day_1
	code]

Re: organizing labels

Posted: Fri Jan 18, 2019 3:35 pm
by trooper6
You code this just as you'd code normally. You write your labels just as you normally would. The only difference is that instead of having one rpy file (script.rpy), you just have multiple rpy files. You have your script.rpy file and you have your day1.rpy file and your day2.rpy file, etc. You put your label d1m1 and your label d1a1 in the day1.rpy file, and so on.

You don't have to do anything else special, you jump and call your labels like normal.

Re: organizing labels

Posted: Wed Jan 30, 2019 9:08 pm
by Gear
That's what I do. Since my game is divided into chapters, I have script.rpy where all my definitions and sprites, etc. are, and ch01.rpy, ch02.rpy, etc.