Why is my player disappearing when I move between layouts?

Just started using Construct 2? Post your questions here

Post » Sun Feb 08, 2015 8:38 am

I've made a simple 'test game' with 9 rooms (1 layout per room). The player starts in the center room, and taking any of the 4 exits teleports him to the appropriate room (collision with an invisible object triggering an event that changes either your X or Y coordinate to the opposite side and then does the layout switch). There's just one problem... The player doesn't appear in the next room! Or if he's appearing, he's invisible. Both the player and his sprite are set to 'global', so I'm not sure what's going on.

Here's the capx:

http://www.filedropper.com/zzttest_2
B
6
S
1
G
1
Posts: 91
Reputation: 900

Post » Sun Feb 08, 2015 4:39 pm

I tried adding an "on start of layout, create player object on layer 0 at 318, 318" to the universal events sheet. No luck. :X
B
6
S
1
G
1
Posts: 91
Reputation: 900

Post » Sun Feb 08, 2015 5:30 pm

Your layers are a mess. The Player sprite is on the Object layer, but that doesn't exist on the other layouts. You have other layouts with layers in different orders, with different transparencies. Your bottom layer should generally be not transparent and your background. All other layers should be transparent. You've tricked the first layout's Art layer by using white as the background colour, for the Multiply effect to work, but it's black for the others, so it blocks the layers underneath.
ImageImageImage
B
71
S
21
G
204
Posts: 3,586
Reputation: 115,576

Post » Sun Feb 08, 2015 5:57 pm

What do you mean by 'it blocks the layers underneath'? The multiply effect seems to be working correctly... Also, just having the bottom layer as black and non-transparent was creating this extremely strange issue where the player's sprite was creating a 'trail' everywhere it went.

Anyways! I cleaned up/standardized the layers (for at least N S E W, haven't implemented the diagonal corner rooms yet b/c I want to get the basic interaction working), implemented a standard system of variables for where to spawn the player on each map... and it's still not working.

Image

Capx: http://www.filedropper.com/zzttest_3
B
6
S
1
G
1
Posts: 91
Reputation: 900

Post » Sun Feb 08, 2015 6:33 pm

I've cleaned up N & W, as I suggested. The multiply effect only worked on the first layer as you set that layer's background to white. If it's black, like every other layout, then it fails.

If you are going to create the player, it can't be global, and you have to delete any default objects.
You do not have the required permissions to view the files attached to this post.
Last edited by blackhornet on Sun Feb 08, 2015 6:34 pm, edited 1 time in total.
ImageImageImage
B
71
S
21
G
204
Posts: 3,586
Reputation: 115,576

Post » Sun Feb 08, 2015 6:34 pm

Update: I built a simple version (single layer, simple tilemap, etc.) and nothing goes wrong on that one. Not sure what the difference between the two is... http://www.filedropper.com/simplezzttest

Edit: I spoke too soon! Thanks for doing that, will investigate to see the difference between N/W and S/E to see what's going on there. :)
B
6
S
1
G
1
Posts: 91
Reputation: 900

Post » Mon Feb 09, 2015 8:24 am

Are you sure your player is not on the layer below background, so it is maybe hidden by background?

Try to create new layer on top of every layout (sall it "player") and then when you create player put it on that layer? (you can refer it by name with quotation marks, like "player", not just by number)
B
12
S
6
G
2
Posts: 99
Reputation: 1,727


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests