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
108
S
24
G
18
Posts: 1,372
Reputation: 22,817

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
169
S
50
G
174
Posts: 8,325
Reputation: 110,794

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
108
S
24
G
18
Posts: 1,372
Reputation: 22,817

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
398
S
236
G
88
Posts: 24,428
Reputation: 194,600


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 4 guests