How do I set variablea ccording to variables?

0 favourites
  • 3 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • It sounds strange, like a Russian doll, but it really needs this feature.

    E.g. I have several similar variables:

    variables 1 = 0 variables 2 = 0 variables 3 = 0 variables 4 = 0 .... variables N = 0

    They all have similar patterns, maybe the pattern behind is not exactly a number or a certain word combination.

    If use the event to modify the variables like make all variables +1 or -1, it seems that there is no way to pass parameters through a Function. I have to Set Value one by one. There are as many variables as I need to operate.

  • I suggest you use a dictionary instead of variables. With dictionary you can address each key by name, for example "Key"&number, loop through all keys, delete/add etc. It gives you a lot more flexibility.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I suggest you use a dictionary instead of variables. With dictionary you can address each key by name, for example "Key"&number, loop through all keys, delete/add etc. It gives you a lot more flexibility.

    Thanks! Then I tried using a dictionary to store my variables. It works well!

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