How do I add Array to my instance ?

0 favourites
  • 6 posts
From the Asset Store
Kids Game
$24.50 USD
50% off
New Sounds Added Update: 115 new sound effects added for no additional cost!
  • Hi

    Currently we can only add Boolean, number and text as instance variable. How do I add array as instance variable ? I just want every instance to remember their own arrays of information(based on their own conditions in the game).

    The total number of the instance is dynamic so I cant just create fixed number of arrays for each one of them.

  • As you have a licence, you can use a Container.

    Otherwise just have an 'id' number in both objects , then when picking them always use the id.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • codah

    Thank you for your reply. I understand about container, but in my game I want to add multiple in game information in each instance (based on the instance locations, etc,etc,softcollision with what UID and so on) . Then in the event I want each instance to loop the array and then decide what will happen next. Each instance will also modify,update,delete and so on the array.

    The closest I can see to do this in Construct 2 is store the information in a long formatted text. Then read them back using token and loop it. I was hoping not to do this way since this is going to really to make things too complex.

    Basically I just want each instance to store information in local array so that It can loop it back and decides what to do next, after that it will or maybe clear and reset the array.

  • hm actually Container is limiting except for simple requirements. I don't have time now sorry, but I'm wondering why you can't store some kind of index(es)/ID's/references in your objects and pick the appropriate arrays that way. I normally have a number of global arrays into which I index by some object 'ID'.

  • codah

    I see what you meant by using container now . Sadly Family object cant have container(it would be easier if it can though). Right now I have maybe about 20 unique enemies in the family, I just need to create 20 Arrays put each in container to different enemy and also assigned UID when it is created. This would be soo much easier.

    Thanks!

  • Ok good luck. Yes I'd like to have Family in Container functionality as well.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)