How do I add multiple keys...

0 favourites
  • 5 posts
From the Asset Store
Piano Keys
$3.99 USD
A musical typing game where the goal is to play a song by pressing the matching keys as fast as you can!
  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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

  • 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)