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)