Utilizing the MultipleTransition properly

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
WhiteFog
Newbie
Posts: 13
Joined: Mon Jul 01, 2019 11:40 pm
Contact:

Utilizing the MultipleTransition properly

#1 Post by WhiteFog »

So recently I came to the realization that in my VN, the way I have things setup, that I only need to have one character on-screen at a time, and so I thought I might simplify my life with giving them all the same starting image name (char in this instance) and swap characters easily without needing to have extra lines of code for 'hide char' every time the speaker changes.

So here's a snippet of code of what I've got currently and what I had been doing-

script.rpy

Code: Select all

    show char mark animated neutral serious with qleft
    stu "\"{color=#800000}Persona{/color}\"?"
    stu "Dude if that really worked and I could see my future, I'd be on easy street."
    show char mark animated neutral smirk
    stu "You sure you ain't got the brain rot, Hidehiko?"
    $ tbnarrator = 1
    show char mark ns
    n "{color=#ebffdb}>Masao Inaba (Nickname: Mark)\nThe spoiled son of Inaba Dry Cleaning's owners. Earnest and exciteable.{/color}"
    $ tbnarrator = 0
    #show char brown animated neutral smirk with qleft2
    hide char with qdis
    show char brown animated neutral smirk with qleft
    stu "Hehehe...Turns out there's more to it than an easy joke!"
    stu "Maybe not seeing the future, exactly, but weird stuff does happen!"
    stu "I'm willing to put my money where my mouth is if you are, Mark."
    $ tbnarrator = 1
    show char brown ns
    n "{color=#ebffdb}>Hidehiko Uesugi (Nickname: Brown)\nCraves attention and doesn't take things very seriously.{/color}"
    $ tbnarrator = 0
    #show char mark animated neutral smirk with qleft2
    hide char with qdis
    show char mark animated neutral smirk with qleft
    mk "Alright... You're on."
    mk "I'll bet you an all-you-can-eat dinner at the Peace Diner on Joy Street."
    #show char ayase animated neutral smirk with qleft2
    hide char with qdis
qdis and qleft are just custom transitions that go way faster

Code: Select all

define qdis = Dissolve(0.2)
define qleft = MoveTransition(0.2, enter=offscreenleft, enter_time_warp=_warper.easein)
But my thought and hope was to basically remove the 'hide char with qdis' with a multiple transition-

Code: Select all

define qleft2  = MultipleTransition([
    False, Dissolve(0.2),
    False, MoveTransition(0.2, enter=offscreenleft, enter_time_warp=_warper.easein),
    True])
So ideally I'd like it to quick-dissolve away the previous speaker's image, and then move the new one in from offscreen on the left. However, considering that it is the same image/character (technically), mostly it dissolves away and then wiggles around a bit as the original location is still present.
Is there another bit of code that I could add to reset its position? Or should I just give it up and go back to the way I have it currently listed (and probably just remove the 'char' bit as well if this isn't going to work hahaha)

But I only have 1 speaker on-screen at any time, so just for ease something like this would be ideal. Any other thoughts/ideas welcome (including if there's a way to run the multiple transition with two different character image definitions rather than have them both loaded in under the same one, but I couldn't see a way to do that)

User avatar
gas
Miko-Class Veteran
Posts: 842
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: Utilizing the MultipleTransition properly

#2 Post by gas »

You're messing up tags a bit, so the entire thing look too complex for such an easy task.

show char mark animated neutral serious
show char mark animated neutral smirk

As this part repeat quite often, abstract it.

showmark serious
show mark smirk

Now, with a simple 'hide mark' you hide whatever. The use of 'char' is complicating your life.

If you have overall, big group of images, like animated and static, just create two different sprite sets.
showani_mark serious
show static_mark smirk
'hide ani_mark' or 'hide stati_mark' by situation.

By good design, you should limit to a single attribute for better handling.


As for multiple transitions, they are *transitions*, they operate at scene level, you should create an ATL to have the sprite hide, move, slide and such complex stuff.
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.

10 ? "RENPY"
20 GOTO 10

RUN

Post Reply

Who is online

Users browsing this forum: No registered users