Board Game Tile Manipulation

Get help using Construct 2

Post » Sun Jun 23, 2013 8:30 am

So I have this grid laid out with each tile represented by a different, unique sprite.

I have an XML file that I parse into a 2D array (X,Y) which represents the ~names~ of the adjacent tiles.
For example,
Tile1 is adjacent to Tile 2 and Tile 3
Tile 2 is adjacent to Tile 1, Tile 4, and Tile 5
So thusly:
Tile 1 is
(1,0) = Tile 2
(1,1) = Tile 3
Tile 2 is
(2,0) = Tile 1
(2,1) = Tile 4
(2,2) = Tile 5
ect.

The thing is that the Tiles are only represented in the array by a STRING of its name, not object/sprite reference. How can I utilize this in events? I thought I could do something like MyArray.At(1,0).X to evaluate the x position of Tile 2 but realized that Construct 2 can't think that far ahead.AnthonyB282013-06-23 08:32:06
B
10
S
3
G
3
Posts: 47
Reputation: 2,666

Post » Sun Jun 23, 2013 10:00 am

Just realized, what if I did it by UID? How would that go about working? I tried to replace all the string names with just UID numbers, but I don't quite understand how I can call the UIDs.

EDIT:
Figured it out using the UIDs.
I made a family of all the tile sprites I was using and then used System->Pick UID Instance Of (MyArray.At(X,Y))

I don't quite understand why you need to have a family or a specific object for this. I wish you could just pick by UID straight up, isn't that what they are for? I'm sure there is some kind of engine technical restriction on that with unit types or some hubub though.AnthonyB282013-06-23 10:51:40
B
10
S
3
G
3
Posts: 47
Reputation: 2,666


Return to How do I....?

Who is online

Users browsing this forum: DJKeefy, mekonbekon, SputnikCZ and 10 guests