Calling C2 masters.. <- Added better screenshot!

Get help using Construct 2

Post » Sun Mar 05, 2017 1:34 am

Ok bad subject name, sorry about that.

I have been trying hard with this one.

Once in a while maybe 1 out of 20 times, the fade out would finish but not execute line 94 (and its childrens).

I have tried many things. Added "on fadeout finished", changed the number of TileSprite.count to 3 and some other things.
But the problem still persists. Line 96 won't be executed. As said, once in a while only. Mostly often it works well!

95 and 96 aren't the problem because 94 won't even be touched, I have verified that by adding browser.log msg.

I suspect it might be something else.

What do you think?
Image
Last edited by helena on Sun Mar 05, 2017 6:07 pm, edited 1 time in total.
B
60
S
18
G
13
Posts: 449
Reputation: 10,811

Post » Sun Mar 05, 2017 7:53 am

@helena

well, hard to say without seeing more of the code, but if the event isn't running then the tile count isn't getting down low enough to trigger it.

which would indicate the timer is never getting started for one or more tiles. The most likely cause of that would be a glitch in your RandomTileArray, or a problem with the overlapping, or a tile not where it is supposed to be.
B
99
S
35
G
20
Posts: 438
Reputation: 17,960

Post » Sun Mar 05, 2017 7:54 am

@helena

The object is called TileSprite but you are comparing Tilesprite.count

Object names are case sensitive.
Find all the Construct 2 games that were on Steam Greenlight here
B
41
S
11
G
7
Posts: 512
Reputation: 7,328

Post » Sun Mar 05, 2017 6:05 pm

@AllanR you are right, I forgot portions of related events. I am sorry for it. I have now made a new screenshot of basically the whole event sheet, removing just the very non relevant events.

Image

@OddConfection I have now changed just to be sure.
B
60
S
18
G
13
Posts: 449
Reputation: 10,811

Post » Sun Mar 05, 2017 8:37 pm

@helena

well, I walked through it and didn't see any smoking guns. I was remotely concerned that the camera could get to the player before the last tile timers finished their fade-in (and then the fade-in group is getting deactivated - I though that might lock a tile in a state that prevents it from being destroyed). But I ran a test, and that would not be a problem.

I notice you set the MapArray to mapwidth+1 but the Random and Temp arrays are only mapwidth. Any chance there is a rogue tile in the data being imported?

The only way I could get a tile to fail to fade out was if it did not pass the overlap test at event 92. If the collision map for one of the animations (on a less common tile does not have a point inside the x+16, y+16 spot you are checking, then it will not get removed. So check collision maps, and origin points - I routinely accidentally click somewhere I shouldn't and change an origin (and not notice) , or forget to make one of the animations match all the others...

For debugging purposes, I would zoom the layout scale out so you can see the whole map at the start of the fade out group, and show a live tile count in a debug text box so you know for sure whether the tile count is not getting "less than or equal to 1" to satisfy event 94. Or if maybe some other strange combination of events is happening somewhere else (like somehow disabling the fade out group before it gets finished). The fact that it happens rarely certainly makes it harder to track down - but there always is a logical explanation.
B
99
S
35
G
20
Posts: 438
Reputation: 17,960

Post » Mon Mar 06, 2017 3:48 am

@AllanR Thank you for taking time for me.

I followed your advice with the adding spritefont number counting down the tiles as they go, and the scale.

I noticed that when it won't work it could be 6 to 20 tiles left and sometimes one of these tiles would be way off on X (but still within the 32 px increments) all had proper even 32 pixel positions.

I then tried to figure out why I added one to the Maparray width, but I could not. I removed it so it matches the other arrays.

Then it seems to be working properly. Have tested like 30-40 times but I might need to do some more.

So you are probably right, some rogue data got into this extra array space and caused problems.

Hopefully this is it.
B
60
S
18
G
13
Posts: 449
Reputation: 10,811


Return to How do I....?

Who is online

Users browsing this forum: mistia and 7 guests