Use 'For Each' Correctly

Get help using Construct 2

Post » Sat Mar 16, 2013 12:05 pm

Here's my action

Start of layout
For each 'Emitter'

        Play 'audioFile' looping at object 'Emitter'


This doesn't work when I copy instances of the 'Emitter' object - the sound doesn't emit from each instance, only one or two of them.

I have an example capx:

https://dl.dropbox.com/u/3317708/AudioEmitters.capx

Thanks
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Sun Mar 17, 2013 6:47 am

I've tried its no luck. Ive tried buttons with two different ID no go it still looping around one of them. I do believe its a bug Your better off getting someone to javacode it or bring it up to construct creator Ive tried function to see if the game would let you since there are multiple of em i tried to set position but apparently the program cannot see multiple set in one action ive tried every thing. it still wanting to go toward one object not multiple.
B
7
S
2
G
3
Posts: 58
Reputation: 2,284

Post » Sun Mar 17, 2013 7:00 am

@CrudeMik - I'm still learning a great deal here, and audio is definitely NOT my specialty. However, I have just a hunch that part of the deal is because it's all set to On start of layout. Something tells me that's part of the conundrum. While it's working for one emitter, even though you have the For each going, the layout has since already started...come and gone. (The green arrow of the event, as I'm sure you clearly know already, signifies it's waiting for a singular, specific instance of that event...the start. Can't have multiple starts, per se. Certainly not of the layout. ... Er, correct me if I'm wrong.)

Since it's working for one emitter, I'm guessing you just need to set it up so it's a different event that isn't looking for a one-time occurrence.

I really don't know, but I hope that helps somehow. Hopefully this will help me learn something, too, once you find the solution.Rhindon2013-03-17 07:00:59
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
113
S
20
G
8
Posts: 741
Reputation: 13,661

Post » Sun Mar 17, 2013 8:00 am

Even if it's a trigger (green arrow) it should work for all objects if you use a "For Each" condition.

Maybe it's a bug since this was just introduced in the latest beta.
B
63
S
23
G
17
Posts: 254
Reputation: 14,342

Post » Sun Mar 17, 2013 11:04 am

Thanks chaps - I'll post this up as a bug
B
39
S
12
G
8
Posts: 580
Reputation: 7,108


Return to How do I....?

Who is online

Users browsing this forum: Zebbi and 23 guests