Re-use Events for multiple similar enemies

Get help using Construct 2

Post » Fri Mar 08, 2013 7:15 am

tl;dr How do you concatenate an animation name in an event using a local variable? Is that even possible?

I know this is simple but I am not finding the solution for some reason. I have an enemy set up with its AI events, and I want to have another similar enemy (different art) use those events. All the animations for both enemies are in the same object.

Basically if blueGuy gets hit it plays blueGuy's hit animation, but if it is redGuy it plays redGuys's animation.

I have a local variable that defines which enemy it is, and I need to call that local variable with the ending of the animation name in the events. So (local variable & walk) would give blueGuywalk for blueGuy's walk animation.

I'm sure there are topics on this already, I just couldn't come up with the right search terms. If you could point me to them that would be great!

Thanks!
fat40oz2013-03-08 07:37:20
B
13
S
4
G
3
Posts: 51
Reputation: 3,488

Post » Fri Mar 08, 2013 7:36 am

Doesn't "Set animation" to <localvar & "walk"> work? It should.
B
11
S
5
G
3
Posts: 19
Reputation: 2,969

Post » Fri Mar 08, 2013 7:44 am

Right that's what I need. But how do I enter that in Set Animation? I get invalid character errors.
B
13
S
4
G
3
Posts: 51
Reputation: 3,488

Post » Fri Mar 08, 2013 7:48 am

DOH! I got it. It's Object.variable & "Walk". Major brain fart on that one...
B
13
S
4
G
3
Posts: 51
Reputation: 3,488


Return to How do I....?

Who is online

Users browsing this forum: Unconnected and 31 guests