Adding a CTC animation to custom name

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
chesarty
Regular
Posts: 116
Joined: Sat Aug 25, 2018 3:07 am
Completed: 0
Contact:

Adding a CTC animation to custom name

#1 Post by chesarty »

I'm wondering how to add a CTC animation to the dialogue of the player character. I can't find an easy way of doing this :(

Here's my code:

Code: Select all

$ mc = renpy.input("Your Name", length=8)
    $ mc = mc.strip()
    if mc == "":
        $ mc="MC"
        
init -1:
    $ d = Character("Damon", ctc="ctc_animation", ctc_position="fixed")
    $ a = Character("Atticus", color="#ffffff", ctc="ctc_animation", ctc_position="fixed")
    $ r = Character("Rhys", ctc="ctc_animation", ctc_position="fixed")
    $ e = Character("Enzo", ctc="ctc_animation", ctc_position="fixed")
    $ n = Character(None, ctc="ctc_animation", ctc_position="fixed")
Adding the ctc animation definition to the renpy.input line doesn't work...

User avatar
chesarty
Regular
Posts: 116
Joined: Sat Aug 25, 2018 3:07 am
Completed: 0
Contact:

Re: Adding a CTC animation to custom name

#2 Post by chesarty »

Still can't find a solution to this.

Code: Select all

$ mc = Character("[mc]", ctc="ctc_animation", ctc_position="fixed")
This does nothing :/

User avatar
RicharDann
Veteran
Posts: 286
Joined: Thu Aug 31, 2017 11:47 am
Contact:

Re: Adding a CTC animation to custom name

#3 Post by RicharDann »

Characters should be defined with define statement. Also you may want to use a different variable for the character's name to avoid confusion with the character object. Try something like:

Code: Select all

define mc = Character("[mc_name]", ctc="ctc_animation")

label start:
    $ mc_name = renpy.input("Your Name", length=8)
    $ mc_name = mc_name.strip()

    mc "My name is [mc_name]!"
The most important step is always the next one.

User avatar
chesarty
Regular
Posts: 116
Joined: Sat Aug 25, 2018 3:07 am
Completed: 0
Contact:

Re: Adding a CTC animation to custom name

#4 Post by chesarty »

RicharDann wrote: Tue Oct 13, 2020 8:39 am Characters should be defined with define statement. Also you may want to use a different variable for the character's name to avoid confusion with the character object. Try something like:

Code: Select all

define mc = Character("[mc_name]", ctc="ctc_animation")

label start:
    $ mc_name = renpy.input("Your Name", length=8)
    $ mc_name = mc_name.strip()

    mc "My name is [mc_name]!"
Thanks! That worked. Do you have any idea why it didn't work before? Before this I used define statements to define the character, but it still didn't work. From what I can see the code is the exact same one I used earlier... :| Maybe it just got confused because of the naming?

User avatar
chesarty
Regular
Posts: 116
Joined: Sat Aug 25, 2018 3:07 am
Completed: 0
Contact:

Re: Adding a CTC animation to custom name

#5 Post by chesarty »

Welp, now the ctc animation is gone again. I literally didn't change the code at all but it just disappeared??? Only on the mc character, too.

Post Reply

Who is online

Users browsing this forum: No registered users