I do not understand this

Discussion and feedback on Construct 2

Post » Mon Jul 24, 2017 7:27 pm

Hello here something strange happens, can anyone explain?
In the project there are two tilemap objects, only one of them has the variable "var" with value 1.
If the other tilemap object is deleted, then it works.

It's no use uncommenting the second "pick" just after "every 0.1 seconds"

Image

https://www.dropbox.com/s/rdzewts23g750o8/testTilemap.capx?dl=0
B
31
S
13
G
21
Posts: 844
Reputation: 14,695

Post » Tue Jul 25, 2017 4:37 am

@The Mnk there's only one actual tile map object, and two instances of it. Therefore both have the variable.


(view image to see full size)

Image
Construct Classic - Examples Kit Dropbox is a pile of trash and if you need my old files PM me! :)
B
127
S
43
G
18
Posts: 2,240
Reputation: 20,592

Post » Tue Jul 25, 2017 7:37 am

The variable is 1 in one object, in the other object it is 0. In the object that collides it is 1 so I do not understand why the collision does not occur.

If you remove the "x > 500" and "x < 0" conditions then it works correctly.
The problem is the block "OR", there is a failed there.
If you disable the "x > 500" and "x < 0" conditions, it will not work, you need to delete them.
B
31
S
13
G
21
Posts: 844
Reputation: 14,695

Post » Tue Jul 25, 2017 11:07 am

I don't think Pick works that way. If you change your Pick statement to check if the Tilemap's "var" = 1, it works.

Image


A simpler way at it, if it's useful.

Image
B
21
S
5
G
3
Posts: 68
Reputation: 2,852

Post » Tue Jul 25, 2017 5:14 pm

I understand, thank you, although there is still something strange about the OR block in my example.
B
31
S
13
G
21
Posts: 844
Reputation: 14,695

Post » Tue Jul 25, 2017 6:26 pm

I'm not sure if you are aware, but the 'every tick' condition is redundant and have no effect in there.

Like brushfe, I would use a compare variable on the Tilemap to pick it and that seems to work fine.

I would expect the system's pick by comparison to work though, but strangely it doesn't. I manage to make it work by replacing the 'every tick' with a 'for each Tilemap' (which I think shouldn't be necessary). Maybe it's worth reporting as a bug.
Scirra Employee
B
159
S
55
G
17
Posts: 711
Reputation: 18,177

Post » Tue Jul 25, 2017 9:06 pm

If someone wants to report the error feel free to use my example capx file and my image.
B
31
S
13
G
21
Posts: 844
Reputation: 14,695


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 14 guests