[Solved]Transition text box and casting shadows on the characters..

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
Princesky
Newbie
Posts: 5
Joined: Fri May 17, 2024 11:40 am
Contact:

[Solved]Transition text box and casting shadows on the characters..

#1 Post by Princesky »

Hello, i've been tinkering with ren'py for the past few days.

I've had little to no issue working with the easy part of the engine, but i wanted to try and replicate the dialogue effect found on "Ruined King", there is a video for context.

https://www.youtube.com/watch?v=fyeDhcgIVoA&t=239s

I've been stuck on it for two days now, and well i'm really stumped, from what i can understand i'd need to make it so the transition of the text box only occur when another character speaks, a small bouncy effect everytime the text box appear and also i'd have to darken the sprite of the character who is not speaking and maybe zoom him out a little bit..

In theory this doesn't sound super hard but as is said i deleted my code again and again.

All of that to replicate the effect.. So how would i go about doing this please? If anyone maybe already did something similar or can help.

Edit: Thanks a lot for the help, i finally managed to make it work!
Last edited by Princesky on Thu May 23, 2024 5:03 am, edited 1 time in total.

jeffster
Miko-Class Veteran
Posts: 520
Joined: Wed Feb 03, 2021 9:55 pm
Contact:

Re: Transition text box and casting shadows on the characters..

#2 Post by jeffster »

Princesky wrote: Fri May 17, 2024 12:39 pm Hello, i've been tinkering with ren'py for the past few days.

I've had little to no issue working with the easy part of the engine, but i wanted to try and replicate the dialogue effect found on "Ruined King", there is a video for context.

https://www.youtube.com/watch?v=fyeDhcgIVoA&t=239s

I've been stuck on it for two days now, and well i'm really stumped, from what i can understand i'd need to make it so the transition of the text box only occur when another character speaks, a small bouncy effect everytime the text box appear and also i'd have to darken the sprite of the character who is not speaking and maybe zoom him out a little bit..

In theory this doesn't sound super hard but as is said i deleted my code again and again.

All of that to replicate the effect.. So how would i go about doing this please? If anyone maybe already did something similar or can help.
1. A nice animated effect of highlighting a speaking character can be achieved with BGQueue
https://patreon.renpy.org/python-tricks-2.html#bgqueue

(It could be probably modified to add zooming or darkening effect etc).

2. A small bouncy effect every time the text box appear is easy to do with transition:
viewtopic.php?p=567128#p567128

(Of course you can make the effect more complex than in that example).

3. Textboxes on the right or on the left could be achieved e.g. by creating 2 say screens (left & right) or by adding a parameter to a customized "say" screen. Then in the script you would have to write:

Code: Select all

    y "Is that all that's left?"    # The text box on the left
    i "I was right, Yasuo!" (2)  # The text box on the right
Where the 1st line has parameter 1 (the default, meaning textbox on the left side). The 2nd line has parameter 2 meaning the textbox on the right side.

(I didn't test it but I hope we can use a positional parameter here, for brevity; not only keyword parameters).

Likewise, highlighting the speaking character could be done in the customized say screen, depending on the parameter.

Similarly, you could define different characters like

yl = Yasuo speaking from the left
yr = Yasuo speaking from the right

They could be defined as having default parameters for textbox on the left or on the right.

Then the script above could look like

Code: Select all

    yl "Is that all that's left?"    # Yasuo speaking on the left
    ir "I was right, Yasuo!"        # Illaoi speaking on the right
If the problem is solved, please edit the original post and add [SOLVED] to the title. 8)

jeffster
Miko-Class Veteran
Posts: 520
Joined: Wed Feb 03, 2021 9:55 pm
Contact:

Re: Transition text box and casting shadows on the characters..

#3 Post by jeffster »

Princesky wrote: Fri May 17, 2024 12:39 pm casting shadows on the characters
PS. An easy way to cast shadows on a half of the screen is to overlay the screen with a semi-transparent gradient image. Something like:

Code: Select all

screen say(who, what, side=1):
    style_prefix "say"

    if side == 1:
        add "shadow_right.png" xfill True yfill True
    elif side == 2:
        add "shadow_left.png" xfill True yfill True

    window:
        id "window"
        at textbox_transition
gradient1.png
gradient1.png (2.66 KiB) Viewed 161 times
If the problem is solved, please edit the original post and add [SOLVED] to the title. 8)

Post Reply

Who is online

Users browsing this forum: No registered users