[Solved] Set colective tiles always over their respective

Get help using Construct 2

Post » Sat Jul 11, 2015 8:35 am

In my game i'm using normal maps for each tile. Using the container and adding the normal map.gfx no problem always that the tile is static. But when it moves?

Actually i have something like:
For each "Tile"
"Tile" is moving -> Set "Tile_Normal" at "Tile" position.

So only when the tile is moving will update the position, instead of use every tick to get better perfomance with a lot of tiles with normalMaps.

The problem is that actually i have to do an individual event for each one of movable tiles. So i though, ok, using families, one for "tiles" and other for "Tile normals" . I changed the previous code event and some variations but nothing, always there is something wrong on some site :S .

Question: Is there any way to do it with families or another way i'm missing?
Last edited by matriax on Sat Jul 11, 2015 10:58 am, edited 1 time in total.
B
24
S
10
G
3
Posts: 558
Reputation: 4,493

Post » Sat Jul 11, 2015 8:57 am

These Tiles are sprites?
I guess either using the pin behaviour, or using container, or referencing the normal maps by UID or another way of picking the right one would do..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Jul 11, 2015 9:48 am

Yes, the tiles are sprites and actually all are using the container behaviour.

Yes, and all this options works with individual sprites but not on families.

I mean, i have: Tile1, Tile2, Tile3, Tile4, Tile5 and Tile_Normal1, Tile_Normal2, Tile_Normal3, Tile_Normal4 and Tile_Normal5.

If on start layout i pin Tile_Normal1 to Tile1 all perfect, allways will go with it on moving or whatever but i will have to add one pin for all the objects i want to move.

So the idea is add the Tile_Normal1 to the Tile1 container and add Tile_Normal1 to the Normal-Map-Family and use an event or something that pin automatically to all the spritees with a container inside the "NormalMap" family. THen i can add Tile_Normal2 to the Tile2 container and do in the other that always be pinned because that one event/condiction that say they have to be pinned.

I don't know if i explained well XD . I want to pin all the normal maps over all the tiles adding in their respective container and using only one event/condition instead pin every one 1x1.
B
24
S
10
G
3
Posts: 558
Reputation: 4,493

Post » Sat Jul 11, 2015 9:55 am

Would this work for you?

for each family1
pick nearest family2
> family2 pin to family1
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Jul 11, 2015 10:04 am

LittleStain wrote:Would this work for you?

for each family1
pick nearest family2
> family2 pin to family1


Not works or i'm doing some wrong, I made this:
Image

Is correct? The idea looks very good i really hope this works :P , i don't know about pick-nearest. I go to read some docs this have to work :P

I made various changes about family1/2 and nothing all the combinations fail, not pin.
B
24
S
10
G
3
Posts: 558
Reputation: 4,493

Post » Sat Jul 11, 2015 10:22 am

Arg! I thought i get it.

Have in mind that in the game i have multiples tile1,etc... so at the start there is only one Tile1_Normal, is after when all the Tile1_Normal are created due the "container" of each Tile1.

I say this because i added "F_NormalMaps on created -Z" at i get the last object pinned, but pinned with all the normaltiles XD, seems i'm getting somewhre, i hope....
B
24
S
10
G
3
Posts: 558
Reputation: 4,493

Post » Sat Jul 11, 2015 10:24 am

You should pick the nearest to the position of the family..

Here's an example with 2 sprites

https://dl.dropboxusercontent.com/u/48563442/pinto.capx
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Jul 11, 2015 10:57 am

Much thanks for the example but in my case only worked when i changed "on created" by "On start layout".

I changed my condition of " F_NormalMaps On created" by "on start layout" and is working now. If i delete the condition "On start layout" not works i don't know why :S , but well is solved, thanks! very useful the Pick-Nearest! .
B
24
S
10
G
3
Posts: 558
Reputation: 4,493


Return to How do I....?

Who is online

Users browsing this forum: 25games, Artcadev, grodrigues and 23 guests