[Engine] Else block not triggered

Bugs will be moved here once resolved.

Post » Sat Aug 09, 2014 4:23 pm

Problem Description
ELSE block not triggered

Attach a Capx
https://drive.google.com/file/d/0B-_hh3 ... sp=sharing

Description of Capx
An 25by25 array is filled with "Entities" as such that :
Array.at(floor(Entities.X/32),floor(Entities.Y/32))==Entities.UID

Steps to Reproduce Bug
  • Run the capx (it is an "Engine" missbehaviour bug)
Code: Select all
Using Canvas 2D renderer
Picked instance at ( 8,4)=1 Browser_plugin.js:580
Number 1 Browser_plugin.js:580
add1 8 Browser_plugin.js:580
Picked instance at ( 9,4)=2 Browser_plugin.js:580
Number 1 Browser_plugin.js:580
add1 9 Browser_plugin.js:580
add1 10 Browser_plugin.js:580
Picked instance at ( 11,4)=3 Browser_plugin.js:580
Number 1 Browser_plugin.js:580
add1 11 Browser_plugin.js:580
add1 12



Observed Result
`"Stop loop at "& PosIndex` is never logged in browser console/



Expected Result
Either one of these must be logged in browser console:
  • "Stop loop at "& PosIndex
  • "Number " & Entities.PickedCount

Affected Browsers
  • Chrome: YES (Version 36.0.1985.125 m)
  • FireFox: YES (Version 31)
  • Internet Explorer: YES(Version '11.0.9600.17207 UV 11.0.10)

Operating System and Service Pack
Win7 Ultimate, Service Pack 1

Construct 2 Version ID
R175(64Bit) built at 17:04:53 Jul 2014
B
18
S
5
G
6
Posts: 17
Reputation: 4,413

Post » Mon Aug 11, 2014 2:30 pm

Closing, I do not see any evidence of a bug in this report. It suggests the event in question is simply never true so the 'Else' block always runs instead. Please post again with much more detail and evidence as to how this is not a mistake in your own events if you really think this is a Construct 2 bug.
Scirra Founder
B
397
S
236
G
88
Posts: 24,423
Reputation: 194,560

Post » Mon Aug 11, 2014 5:52 pm

I modified the ".capx" to introduce an else (at 8) for the "pick instance ..." (at 5) and it seems that "pick instance with" is false when no instance has been picked.

The manual says :

Else
Run if the previous event did not run. Note that this condition does not pick any objects: if it follows an event that picks objects, in the Else event all instances revert to picked again. Else can only follow normal (non-triggered) events. It can also follow another Else event with other conditions to make an "if - else if - else" chain.


Pick by unique ID (UID)
Pick the instance matching a given unique ID (UID) number.


The behavior and those 2 manual entries suggest that the event at position 5 didn't run. I think that a more elaborated writing to explain : "Run if the previous event did not run" for the "ELSE" event or special "events" like "pick by" should have a notice like :

Pick by unique ID (UID)
Pick the instance matching a given unique ID (UID) number.

NOTE : if no instance have been picked, this event is considered as not ran.


As you can see due to confusion, I have an unnecessary check at position 6. Here is the "before"/"after" figuring it out (the 2 versions are what I intended the original capx to do!):

Before:
Image

After:
Image

I think that this example or a simplified variant could be introduced in the manual.
B
18
S
5
G
6
Posts: 17
Reputation: 4,413


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests