How do I pick by Y value?

Get help using Construct 2

Post » Wed Jul 22, 2015 6:43 pm

I'm using a hex tile map where the tiles have a height value so I can't just use the tilemap object vanilla style so each row has its own tilemap instance. Well, to operate on this tilemap I'm going to need to need to figure out Y coords by picking specific tilemap objects.

For example, to make the map bigger, I want to create a row on top of the highest one, but I need the y coords of the highest (lowest y value) instance. How do I pick this instance?
B
10
S
2
G
2
Posts: 73
Reputation: 1,044

Post » Wed Jul 22, 2015 7:17 pm

You can try to use the "pick lowest" condition and use a instance variable with the object Y value in it
B
17
S
7
Posts: 280
Reputation: 2,522

Post » Wed Jul 22, 2015 7:22 pm

Or the hacky way, "For each ordered" with Object.Y ascending as order expression, with an exit loop as soon as the first iteration finishes.
B
74
S
31
G
26
Posts: 994
Reputation: 20,198

Post » Wed Jul 22, 2015 10:00 pm

"pick lowest" only lets me pick instance variables, it won't let me pick by instance properties.

Edit: Ooops, I goofed on object creation. But the "pick by ordered" then exit loop works.
B
10
S
2
G
2
Posts: 73
Reputation: 1,044


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo and 8 guests