Actors overwrite their lists. A bug in Stencyl?

5lider

  • Posts: 38
I've got a problem. In one behavior I want to change list's items (this is not global list). For some reason every single actor updates that list in every actor of his actor type. It seems like they all have the same list. Other type of actor (which is the clone of first one) has other list but it's the same to all of them.
I thought bug is the effect of predictible behavior, but it's not.
I did a test - even if actor B can't do instructions (simply - he don't do them) to change his list, actor A (the same actor type as B) will change his list beacuse of doing instructions for this particular behavior.
Pretty strange beacuse when I had created another list for testing, which was adding random items every second, actors of the same type didn't have the same items.

« Last Edit: May 31, 2012, 11:41:55 am by 5lider »

MrDumle

  • Posts: 116
I think I have the same issue..
If I change actor A's list a completely unrelated list of actor B changes too.
I have no idea how to tackle this

rob1221

  • *
  • Posts: 9473
It sounds like a toolset problem.  Can you make a precise list of steps to reproduce it?

MrDumle

  • Posts: 116
It's hard to describe but what I did was:
From Actor A's behavior: create an actor B with a list attribute in its behavior.
Then right after set "List X" in B to be equal to "List Y"  in A.
From then on, any changes in List Y seemed to affect List X like if they were the same list. Which they were not!

This is the wierdest bug I've encountered in Stencyl , but luckily I found a work-around:
By using "copy of list" when creating an equal list, the wierd link between the lists didn't appear.

rob1221

  • *
  • Posts: 9473
That's not a bug.  Setting a list to another list just makes a reference to that list.  Changing the list through either attribute will change the list for both as they are both referencing the same list.  Using the copy block solves the problem as you discovered.