System action "Add Attribute" not working

For questions about using Classic.

Post » Thu Nov 08, 2012 1:05 am

This problem cropped up pretty randomly as it seemed to be working fine before. I have a series of objects that under certain conditions have the "Platform" attribute added to a specific instance. However, now suddenly the "Add Attribute" only seems to be adding the attribute to the object I added to the layout most recently, rather than the one matching the condition under which the action occurs.

Any ideas? I can't use alternate methods, as the object simply must have the platform attribute under the condition.

Thanks.
B
4
Posts: 20
Reputation: 340

Post » Fri Nov 09, 2012 4:29 pm

Ok so a very bizarre discovery. At the layout start, I did a "For Each" loop for that object and changed its animation based on a private variable. This caused the Add Attribute to fail when used at any point in the game (and only applied it to the most recent instance of the object). However, if I avoided that loop at start up, it worked fine! Similarly, adding a "For Each" loop for that object at any other point of the game would cause it to break the Add Attribute also.

As a workaround, I decided not to use the "For Each" loop but instead assigned a unique sequential ID to each instance of the object at design time, then used a normal For loop and assigned the animation at startup based on ID. Oddly enough, this did not break the Add Attribute function.

Hopefully this will help anyone else facing this problem. And unless I'm missing something, looks like a fundamental bug somewhere in CC.djsubtronic2012-11-09 16:30:45
B
4
Posts: 20
Reputation: 340


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests