How do I place Objects on specific Tile Types on a Tile Map

Get help using Construct 2

Post » Mon Jul 25, 2016 11:52 am

Can I, for example have a tile map with black tiles and blue tiles, can I detect all my placed black tiles (same Tile ID) and place a specific object on all of them, and place another such on all blue tiles.

Thanks in advance, and sorry if its been discussed I just can't find this specific scenario wich eludes me so far.

Cheers!

P.S. Place an object on Load Layout for example, by placin something on the X, Y coordinates of each and every tile of the picked sort (for example, black)
B
18
S
3
Posts: 65
Reputation: 994

Post » Mon Jul 25, 2016 12:03 pm

Hi,
I don't undesrtand all what you have tell but I think that this plugin can help you : viewtopic.php?f=153&t=69647
B
17
S
10
G
19
Posts: 140
Reputation: 11,457

Post » Mon Jul 25, 2016 12:12 pm

Hey, thanks for fast responce.

The thing is, as I understand it, every tile in the Tile Map has an ID...for example I have a tilemap object with only 2 tiles to pick from, one Black (Tile ID 0) and one Blue (Tile ID 1). I paint the whole object in black tiles and just paint a river with the blue tiles. I want to run an event, that upon loading the layout Picks all the Black tiles painted, and places an object of choosing upon it - not important, and then picks all the blue tiles painted and places a another object on all of them, something like:

Conditions: On start - Pick All Black Tiles
Actions: Create Object on X.Y of Black Tile (Tile ID 0 or somthing of the sort)... can I do that in anyway?
B
18
S
3
Posts: 65
Reputation: 994

Post » Mon Jul 25, 2016 1:20 pm

Of course you can do this thing. Can you send your .capx file ?
B
17
S
10
G
19
Posts: 140
Reputation: 11,457

Post » Mon Jul 25, 2016 1:51 pm

At work currently - been browsing through the forum and can't find an explanation that I understand on the subject. I'll upload and example later on though, thanks!

P.S....my curiosity is killing me though, how will I go about doing that?
B
18
S
3
Posts: 65
Reputation: 994

Post » Mon Jul 25, 2016 2:50 pm

Message: TheWindmiller can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
https://www.dropbox.com/s/sit25qtanz28tiu/TileTest.capx?dl=0


I made a quick test project. I want to do the following:

On Layout Start, I want to Create the IsLand sprite object on all the Black tiles and the IsWater on all the blue tiles. Just these two tiles in the entire tilemap for this particular example, although won't be the case in the larger project.

I would immensely appriciate any help on how i can actually do that.

Very thanks in advance!

Cheers!
B
18
S
3
Posts: 65
Reputation: 994

Post » Mon Jul 25, 2016 4:16 pm

Hi, now I understand and, unfortunately, I tell you that it's impossible with tile map like this. You have to use sprites...

Sorry for have told that it's possible......
B
17
S
10
G
19
Posts: 140
Reputation: 11,457

Post » Mon Jul 25, 2016 4:25 pm

You have to loop through all tiles, and create the correct sprite according to the tile ID. Here's your file with the event that does just that.

https://dl.dropboxusercontent.com/u/700 ... eTest.capx
B
67
S
27
G
24
Posts: 968
Reputation: 18,571

Post » Mon Jul 25, 2016 4:48 pm

My hat goes off to you sir, to both you for the response. This is exactly what I needed. Still new but you guys are awesome. Thanks again!
B
18
S
3
Posts: 65
Reputation: 994


Return to How do I....?

Who is online

Users browsing this forum: MaujDeveloper, mrkaio, user5487, Zav and 2 guests