Common Action Destroy - Destroys All Instances At Once

Bugs will be moved here once resolved.

Post » Sat May 03, 2014 7:55 am

Problem Description

When not using a System For Each Loop to iterate over the Instances of an Object Type, the Common Action Destroy will destroy all of the Object Type's Instances in the SOL of an Event. This is in contrast to the notion that one Instance of the Object Type should be destroyed at a time when the Action List of the Event runs against each Instance of the Object Type. Because this is not the case, Actions that perform before the Common Action Destroy in the Action List are only performed for the first Object Type Instance in the SOL before all of the Instances get destroyed.

In contrast, if a System For Each Loop is used instead, the Common Action Destroy in the Sub-Event will only destroy the currently picked Instance of the Object Type in the loop. This allows for the Actions performed before the Common Destroy Action in the Action List to occur for every Instance of the Object Type not just the first Object Type Instance in the SOL.

Attach a Capx

____ Upload a Capx to this post ____

Description of Capx

Should append the Text Property values of all Instances of Text Object Type to the Text Property of the one Instance of the Text2 Object Type upon
clicking one of the two Button Object Type Instances.

Steps to Reproduce Bug

  • 1)Click on Button with the Text : 'Save Deleted Text Doesn't Work'
  • 2)Refresh Browser
  • 3)Click on Button with the Text: 'Save Deleted Text Does Work'

Observed Result

Performing Step 1) only appends:
Text 1

Performing Step 3) after Step 2) appends:
Text1
Text2
Text3

Expected Result

Both Step 1) or Step 3) should result in the following text appended:
Text1
Text2
Text3

Affected Browsers

  • Chrome: YES
  • FireFox: YES
  • Internet Explorer: YES

Operating System and Service Pack

Windows 8 Pro 64-bit(6.2, Build 9200)

Construct 2 Version ID

Release 168(64-bit)
You do not have the required permissions to view the files attached to this post.
B
9
S
2
G
1
Posts: 41
Reputation: 708

Post » Sat May 03, 2014 10:29 am

This is absolutely normal. Because, without for-each statement you cannot access "Text" object's instances one by one. When you do that -> Text2.Append(Text.Text & newline), C2 will pickup the first instance of the "Text" object (will not itarate through the all instances automagically because you didn't say that to C2) and when you do that -> Text.Destroy(), you say to C2, please destroy all "Text" object's instances (Because, C2 will pickup all "Text" object instances automatically).
B
11
S
2
G
1
Posts: 25
Reputation: 1,685

Post » Sat May 03, 2014 6:06 pm

Hmm... I was probably misinterpreting the Manual's specification of 'Destroy': Remove the object from the game. I thought that meant the Instance that the Action List of the Event is running against. However, it must refer to the Instances of that Object Type in the Selected Object List. I think it would be good if the Manual was amended to have a more clear and non-ambiguous specification of the 'Destroy' Action. Thanks for your help @onurdogan07 !
B
9
S
2
G
1
Posts: 41
Reputation: 708

Post » Mon May 05, 2014 7:52 am

509Dave16 wrote:Hmm... I was probably misinterpreting the Manual's specification of 'Destroy': Remove the object from the game. I thought that meant the Instance that the Action List of the Event is running against. However, it must refer to the Instances of that Object Type in the Selected Object List. I think it would be good if the Manual was amended to have a more clear and non-ambiguous specification of the 'Destroy' Action. Thanks for your help @onurdogan07 !


Welcome, i am happy to help you.
B
11
S
2
G
1
Posts: 25
Reputation: 1,685

Post » Mon May 05, 2014 11:41 am

onurdogan07 wrote:Because, without for-each statement you cannot access "Text" object's instances one by one. .


you can use numerous references to pick out any one instance, you can use self determined variables or refer to UIDs.

event
Pick by evaluating textobject.UID = YourDesiredID
action
destroy textobject
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Thu May 08, 2014 2:53 pm

Closing, the .capx is working correctly. Your "expected result" is what's wrong!
Scirra Founder
B
398
S
236
G
88
Posts: 24,428
Reputation: 194,600


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest