Grid generation does not work

Get help using Construct 2

Post » Sun Sep 25, 2011 4:02 am

I am trying to get construct to make a grid of specific square sprites using events. I am attempting to make it create in a fancy animated way (as in create first cell, wait split second, create second cell, etc.)

It is supposed to create 4 rows of 6 cells at the moment.

I have written an event sheet and I don't know why it is not working. I would appreciate some help with the issue.

http://dl.dropbox.com/u/41931267/Grid%20Creator.capx

Many thanks!
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sun Sep 25, 2011 4:28 am

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: 6,998
Reputation: 57,791

Post » Sun Sep 25, 2011 6:02 am

Excellent! thanks.
On a minor note, the first cell generates offset from the rest. any simple adjustments I can make?

B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sun Sep 25, 2011 6:07 am

I noticed it too.
It should work though. I reported it as a bug already, we will have to wait for Ashley to confirm or point out the error in the code.
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: 6,998
Reputation: 57,791

Post » Sun Sep 25, 2011 6:58 am

OK then. Quite intriguing...
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sun Sep 25, 2011 12:21 pm

If no instances of an object exist, all its expressions return 0, including its width and height (there is no instance to get the width or height from). If you look at the math you'll notice that ends up making an object at 0, 0. Either hard-code the width and height with numbers or have an initial object off the screen.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Sun Sep 25, 2011 3:03 pm

Oh right, I hadn't noticed the first instance of grid_section had a "destroy outside of layout" behavior.
@sqiddster, simply remove this behavior and the grid generates as intended.

Thank you for the pointing out Ash !
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: 6,998
Reputation: 57,791

Post » Sun Sep 25, 2011 10:21 pm

OK, interesting.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400


Return to How do I....?

Who is online

Users browsing this forum: GUN, LeFuji and 19 guests