Dictionary help

Not favoritedFavorited Favorited 1 favourites
  • 5 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • is there a decent tutorial that just goes over all of the functions and actions you can use a dictionary for?

    ive been trying to use the dictionary object in order to keep a list of items for shops in my game but i'm stumped on how to use the dictionary tool for this.

    i figured out how to set it up and load it into the game, but i'm trying to have each item in the shops connect to an ID so that i can just reference the ID as the key and set the value as the name of the item but im not sure how to do that

  • Have you looked at the example browser in C3? You can search Dictionary in that. Not sure if those help.

    I'm not sure what approach you're wanting for the shop. What you want to look like.

    Because you could also use Arrays for this kind of thing.

    It may be helpful to use the array/dictionary editor, then load that file into your object with Ajax plugin. If you're not doing that already. So that you can have a list of all your items data.

    Like, what kind of ID do you want? You could use numbers or words.

    And what values do you want attached to the items?

    If you're just wanting an ID as a number, and then the value of the id being the name. Then you could just use an array.

    e.g. 0 = sword, 1 = shield, 2 = helmet

    Then if you're looking to have text to set the name of an item. Then you could have an action that "set text" to: array.at(1), which would show the name "shield"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I made a data container object that you could use.

    construct.net/en/make-games/addons/1513/data-container/documentation

  • Oh! thats really cool i'll have to mess around with that, thank you!

  • Have you looked at the example browser in C3? You can search Dictionary in that. Not sure if those help.

    I'm not sure what approach you're wanting for the shop. What you want to look like.

    Because you could also use Arrays for this kind of thing.

    It may be helpful to use the array/dictionary editor, then load that file into your object with Ajax plugin. If you're not doing that already. So that you can have a list of all your items data.

    Like, what kind of ID do you want? You could use numbers or words.

    And what values do you want attached to the items?

    If you're just wanting an ID as a number, and then the value of the id being the name. Then you could just use an array.

    e.g. 0 = sword, 1 = shield, 2 = helmet

    Then if you're looking to have text to set the name of an item. Then you could have an action that "set text" to: array.at(1), which would show the name "shield"

    yeah, i ended up using an array to do what i wanted with the ID- Item name system.

    i just wanted to try and look for a tutorial that actually explained and gave examples on how the dictionary was supposed to function, and i did look through the official tutorials on the C3 manual but nothing really gave me what i wanted, i wanted to use a pre-loaded dictionary and have it reference the key and set text based on the value at the key but i couldn't get it to function in a way that didn't reference each key individually. when i tried to use 'for each key' it only used the last key every time.

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