Apply ATL to who/what in dialogue

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
Tayruu
Regular
Posts: 141
Joined: Sat Jul 05, 2014 7:57 pm

Apply ATL to who/what in dialogue

#1 Post by Tayruu »

I want to transition in/out the speaker label for dialogue, as well as add a soft fade to the typing effect on text.

I can't work out how to do either of these, though.

Code: Select all

transform who_transform:
    rotate -4
    rotate_pad False
    on start, replace:
        alpha 0.0 xpos -86
        linear 0.8 alpha 1.0 xpos -56
        pause(0.8)
    on hide, replaced:
        linear 0.8 alpha 0.0 xpos -86
        pause(0.8)  
The following does make the frame containing the speaker name animate in... but the animation repeats on pauses, on any new text (i.e. the same speaker in a row), and the hide/replaced code doesn't appear to run when I want it to. (When dialogue has finished or changing to a different person.)

When it comes to the "what", I basically have the same problem. The ATL plays, and repeats itself on pauses. The effect I want is to be able to apply ATL to individual letters to create a smoother "typing" effect, instead of a hard cut.

Code: Select all

transform what_transform:
    on start, replace:
        alpha 0.0
        linear 0.14 alpha 1.0
        pause(0.14)
    on hide:
        linear 0.14 alpha 0.0
        pause(0.14)
I suspect for this it might require delving into Ren'py's core (i.e. a straight at isn't going to cut it), but I think I tried looking before and having no idea where to begin. :B

User avatar
Tayruu
Regular
Posts: 141
Joined: Sat Jul 05, 2014 7:57 pm

Re: Apply ATL to who/what in dialogue

#2 Post by Tayruu »

In checking if maybe callbacks were updated (wrt attempting text blip improvement), I notice callbacks exist to run events at the start and end of dialogue. How would I run python to reference an element inside the say screen, and apply a transform to it? Would that be the way to do this?

... actually I just tested this by playing sounds, and the begin sound played at the start of each character's lines, but end only played at the end of a "block" of dialogue, when the window was hidden.
(Though it's possible I could clear a variable on end, and thus I could run a "new label" or "swap label" animation based on that inside begin?)

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Apply ATL to who/what in dialogue

#3 Post by namastaii »

Does your text already have a typerwriter affect? and you're trying to soften what you already have? (with preferences.text_cps being set to a "slower" setting)

User avatar
Tayruu
Regular
Posts: 141
Joined: Sat Jul 05, 2014 7:57 pm

Re: Apply ATL to who/what in dialogue

#4 Post by Tayruu »

When I say "soft fade", I mean each letter should fade in from 0.0 alpha to 1.0, or possibly other transitions. Currently there is no way (as near as I can see) to change the typewriter effect on dialogue from a hard cut.

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Apply ATL to who/what in dialogue

#5 Post by namastaii »

I can't seem to really apply it to each letter, there might be a trick to it but it doesn't work for me at all until I take out "on start/on hide" etc so what this does is just fade in the beginning part of the text

Code: Select all

transform what_transform:
    
    alpha 0.0
    linear 1 alpha 1.0
    pause(1)
   
   
The only thing I can do other than this is have a repeat effect and all that does is make the text look like its flashing in and out while it types. Not sure if you can add a transform to letters coming on screen invidually

Code: Select all

transform what_transform:
    linear 0.60 alpha 0.0
    linear 0.60 alpha 1
    repeat
   


Hopefully someone else has some good input

Post Reply

Who is online

Users browsing this forum: Google [Bot]