"On" statements not working on ATL transform

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
WOTB
Newbie
Posts: 9
Joined: Sat Jul 08, 2017 12:28 pm
Contact:

"On" statements not working on ATL transform

#1 Post by WOTB »

Okay, so this one has been boggling my mind a little bit right now. I'm trying to use ATL transformations to make for smoother expression transitions (it really bugs me how the whole game stops for a bit every time there's a change in expression until it's finished, and I also don't want to do expression changes without some sort of transition because it just looks crude). Problem is, I've tried using this code and... it doesn't quite work.

Code: Select all

transform dis2:
    on replaced:
        alpha 1.0
        linear .4 alpha .0
    on replace:
        linear .4 alpha 1.0
    on show:
        alpha 0.0
        linear .4 alpha 1.0
    on hide:
        linear .4 alpha 0.0
The problem I've been having with it is that anything inside the "on" statements just doesn't happen. If I place the commands outside of an "on" statement, it does it fine (but then I'd have to create multiple transforms for that, and the replace/replaced one outright wouldn't work), but when using one of these, it just doesn't.

I've tried creating another project to see if I could replicate the error to no success. If I use a completely new project made 100% from scratch, the "on" statements will work just fine. I'm really at a loss here. Any help will be appreciated.

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: "On" statements not working on ATL transform

#2 Post by Remix »

What code are you using to compose the sprite and toggle expressions?
e.g. Is it simple 'show eileen side angry' or LiveComposite or ConditionSwitch or DynamicDisplayable?
Frameworks & Scriptlets:

User avatar
WOTB
Newbie
Posts: 9
Joined: Sat Jul 08, 2017 12:28 pm
Contact:

Re: "On" statements not working on ATL transform

#3 Post by WOTB »

Code: Select all

show s 1 u expression at dis2
This is basically it. I composed it where the first letter (s) is the character name (in this case, Shoichi), 1 is the pose, u is the outfit (in this case, uniform) and then the name of the expression.

The weird thing is, I copied two expressions to a new project to test it out (copied neutral and smile expressions) and it worked just fine. I don't know if there's some kind of incompatibility with some code in my game (I have customized UI and all that) so I'm not sure what could be causing this.

User avatar
WOTB
Newbie
Posts: 9
Joined: Sat Jul 08, 2017 12:28 pm
Contact:

Re: "On" statements not working on ATL transform

#4 Post by WOTB »

Sorry for double posting. I figured out the problem (I think) although I can't figure out a solution. Basically, I use customized positions to place my sprites. The reason being that with only the default three supplied by Ren'Py, I can't fit all the characters I need to have on screen.

Code: Select all

init:
    $ zero = Position(xpos=-80, xanchor=0.5)
    $ one = Position(xpos=210, xanchor=0.5)
    $ two = Position(xpos=316, xanchor=0.5)
    $ three = Position(xpos=422, xanchor=0.5)
    $ four = Position(xpos=528, xanchor=0.5)
    $ five = Position(xpos=634, xanchor=0.5)
    $ six = Position(xpos=740, xanchor=0.5)
    $ seven = Position(xpos=846, xanchor=0.5)
    $ eight = Position(xpos=952, xanchor=0.5)
    $ nine = Position(xpos=1060, xanchor=0.5)
    $ ten = Position(xpos=1200, xanchor=0.5)
This is the code I have in place for the positions. If I try to use dis2 (the transform transition) when I declare him on a custom position, it doesn't work.

If I do:

Code: Select all

show s 1 u at dis2, five
It'll show him on the position five, but it won't do the transition.

Same if I try to change expression and use:

Code: Select all

show s 1 u at five with dissolve
show s 1 u smile at dis2
It also won't do the transition when it's time to change the facial expression.

BUT if I do the first attempt at changing facial expression and then do another, it'll work. So if I do:

Code: Select all

show s 1 u at five with dissolve
show s 1 u smile at dis2
show s 1 u laugh at dis2
The first change of expression (into the 'smile' expression) will just pop into the screen with no transition. The second one (the 'laugh' expression) will go off without a problem using the transition.

But if I do any of the earlier examples using a default position (say 'center) it'll work perfectly. I'm absolutely confused at this. Do ATL transforms not work with custom positions? If so, is there any way around this? I'm stumped.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot]