Issues with selecting by Z in array

Get help using Construct 2

Post » Tue May 07, 2013 4:35 pm

Hey, I apologise if I am asking something entirely noobish, but I've just been playing around with Construct 2 recently so not 100% on everything just yet.

Basically, I am storing block placement in an array and calling that to create the levels, it's all well and good, the level displays perfectly but there is a small problem.
You see I want to have multiple possibilities for levels, so using a third dimension to the array, but I am having an issue calling the specific array I wish (or rather at random).

I hate to ask, but what would you guys suggest for calling a specific Z-field in an array? Because nothing I can think to try is working.

Many thanks.
-Silent
B
8
Posts: 3
Reputation: 399

Post » Tue May 07, 2013 5:13 pm

It all depends on how you access your array when you create your levels. Could you detail a bit on what you are currently doing and what or how it goes wrong ?
B
45
S
16
G
18
Posts: 845
Reputation: 13,673

Post » Tue May 07, 2013 5:39 pm

Thanks for the reply Magistross, I seem to have got it working now, but it just doesn't seem the most straight forward of ways.

Essentially at start of Layout I am creating n array the size of my game (25 blocks by 20 blocks) with a depth of 2.

I was then assigning half dozen fields in the array to 1.

Next For Each XY element, with a sub-event for Value at Array.CurX, Array.CurY, Level (numerical variable) = 1, I am creating an object and assigning the frame of that object to display what I want.



Now all the tiles on Depth-0 were displaying correctly but only two tiles on Depth-1 were showing up, I noticed that the tiles that were showing were sharing space with tiles on Depth-0, so I've set Depth-0 to all tiles and am exempting that from my results, and everything else seems to be working fine.

And I realise I am explaining this all in the worst way possible.
B
8
Posts: 3
Reputation: 399

Post » Tue May 07, 2013 6:02 pm

I think I might know what your problem is. The For Each XY element will always loop through Depth-0 only. Are you expecting that both "levels" get created at the same time ?
B
45
S
16
G
18
Posts: 845
Reputation: 13,673


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 18 guests