# Dragon Caves problem?

Get help using Construct 2

### » Mon Oct 07, 2013 2:19 am

Hi! Recently, I've been making a tile world gen, and all is well! But, I've been trying to make underground dragon caves using these events:

Here's how it works:
It goes through the Array, and finds all the 2's. Then it checks if the 2's are between a certain range on the Y-Axis. If they are, it picks a random number between 0-100. If it is between 0-2, then it sets a 2 to 5. Then from that 5, it makes a 20x8 cave out of 5's. But that doesn't happen.
It just sets any random 2's to 5. Can anyone tell me why this is? Thanks!
B
30
S
8
G
3
Posts: 366
Reputation: 6,332

### » Tue Oct 08, 2013 3:27 am

I thought it'd be more helpful if I included a pic of the weird caves.
B
30
S
8
G
3
Posts: 366
Reputation: 6,332

### » Tue Oct 08, 2013 4:50 am

Which tiles are the 5? What's the width of your array?
B
10
S
4
G
1
Posts: 58
Reputation: 1,420

### » Tue Oct 08, 2013 5:57 am

@Hutto The darker stone ones are the 5, and the array is 125x125x1InvaderX2013-10-08 05:57:20
B
30
S
8
G
3
Posts: 366
Reputation: 6,332

### » Tue Oct 08, 2013 6:28 am

You need to combine events 50 & 51. You are currently getting one row of 5s, and one column of 5s, not a 'square' of 5s.

A similar example:
ArraySquare.capx
B
71
S
22
G
281
Posts: 3,842
Reputation: 154,886