SOLVED! I have a pelicular bug in my game, needing help

Get help using Construct 2

Post » Mon Apr 14, 2014 6:36 pm

I give up, I am writing here.

I am making a BoulderDash clone and using array to detect things.

By some reason on the COLUMN 1 (with base zero, so basically second column ONLY that column, if you go down a few tiles, and then go up, you go up one tile and then get stuck there, and can only go left, basically through the solid and then out of the map itself...

The funny thing is that it is only happening on column 1, in both test levels.

I have disabled the other objects movements and the problem is still there so it is not there the problem lies.

I have printed screenshot of the events and looked through the X and Y everywhere and it seem to be ok.

If you press Space bar while in game you get numbers overlaid the tiles to show actual array data. This is taxing so only reachable by key trigger.

Frustrating, indeed.

Could also have to do with the level creation too, I am loading the levels from tmx strings. But the array looks fine from there, so I am not sure.

:roll:


EDIT:
I deleted the capx, but now I am re-adding it, for @ashley if needed.
You do not have the required permissions to view the files attached to this post.
Last edited by helena on Tue Apr 15, 2014 4:05 pm, edited 2 times in total.
B
58
S
18
G
13
Posts: 447
Reputation: 10,735

Post » Tue Apr 15, 2014 11:47 am

Maybe this is too odd to solve?
B
58
S
18
G
13
Posts: 447
Reputation: 10,735

Post » Tue Apr 15, 2014 2:20 pm

I put breakpoint at line 31 (array value = EMPTYSPACE for the up direction) and normally it would just break once for every up movement. But at the stuck position it is stuck there, breaking the "runtime" debug.

This made me put break points for 31, 32, 34 and it cycles through these in the debug time. It is as if the array value is not matching any of these, even though it should match EMPTYSPACE (0).

So I added Browser Log - MapArray.At(GridX, GridY-1) at line 30, and there I discovered that the returned value is 1, which is SOLIDWALL, when it should be zero (EMPTYSPACE)

I verified with the actual array and there the value is zero. Why does this return one? I have a feeling it is grabbing the value of column zero (which is all SOLIDWALL). But why only for this column and not the other columns?

Closer but still puzzled.

No I haven't updated the capx with the log entry but I might if this is confusing.
B
58
S
18
G
13
Posts: 447
Reputation: 10,735

Post » Tue Apr 15, 2014 2:22 pm

Could you please create a version that uses no third-party plugins? I might be able to take a look.
B
36
S
8
G
8
Posts: 532
Reputation: 6,903

Post » Tue Apr 15, 2014 2:25 pm

Oh right. Will consider it. But it is just one plugin: JSONTMXImporter. You could remove it afterwards if you dislike it. ;)

But if there's more people willing to help but not interested to put in plugin, let me know.
B
58
S
18
G
13
Posts: 447
Reputation: 10,735

Post » Tue Apr 15, 2014 2:44 pm

To @Fimbul and eventual others:

Ok here's a version without plugins (hopefully, let me know otherwise)
The level is very basic, but the problem is there, which is the main objective. ;)

File deleted.
Last edited by helena on Tue Apr 15, 2014 4:00 pm, edited 1 time in total.
B
58
S
18
G
13
Posts: 447
Reputation: 10,735

Post » Tue Apr 15, 2014 2:58 pm

Nope, it still requires JSON-TMX importer.
B
36
S
8
G
8
Posts: 532
Reputation: 6,903

Post » Tue Apr 15, 2014 3:01 pm

My suggestion would be to add some logging. Use Browser.Log to dump out your moves and even the map so you can see the data change. The problem will probably pop right out once you can see the data easily.
ImageImageImage
B
71
S
21
G
229
Posts: 3,687
Reputation: 128,338

Post » Tue Apr 15, 2014 3:02 pm

@Fimbul

Now? (How odd, I did remove it. silliness...)

File deleted.
Last edited by helena on Tue Apr 15, 2014 4:00 pm, edited 1 time in total.
B
58
S
18
G
13
Posts: 447
Reputation: 10,735

Post » Tue Apr 15, 2014 3:05 pm

@blackhornet, I did so, with the debug overlay, and also adding Browser log (which I wrote about here in later post).. I have concluded that it grabs the value from column zero, but I do not understand why it does that. :/

I will not give up this. I will continue trying to figure out why it does that! :)
B
58
S
18
G
13
Posts: 447
Reputation: 10,735

Next

Return to How do I....?

Who is online

Users browsing this forum: JoyfulDreamer, StillSarah and 23 guests