How do I randomize idle animations with families

Get help using Construct 2

Post » Tue Jun 21, 2016 1:19 am

I now understand why this is not working- but just showing what I was trying to do...

Image

I wanted to make it so each NPC on screen plays a quick idle animation but at different times- this still has them doing the animation in unison which looks wrong.

Any help or suggestions for this artist trying to "code" I would greatly appreciate it! Thanks-
B
14
S
5
G
6
Posts: 65
Reputation: 4,245

Post » Tue Jun 21, 2016 2:17 am

This is setting them all at the same time. Use a for each loop. Also could use the timer behavior.
ImageImageImage
B
39
S
22
G
11
Posts: 486
Reputation: 9,913

Post » Tue Jun 21, 2016 5:24 am

badmoodtaylor wrote:This is setting them all at the same time. Use a for each loop. Also could use the timer behavior.


The for each sounds like a great idea- maybe I just dont understand well enough how they work- i did a little reading but no matter what I try I am unable to see it work how I am hoping. Perhaps you could give me an idea? This is the mess I am trying to make work...

Image

Image
B
14
S
5
G
6
Posts: 65
Reputation: 4,245

Post » Tue Jun 21, 2016 12:59 pm

Why do you have the repeat 10 times? The for loop will run it for each so you are running it 10 times for each.

This is how I was thinking.

On start of layout
-for each npc
--start timer "idleAnimation" random seconds

On timer "idleAnimation"
-for each npc
--Idle animation
--restart timer

The for each on the timer is due to if two timers go off at once they will be separated.

Let me know if you have any more questions.

...and thanks for trying my project! And don't worry, no one has found any of the eggs yet
ImageImageImage
B
39
S
22
G
11
Posts: 486
Reputation: 9,913

Post » Tue Jun 21, 2016 7:49 pm

badmoodtaylor wrote:On start of layout
-for each npc
--start timer "idleAnimation" random seconds

On timer "idleAnimation"
-for each npc
--Idle animation
--restart timer


That worked perfectly- thanks so much!

Now I feel challenged to find an easter egg... Ill have to try again after work tonight :)
B
14
S
5
G
6
Posts: 65
Reputation: 4,245

Post » Tue Jun 21, 2016 8:00 pm

haddy22 wrote:That worked perfectly- thanks so much!

Now I feel challenged to find an easter egg... Ill have to try again after work tonight :)


Great! (to both)

Hint: two of them require very detailed observation to surroundings. The other, a little creative thinking, but most likely luck in discovering it.

Happy hunting! :D
ImageImageImage
B
39
S
22
G
11
Posts: 486
Reputation: 9,913

Post » Thu Jun 23, 2016 1:13 am

Good post, I need this solution Y
B
21
S
6
G
3
Posts: 67
Reputation: 2,946


Return to How do I....?

Who is online

Users browsing this forum: digitalsoapbox, RetrocadeMedia and 1 guest