0 Favourites

Create and Destroy Array Instances with Containers

  • Howdy folks!

    I'm having some trouble with using arrays with containers.

    Here's what the manual states:

    "It's possible to add data storage objects like Array and Dictionary to a container with another object. Despite the fact these objects are invisible, a separate instance of the object is still created for each container. This allows you to have a dedicated Array or Dictionary for each instance of an object. This can be very useful as an advanced substitute for instance variables, such as if a very large number of variables is necessary, or if variables need to be dynamically added and removed."

    But I've found this to be untrue. When I add an Array to a container, it doesn't automatically instantiate/destroy new copies of that array when the container object is created/destroyed.

    Has anyone else found issues with this?

    Thanks,

    Sam

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Here's an example .capx to demonstrate what I'm talking about.

    ArrayCreationTest.capx

    In this demo, every time the player clicks, they should see the text "Created Array"

    But the arrays aren't being created for some reason...

    Help please?

  • Here's an example .capx to demonstrate what I'm talking about.

    ArrayCreationTest.capx

    In this demo, every time the player clicks, they should see the text "Created Array"

    But the arrays aren't being created for some reason...

    Help please?

    I tested your .capx, they arrays are being created due to total count of arrays.

    It seems array on container doesn't work, maybe it's a bug or design. Why would have more than one array for each sprite?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
0 Favourites
[Plugin] instance bank2
85 18,374
rexrainbow's avatar
rexrainbow
Unread hot topic
0 Favourites
[PLUGIN] Instance Group
50 17,112
sagispin's avatar
sagispin
Unread hot topic
47 11,343
Rable's avatar
Rable