For each unexpected behavior

Bugs will be moved here once resolved.

Post » Mon Nov 11, 2013 7:00 pm

Link to .capx file (required!):
https://dl.dropboxusercontent.com/u/47035927/temp/For_each_demo.capx

Steps to reproduce:
1. Preview the attached CAPX;

Observed result:
It's working with the first instance of the "For each" picked objects, but the second instance object is being ignored by the event branch;

Expected result:
The same behavior for the two object instances.

Browsers affected:
Chrome: yes
Firefox: yes
Internet Explorer: yes

Operating system & service pack: Win 8.1 and Win 7

Construct 2 version: 149
    
Image
B
104
S
23
G
17
Posts: 1,350
Reputation: 22,028

Post » Mon Nov 11, 2013 7:18 pm


I think it should be:

Every x seconds
-object is not pinned
--for each object, do stuff

Timers in loops= nono
Image ImageImage
B
168
S
50
G
163
Posts: 8,220
Reputation: 105,059

Post » Mon Nov 11, 2013 7:27 pm

Thank you @newt!

It's working perfect now: https://dl.dropboxusercontent.com/u/47035927/temp/For_each_demo2.capx

Sometimes I think the logic is wrong, but, habitually, C2 prevents us from doing stupid things, like doing "Once True" inside a trigger, so, it could be implemented here too.
Image
B
104
S
23
G
17
Posts: 1,350
Reputation: 22,028

Post » Mon Nov 11, 2013 8:02 pm

Closing as not a bug. 'Every' is not designed to be used inside loops, but I think it would be tricky to make the editor stop you doing this...
Scirra Founder
B
387
S
230
G
87
Posts: 24,245
Reputation: 192,210


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest