Referencing a dynamic instance that is the same

Get help using Construct 2

Post » Sat Aug 24, 2013 12:18 am



I need to modify Z orders so that the object the arrow is pointing to is higher than the object to its left.



I'm trying to reference using the family (as I'm not sure doing an 'is overlapping seekerpart' would reference another seekerpart and not itself).

Anyone have an idea on how this would be accomplished without creating another object?

Here's the .capx, but it's kind of big so I isolated the relevant parts in the images above.

BoardGame.capxExcal2013-08-24 00:19:44
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,234

Post » Sat Aug 24, 2013 12:43 am

Tagging @vee41 because he knows how to solve all my problems :D
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,234

Post » Sat Aug 24, 2013 11:33 pm

Here's an update.

The problem:



To the bottom-right, you'll see there is a number 0. This is debug text that is supposed to equal the UID of the pink part that needs Z-level correction:



Here is what the current set of events is:



My goal is to be able to pick the problem part so I can change its Z order. As you can see by the "0" number near the bottom right of the first image, the problem part isn't being picked. Does anyone know how to pick the problem part?
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,234

Post » Sun Aug 25, 2013 7:40 pm

I tried doing an ordered For Each loop to pick by highest IID and where the animation frame is equal to facing left, but that doesn't seem to work either (the variable that should be equal to the picked part's UID is still 0).

Any help on this is appreciated. Now requesting help from @r0j0hound :DExcal2013-08-25 19:40:58
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,234

Post » Sun Aug 25, 2013 8:04 pm

Z order is the order objects are placed on top of each other.
Think of it as you would layers, or layers of glass where the sprites are simply decals placed on that glass.
So if objects are not over one another they are visible.
Objects created at runtime are automatically placed at the top.

Perhaps you should take a look at that frames hot spot instead.
Image ImageImage
B
169
S
50
G
169
Posts: 8,286
Reputation: 108,216

Post » Sun Aug 25, 2013 8:24 pm

You could just sort all the pieces at once. It's not as concise as only sorting the relevant pieces but it sure is simpler to implement and debug.

For each seekerPart ordered by seekerPart.x*10000+seekerPart.y
--- seekerpart send to front

The 10000 is just an arbitrary number larger than the layout height.
B
92
S
32
G
107
Posts: 5,274
Reputation: 69,959


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests