Set random frame using animation name

Get help using Construct 2

Post » Sat Sep 07, 2013 3:29 pm

Hi, beginner question. Using the Set Frame action is there a way to call a random frame within a named animation in the "Frame Number" field?

For my enemy characters I have several different death animations depending on the weapon the player kills then with. Once the death animation is complete I have a large number of "enemy dead" frames so that once the death animation is complete the enemy lies on the ground in different positions depending on whether they have been shot in the front or back.

So once the relevant death animation is complete, I want to pick a random frame from the "enemy dead front" or "enemy dead back" animations, each of which contains 10 frames.
B
5
S
1
Posts: 44
Reputation: 665

Post » Sat Sep 07, 2013 3:52 pm

set frame to:
round(random(10))
HARMLESS SIGNATURE THAT IS VIEWED BY OTHERS AS OFFENSIVE AND CONTROVERSIAL
B
14
S
3
G
3
Posts: 356
Reputation: 4,377

Post » Sat Sep 07, 2013 4:41 pm


That works if I have just a default animation for the enemy. But if I want to set a random frame from one of several enemy animations, then how would I bring in the animation name?
B
5
S
1
Posts: 44
Reputation: 665

Post » Sat Sep 07, 2013 6:28 pm

first set random animation, then set random frame?

or if random is too random, use choose animation.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 13 guests