How do I add multiple keys...

  • How can I add multiple keys in a single line with the dictionary object?

    It works fine if i have separate lines of code like in the sample but is there a way to add new entries on a single line?

    ie.. (Inventory ---- add key "coin,wood,mobdrop" with value 0)

  • How can I add multiple keys in a single line with the dictionary object?

    It works fine if i have separate lines of code like in the sample but is there a way to add new entries on a single line?

    ie.. (Inventory ---- add key "coin,wood,mobdrop" with value 0)

    I don't think that it's possible. At first i want to say that you can possibly use "Add key" > ("wood" & "coin" & "mobdrop"), because nothing except "&" can be used in strings, but then i try that on my own and it doesn't work, the string like that just adds a key "woodcoinmoney", that's how "&" works.

  • I guess you could that with a function.

    Both of these functions work, use the one that suits you most !

    You could even add another parameter to set a specific value to those keys, instead of the default 0.

  • I guess you could that with a function.

    Both of these functions work, use the one that suits you most !

    You could even add another parameter to set a specific value to those keys, instead of the default 0.

    Now i really believe that construct 2 can make everything, that's clear magic

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Magistross The first method you described worked perfectly for me. Thank you.

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