Is it possible to make an image repeat a displayable a limited number of times and then show another displayable?
I'm making the characters in my game "talk" using layered images and the "_last_say_who" variable. Something like this:
Code: Select all
init:
image pov_talk:
choice:
"pov/pov_mouth_mtalk1.png"
choice:
"pov/pov_mouth_mtalk2.png"
choice:
"pov/pov_mouth_mtalk3.png"
choice:
"pov/pov_mouth_mtalk4.pn
And a layeredimage like this:
Code: Select all
layeredimage pov:
always:
"pov_base"
group mouth:
attribute mneu default:
"pov_mouth_mneu"
Code: Select all
image pov_mouth_mtalk:
"pov_talk"
.2
repeat
image pov_mouth_mneu = ConditionSwitch(
"_last_say_who == 'pov'", "pov_mouth_mtalk",
"not _last_say_who == 'pov'", "pov/pov_mouth_mneu.png")
So far it works wonderful (I'm pleasantly surprised I got it working!). But I don't want the sprites to go on talking forever (until the click).
I want to be able to either make them stop and show the closed neutral mouth after a number of repeats or time passed, OR - even better - have them repeat the loops depending on the length of the "_last_say_what" so that their "talking" reflect how many characters their sentence or utterance had.
I failed miserably when I tried to make that "_last_say_what" work, so I decided to (at least for now) have them all stop after a set number of loops and then show the neutral mouth after it, something like this:
Code: Select all
image pov_mouth_mtalk:
"pov_talk"
.2
repeat 10
"pov/pov_mouth_mneu.png"
But I've had no success with this one either. I tried everything I know: blocks, parallel, contains...
I'm doing something wrong or failing to understand something (perhaps basic - I don't feel like I'm doing advanced coding here...).
The closest I came to getting it right was through doing this:
Code: Select all
image atl_pov_mouth_mtalk:
"pov_talk"
.2
repeat
image pov_mouth_mtalk:
atl_pov_mouth_mtalk
pause 5
"pov/pov_mouth_mneu.png"
Any help / advice is hugely appreciated!
Cheers