[R200] Containers and Pick by Comparison

Bugs will be moved here once resolved.

Post » Tue Apr 28, 2015 10:14 pm

Problem Description
When attempting to use "Pick by Comparison" on an Array object that's in a container with multiple instances, an error message is returned, but only for one of the instances.

Attach a Capx

dropbox.com/s/0u9q51qiuwev6ng/ContainerTest.capx?dl=0

(Can't attach or do links yet; sorry. Just add the usual https protocol in front of the Dropbox section.)

Description of Capx
A pared-down version of an RPG battle system to show the bug. The "Begin" button in the middle will create the Units and the CharacterSheet array that is a part of their container. Two units are created: the Test_Player_1 unit and the Test_Monster_0 unit. The "TestPlayer" button on the left will simulate the player unit performing an attack. The "TestAI" button on the right will simulate an AI-controlled unit performing an attack. In both cases, the attack will create a waypoint next to the target, the unit will move to the waypoint, perform an attack roll, and then return to its starting position.

Steps to Reproduce Bug
  • Start up the .capx on the Combat Scene - Basic layout.
  • Press the "Begin" button to spawn the Units and start the turn countdown.
  • Press either the "TestPlayer" or "TestAI" buttons. When the turn countdown has finished, it will make the appropriate unit perform an action (the "TestPower1" function in the Powers event sheet), which in this case will make it run up next to an opponent and perform an attack roll.

Observed Result
When the Test_Player_1 unit arrives next to Test_Monster_0, it performs the attack roll and returns to its starting position without incident. When Test_Monster_0 arrives next to Test_Player_1, however, an error message involving not being able to find the correct IID pops up. The function continues normally, however.

I was able to isolate the event that causes this: Event 9 in the Powers event sheet, which is called from Event 3 in the Powers event sheet. This event attempts to pick a CharacterSheet array based on a comparison between a 0-index function parameter and the CharacterSheet's "ParentTag" string variable, which is the same as the "Tag" string variable for its respective Unit object. Disabling this event removes the error message.

Expected Result
Both should produce identical results without an error message.

Affected Browsers
  • Chrome: YES
  • FireFox: YES
  • Internet Explorer: YES

Operating System and Service Pack
Windows 7 Home Premium, Service Pack 1

Construct 2 Version ID
Release 200 (64-bit/Steam)
B
5
Posts: 13
Reputation: 251

Post » Tue Apr 28, 2015 10:23 pm

A brief addendum: I tried altering the Pick by Comparison condition in Event 9 so that it instead picked the TurnPhase object based off of a ParentTag string variable, and it produced no error. I believe that the Array object might be the ultimate culprit.
B
5
Posts: 13
Reputation: 251

Post » Thu Apr 30, 2015 5:03 pm

@Ashely @Ancillary
Here's a simplified capx that produces the error.
https://dl.dropboxusercontent.com/u/542 ... r_bug.capx

To reproduce from scratch:
1. create a new project
2. add another layout
3. in the new layout add a sprite and array, then put them in a container.
4. In the first layout add two events:
every tick: create sprite at (0,0)
system->pick by comparison Array 0=0
5. run layout for error.
B
94
S
33
G
118
Posts: 5,392
Reputation: 75,845

Post » Thu Apr 30, 2015 7:06 pm

@Ancillary
Image
B
20
S
4
Posts: 382
Reputation: 2,994

Post » Thu Apr 30, 2015 7:06 pm

Thank you both for addressing this.
Image
B
20
S
4
Posts: 382
Reputation: 2,994

Post » Thu May 14, 2015 1:24 pm

Thanks, should be fixed in the next beta.
Scirra Founder
B
402
S
238
G
89
Posts: 24,629
Reputation: 196,025


Return to Closed bugs

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest