One time names for throwaway extras [SOLVED]

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
User avatar
fundogmo
Newbie
Posts: 15
Joined: Thu Feb 19, 2015 12:24 am
Projects: Wingin' In: Love Can Be Such a Dragon
Tumblr: boxofsquids
Location: NYC
Contact:

One time names for throwaway extras [SOLVED]

#1 Post by fundogmo » Tue Aug 02, 2016 12:30 am

So in my game I have a lot of throwaway dialogue lines from one-time, text-only 'extras' that ideally need a name displayed in second window.

I'm kind of brute forcing it by including a million unique character definition in my preload, which I guess technically works, but is there a more efficient way at managing one-off lines of dialogue?

The important points are that at least some of them still need the ability to have unique colors and treatment to their names, as well as defining which of several 'show_who_window_style[#]' windows I've set up.

Code: Select all

define Meticulous_classmate = Character('Meticulous classmate',
                    color="#40334d",
                    what_color="#40334d",
                    outlines=[(1, "#40334d", 0, 0)],
                    show_two_window=True, 
                    show_who_window_style="say_who_window2",
                    what_font="graphics/ui/animeace2_ital.ttf",
                    ctc="continimg", 
                    ctc_pause="continimg", 
                    ctc_timedpause=Null())

define Shocked_classmate = Character('Shocked classmate',
                    color="#40334d",
                    what_color="#40334d",
                    outlines=[(1, "#40334d", 0, 0)],
                    show_two_window=True, 
                    show_who_window_style="say_who_window2",
                    what_font="graphics/ui/animeace2_ital.ttf",
                    ctc="continimg", 
                    ctc_pause="continimg", 
                    ctc_timedpause=Null())

define Disgusted_classmate = Character('Disgusted classmate',
                    color="#40334d",
                    what_color="#40334d",
                    outlines=[(1, "#40334d", 0, 0)],
                    show_two_window=True, 
                    show_who_window_style="say_who_window2",
                    what_font="graphics/ui/animeace2_ital.ttf",
                    ctc="continimg", 
                    ctc_pause="continimg", 
                    ctc_timedpause=Null())

Code: Select all

Meticulous_classmate "This is the only line I'll say in the whole game!"

Shocked_classmate "Me too!"

Disgusted_classmate "I wonder if there's a much easier way to do this."
Thank you!
Last edited by fundogmo on Tue Aug 02, 2016 8:33 pm, edited 1 time in total.

User avatar
SundownKid
Lemma-Class Veteran
Posts: 2299
Joined: Mon Feb 06, 2012 9:50 pm
Completed: Icebound, Selenon Rising Ep. 1-2
Projects: Selenon Rising Ep. 3-4
Organization: Fastermind Games
Deviantart: sundownkid
Location: NYC
Contact:

Re: One time names for throwaway extras

#2 Post by SundownKid » Tue Aug 02, 2016 12:58 am

Yeah, you can use Dynamic Character.

Explanation here:

viewtopic.php?f=8&t=33740#p384334

However, if you want unique name colors, you will most likely need to make them separate characters.

User avatar
fundogmo
Newbie
Posts: 15
Joined: Thu Feb 19, 2015 12:24 am
Projects: Wingin' In: Love Can Be Such a Dragon
Tumblr: boxofsquids
Location: NYC
Contact:

Re: One time names for throwaway extras [SOLVED]

#3 Post by fundogmo » Tue Aug 02, 2016 8:33 pm

Oh wow, this is exactly what I was looking for. Thanks!

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

Re: One time names for throwaway extras [SOLVED]

#4 Post by trooper6 » Tue Aug 02, 2016 8:58 pm

You don't even have to use Dynamic Character anymore with the newer code...you just put a variable for their name like so:

Code: Select all

default gen_name = "Meticulous Classmate"

define gen_classmate = Character('[gen_name]',
                    color="#40334d",
                    what_color="#40334d",
                    outlines=[(1, "#40334d", 0, 0)],
                    show_two_window=True, 
                    show_who_window_style="say_who_window2",
                    what_font="graphics/ui/animeace2_ital.ttf",
                    ctc="continimg", 
                    ctc_pause="continimg", 
                    ctc_timedpause=Null())

label start:
    gen_classmate "This is the only line I'll say in the whole game!"
    $ gen_name = "Shocked Classmate"
    gen_classmate "Me too!"
    $ gen_name = "Disgusted Classmate"
    gen_classmate "I wonder if there's a much easier way to do this."
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
fundogmo
Newbie
Posts: 15
Joined: Thu Feb 19, 2015 12:24 am
Projects: Wingin' In: Love Can Be Such a Dragon
Tumblr: boxofsquids
Location: NYC
Contact:

Re: One time names for throwaway extras [SOLVED]

#5 Post by fundogmo » Sat Aug 06, 2016 12:36 am

I don't want to bump the thread too much but I just wanted to say I appreciate that new set of code. It's more elegant than the other example and absolutely perfect. Thank you so much!

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], nyeowmi