2

I'm using game maker to develop the game.

In the Graph API Explorer, on facebook, it shows me the map like this (when I call a graph app/scores:

{
  "data": [
    {
      "score": 9, 
      "user": {
        "id": "100001473840881", 
        "name": "Mariano Suppa"
      }
    }, 
    {
      "score": 4, 
      "user": {
        "id": "1299843969", 
        "name": "Francisco Bernardou"
      }
    }, 
    {
      "score": 0, 
      "user": {
        "id": "100004105612351", 
        "name": "Fnatic Fnc"
      }
    }
  ]
}

The "user" key is detected fine, with ds_map_exists(friendMap,"user"). It's okay because exists in the graph explorer, and his name is "user".

But in the graph explorer, it also shows me "score" Score is not a map itself I think, like user (who has id and name keys inside). The problem is the ds_map_exists(friendMap,"score") gives me "false".

So... why doesn´t read "score", but yes "user"?

I also tried reading "score" using ds_map_next(friendMap,currentKey) to go to "score" from "user", but it doesnt read "score".

I don't know how to read the score, I've tried a lot of things but no solutions.

Billal Begueradj
  • 20,717
  • 43
  • 112
  • 130
  • Ive found a similar dicussion here: http://gmc.yoyogames.com/index.php?showtopic=601005#entry4436849. Strange but I think nobody know the solution to it yet – Sahil Mittal Apr 10 '14 at 08:18

1 Answers1

0

I reckon instead of trying to get GameMaker to work you can decode/read the json yourself.

json_decode on yoyoGames Docs

Or you use some other kind of method and read it all in manually, it's a it more work, but it will work in the end, without depending on yoyogames.

All you need is the data in raw text.

Aaron H
  • 134
  • 10