Deciding animations with expressions?

Get help using Construct 2

Post » Thu Mar 21, 2013 1:16 am

Hi, I'm new to construct, and I'm wondering if it's possible to use variables to easily make construct decide which animation will play off?

Say for instance that a character has 10 different animations in a sort of combo-tree. Also, let's add to the equation that there's 12 different "variations" of this combo (In total 120 animations).

Is it possible to for instance name the first animation of the first combo "LeftPunch_1_1", the second "LeftPunch_2_1", the third "LeftPunch_3_1" etc. and have a single expression or equation decide which animation plays off from a single event-line? If this is possible, how would you apply it?

I imagine it would look something like this:
"LeftPunch_x(Combo-hits variable)_y(Variation variable)"

Hope what I described made any sense. :)
Tinimations
B
22
S
7
Posts: 316
Reputation: 2,490

Post » Thu Mar 21, 2013 1:33 am

like set animation "leftpunch_x"&variablex"_y"&variabley ?
B
17
S
2
G
2
Posts: 82
Reputation: 1,712

Post » Thu Mar 21, 2013 4:13 am

@Tinimations

@haifisch is almost correct...he's missing an "&"

Player -> set animation "leftpunch_x" & VariableX & "_y" & VariableY

You can concatenate strings and use variables to piece together the name of the animation you wish to set.
B
26
S
8
G
3
Posts: 210
Reputation: 5,973

Post » Thu Mar 21, 2013 10:30 am

Thank you for the quick answer! :)
B
22
S
7
Posts: 316
Reputation: 2,490


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 26 guests