Wildcard animation name picking?

Just started using Construct 2? Post your questions here

Post » Tue Feb 28, 2017 5:14 pm

I'm sure it should be done with variables, but for animation systems I like to refer directly to the animation names, so I can check when animations are finished, etc. Is there a way of picking multiple animation names using a wildcard? Something like "If 'Shoot*' is playing", so all animations beginning with the word Shoot are referenced?
B
41
S
12
G
14
Posts: 1,122
Reputation: 11,268

Post » Tue Feb 28, 2017 6:28 pm

"Shoot" =? left(Sprite.AnimationName,5)
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Tue Feb 28, 2017 6:55 pm

99Instances2Go wrote:"Shoot" =? left(Sprite.AnimationName,5)

How do I test things like "if playing" and "if finished" with that? Do I just take it to the system expression editor?
B
41
S
12
G
14
Posts: 1,122
Reputation: 11,268

Post » Tue Feb 28, 2017 7:59 pm

On any finished
Compare 2 values "Shoot" = left(Sprite.AnimationName,5)

Is playing
"Shoot" = left(Sprite.AnimationName,5) ? Sprite.AnimationName : "" ----<---- fill in the animation field

On finished
"Shoot" = left(Sprite.AnimationName,5) ? Sprite.AnimationName : "" -----<---- fill in the animation field
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest