Import global variables from external source

  • Is there anyway for me to import a large group of global or local variables into Construct as a CSV or something? I have an array of 100+ variables and I'd like to use identifiers for my code but still be able to move stuff around easily.

    Example:

    Global variables I want to set below so I can call ItemArray.at(PlayerDamage), PlayerArray.at(PlayerDamage), SpellArray.at(PlayerDamage), etc. If I later want to insert PlayerDefense at 2 and shift everything down.. doing it manually would be quite the pain if they are global variables in Construct vs. very easy in traditional code + copy paste from Excel.

    PlayerDmg 0

    PlayerLife 1

    SlayerEnemyTypeA 2

    SlayerEnemyTypeB 3

    SlayerEnemyTypeC 4

    SlayerEnemyTypeD 5

    SlayerEnemyTypeE 6

    ResistMagicA 7

    ResistMagicB 8

    ResistMagicC 9

    ResistMagicD 10

    ResistMagicE 11

    etc.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It would be better to use a global array or dictionary for this.

  • Global array doesn't seem to help since it's the problem I'm trying to fix. Not familiar with importing from a CSV/JSON to Dictionary, however I found another one of RexRainbow's awesome plugins will fix this here:

    scirra.com/forum/plugin-hash-table_topic47637_page1.html

    JSON formatted import to hash table and then I can call the value at any time!

  • JSON formatted import to hash table and then I can call the value at any time!

    That is pretty much what dictionary does.. :)

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