Funnily enough I'm trying to do this
exact same effect. I want a name box to pan in when a character starts speaking, and swap with other name "cards" when switching characters or the like.
And I've run into this same problem.
I gave the above code a try, using variables and
on show, and it still results in the animation re-playing when pauses occur or new messages. It seems that
on "hide" triggers on a pause for some reason, even though the say screen isn't actually hiding.
I was able to prove this with the following:
Code: Select all
init -1500 python:
def say_hide_test():
renpy.sound.play("system_confirm.ogg")
return
screen say(who, what):
predict False
on "hide" action Function(say_hide_test)
# [...]
EDIT: Addendum - making the test variable store the current
who could be a possible solution, as it would probably detect changes in
who, including None. Not sure how to make use of it yet though, and it seems to trigger twice (sound plays twice) with a fresh message after a pause/animation/etc.
Code: Select all
init -1500 python:
def say_hide_test(w):
global present_who
renpy.sound.play("system_confirm.ogg")
present_who = w
return
screen say(who, what):
predict False
#on "hide" action Function(say_hide_test)
if present_who != who:
timer 0.001 action Function(say_hide_test, who)