For loop madness

Get help using Construct 2

Post » Fri Oct 14, 2011 8:43 pm

I deleted a previous thread about this before but man I'm just not understanding why its not doing what its suppose to.

All I want to do is create new text objects underneath their parents and display numbers based on simple math.

instead of getting 1 2 3 4 5 etc, I just get 5 5 5 5 5 5


here is my capx: file

I even read the tutorial on the for loops and it looked easy because I use for, foreaches, whiles (the whole shibang) in php and javascript.
B
16
S
2
G
1
Posts: 20
Reputation: 1,284

Post » Fri Oct 14, 2011 8:58 pm

Hmm, this is strange... I fixed it, but I'm not sure why it works now and not before.

All I did was change the Sprite - Spawn object num event to System - Create object num at Sprite.X, Sprite.Y. Now the text beneath the boxes reads like you wanted, 1 2 3 4 5 etc.SullyTheStrange2011-10-14 20:58:38
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Fri Oct 14, 2011 9:03 pm

Could be a picking bug in the Sprite - Spawn object action.
Ashley corrected something similar for the system - create object.

This is conjecture, if Ashley takes a look around here, he will tell for sure.

Nice workaround though Sully
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Fri Oct 14, 2011 9:18 pm

Thanks!
B
16
S
2
G
1
Posts: 20
Reputation: 1,284

Post » Fri Oct 14, 2011 9:25 pm

It looks like a bug but in fact is a side effect of the way the Spawn action is implemented. If I fixed it, it would break other things. So I'm afraid you'll just have to use Sully's workaround.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Fri Oct 14, 2011 11:05 pm

@Ashley: This is the kind of things that will need a proper explanation/notice in the manual.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests