organizing labels

A place to discuss things that aren't specific to any one creator or game.
Forum rules
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
Post Reply
Message
Author
Guidman64
Newbie
Posts: 12
Joined: Tue Jan 15, 2019 11:04 am
Projects: How the Fallen
Contact:

organizing labels

#1 Post by Guidman64 » Wed Jan 16, 2019 2:09 pm

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?

User avatar
Marionette
Regular
Posts: 126
Joined: Thu Apr 21, 2011 12:04 pm
Completed: ChimeraTail
Projects: Nova, Cupid, Snowdrop
Deviantart: rexx9224
Skype: super_marionette
itch: marionette
Location: Ireland
Contact:

Re: organizing labels

#2 Post by Marionette » Wed Jan 16, 2019 4:35 pm

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.

Guidman64
Newbie
Posts: 12
Joined: Tue Jan 15, 2019 11:04 am
Projects: How the Fallen
Contact:

Re: organizing labels

#3 Post by Guidman64 » Wed Jan 16, 2019 9:45 pm

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).

User avatar
trooper6
Lemma-Class Veteran
Posts: 3574
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: organizing labels

#4 Post by trooper6 » 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.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
DragoonHP
Miko-Class Veteran
Posts: 734
Joined: Tue Jun 22, 2010 12:54 am
Completed: Christmas
IRC Nick: DragoonHP
Location: Zion Island, Solario
Contact:

Re: organizing labels

#5 Post by DragoonHP » Thu Jan 17, 2019 11:28 am

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.

Guidman64
Newbie
Posts: 12
Joined: Tue Jan 15, 2019 11:04 am
Projects: How the Fallen
Contact:

Re: organizing labels

#6 Post by Guidman64 » Fri Jan 18, 2019 12:58 pm

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]

User avatar
trooper6
Lemma-Class Veteran
Posts: 3574
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: organizing labels

#7 Post by trooper6 » Fri Jan 18, 2019 3:35 pm

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.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
Gear
Miko-Class Veteran
Posts: 764
Joined: Tue Apr 05, 2011 10:15 pm
Projects: Tempestus Sum
Organization: Xenokos Interactive
IRC Nick: Gear
Skype: Skye.Gear
Location: Grand Prairie, TX
Contact:

Re: organizing labels

#8 Post by Gear » Wed Jan 30, 2019 9:08 pm

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.
The best reason to get up in the morning is to outdo yourself: to do it better than you've ever done it before. But if you haven't done it better by nightfall... look at your globe and pick a spot: it's always morning somewhere.

Post Reply

Who is online

Users browsing this forum: Bing [Bot]