I started this thread in the Construct 2 General Discussion board, but I think the problem may be specific to Construct 3 so I'm recreating it here.
I was trying to learn about the Dictionary object the other day and I created a simple test:
1. I started a new project
2. I added a dictionary object, AJAX, a button, and a text object.
3. I right clicked on "Files" and picked New --> Dictionary
4. I made size = 4 and I created four sample keys:
"Name" = "John"
"Age" = 56
"last_played" = 0
"puzzles_lost" = 0
Then I created a few events that looked like this:
To my surprise, clicking the button on my layout did NOT change my text string to "John" as I expected. It changed to "0". When I looked at the debug panel the dictionary appeared to have the correct information, though when I looked at the string for AJAX.LastData it looked like this:
{
"c2dictionary": true,
"data": {
"\"Name\"": "\"John\"",
"\"Age\"": 32,
"\"last_played\"": 0,
"\"puzzles_lost\"": 0
}
}[/code:1b28gtnl]
Are the back slashes normal? I didn't edit the JSON data, I just had C3 make it for me...
As a test I added some keys to my dictionary object using "Add Key" and everything worked as intended.
[img="http://i68.tinypic.com/2s1m2rq.jpg"]
I'm stumped. Is this a bug in Construct 3? Or is it, [b][i]once again[/i][/b], something stupid I'm doing wrong?
Here's my .c3p file:
[url]https://ufile.io/hk7a1[/url]