'System - Object Overlaps Point' command bug

Post your own tutorials, guides and demos.

Post » Tue Feb 02, 2010 1:31 pm

I just encountered an issue using the 'Object Overlaps Point' command where it seems to only detect an overlap with only one instance of a sprite instead of all. I replicated the bug and posted the cap where I explain it in more detail. I'm pretty adamant the command isn't working as intended, but I may be overlooking something very simple and approaching it incorrectly.

I'll also upload it to the bug tracker shortly.
B
2
S
2
G
3
Posts: 143
Reputation: 1,536

Post » Tue Feb 02, 2010 7:15 pm

It's not a bug... at least not the bug you think it is. The system command doesn't pick individual instances. Look up the "expression rule" here:

http://sourceforge.net/apps/mediawiki/c ... ct_picking

Since you're not picking a specific instance, Construct picks the first instance in the layout, that's why it's only reacting to one of them. You can guarantee that it will check each in turn with a loop, like so:



A For Each loop here will cycle through each instance one at a time so they can be picked by the system condition.


But... there does seem to be a seems to be a minor bug with how the condition is displayed. Instead of showing pointx and pointy, it's showing object and pointx.

As for the Else, it's working properly, but since the order of events in your example allows for changing the text to "no collision" after it's already been changed to "yes collision" then if you're overlapping one the next For Each loop can say "this one's not colliding, change the text to blue and say it's not colliding." You can confirm that by the fact that if you leave the Else in then it works properly only if you are overlapping the point of the last instance instead of the first. This fixes the issue:



Order of events! It's important! It might seem confusing at first but you'll get the hang of it.

Hope this helps :)
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Feb 02, 2010 7:34 pm

Added a comment to your bug report...
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Feb 02, 2010 11:38 pm

Thank you! It worked wonderfully :)
B
2
S
2
G
3
Posts: 143
Reputation: 1,536


Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 0 guests