Query

Hello guys,

I have a question regarding the Plugin. I am trying to use the plugin to get the weather information from Yahoo (https://developer.yahoo.com/weather/) and it works, sort of. This is what I got so far.

And what this gives me is a string containing everything after the key “query” (as you can se in the link to Yahoo it is in the very beginning of the response).

What I am wondering is then the following: Is there a way to get just get the “forecase” array, or just the “atmosphere” information?

Using UE 4.14.

Thanks.

Edit: Got it working by adding additional “Get object field” with the the nested keys.

This works great in editor but crashes immediatly with packaged project in 4.15
Tested it with a clean FPS Template project and the Bind event to OnGetResult and the OnGetResultEvent made it crash, if i disconnected them it worked, but then you cant really do anything.

Is it possible you could fix this? I’ve spent like 60 hours making a good highscore system around this in 4.15 and are kind of stuck :confused:

Instead of just trying to fix that problem, I’ll also update the plugin to 4.15/16 standards (IWYU). But I can only do that on Sunday.

Did this ever happen? :slight_smile:

I would also love to see this happen, this plugin provides some really great functionality,.

I’m really sorry, guys! I had no time on that weekend and then I just forgot about it :frowning:
Gonna do it this weekend. This time I know I can keep my word. Also, I’ll have to use it this next week so I’ll update it anyways. xD

UPDATE to 4.16

[FONT=Arial Black]UPDATE! v1.0.0
With compatibility for UE 4.16.2

Thanks for the patience, guys! I’ve created a repo on GitHub of my own so I can keep the updates there and also accept pull requests, since stefander, the original creator, don’t seem to be following the thread anymore nor updating the plugin.

Repo on GitHub](GitHub - RVillani/UnrealJSONQuery: Adds nodes for Blueprint communication with servers using JSON.) with instructions.
Binaries for UE 4.16.2](https://github.com/RVillani/UnrealJSONQuery/releases/download/v1.0.0/JSONQuery_1.0.0_UE4.16.zip) and a Samples folder with PHP and Blueprint examples.

@nameLive I had a crash, like you, but even in the editor. It had to do with not saving the created object to a variable and still using it with events. I’ve corrected the problem and it works with or without promoting it to a variable. It’s also working on packaged build. Let me know if you have more issues.

@RVillani
Can you make a version compatibility for Unreal Engine 4.15?
I am still developing my game with Unreal Engine 4.15 :smiley: i really need it :smiley: thank you :smiley:

@WindyStrife I don’t have 4.15 in my system anymore. You should try compiling it. Download the binaries zip, copy it to the Plugins folder, delete the Binaries and Intermediate folders in the plugin’s directory and launch your project. If you have VisualStudio installed, the Engine will ask you to compile it and that’s it.

@RVillani:
i got this error
“Running D:/UnrealEngine-415_NVDIA_Tech/Engine/Binaries/DotNET/UnrealBuildTool.exe -projectfiles -project=“H:/_Unreal Projects/MyProject/MyProject.uproject” -game -engine -progress
Discovering modules, targets and source code for project…
Messages while compiling H:_Unreal Projects\MyProject\Intermediate\Build\BuildRules\MyProjectModuleRules.dll:
h:_Unreal Projects\MyProject\Plugins\JSONQuery\Source\JSONQuery\JSONQuery.Build.cs(6,48) : error CS1729: ‘UnrealBuildTool.ModuleRules’ does not contain a constructor that takes 1 arguments
UnrealBuildTool Exception: ERROR: UnrealBuildTool encountered an error while compiling source files”

@WindyStrife Open the file JSONQuery/Source/JSONQuery/JSONQuery.Build.cs in a text editor and replace line 6:


public JSONQuery(ReadOnlyTargetRules Rules) : base(Rules) 

with:


public JSONQuery(TargetInfo Target) 

Thank you it works :smiley: :smiley:

I’m having trouble with the Get Request node that only takes a URL. I have a string that gets built and leads to a URL that is a string, but I can never get anything back from the URL when it sends the data.

The resulting data from the URL looks like this (formatted here):

Array
(
[success] => 1
[location] => Array
(
[title] => ************
[latitude] => ************
[longitude] => ************
[spins] => Array
(
[0] => Array
(
[spin] => https://www..com/t/***.jpg
[version] => *************
[date] => 10/04/2014
[start_pan] => 4
[start_tilt] => -3
[pan_north] => 248
[hotspots] => Array
(
[2145] => Array
(
[pan] => -56.53620
[tilt] => 10.50470
[dest] => 20001 (The URL being requested is always the same, aside from the dest at the end, which changes with the requests)
)

And so on. There can be multiple spins in the result, and multiple hotspots in each spin. Using VARest, I can use the data from this URL with no problem, but I can’t get a result from the Query that I can use.

I hope this explanation isn’t confusing, I have never used before, aside from this project.

@anonymous_user_8fd882bf That’s not valid . The syntax is all wrong. JSON Syntax

whoops, I completely didn’t notice that. That’s the version that’s formatted to be readable.

THIS is what it actually looks like

Do I need to use things like Get String Field to target every section of the ?

@anonymous_user_8fd882bf it makes more sense now XD
Yes, you’ll have to get the data using the GetX nodes. For the objects (sub structures enclosed in {}) use GetObjectField (I think that’s the name). You also have those nodes in array version, so you can do ForEach etc. Also, these nodes have a boolean. I highly recommend checking if it’s true, and if it’s not, you’ll know the data is not what you expected. Also, keep the Ouput Log window open. It displays what you’re sending. It also displays received , but only if there’s an error interpreting the response from the server. The class also has a JSONToString node to print the whole .

Hello im trying to get an array of Servers from my node.js master server. Here is my blueprint code



This is the error

I have tried using varest plugin also. It seems to not notice that “ServerConfig” is indeed an array.

@vejay24 There are two problems there:

  • Look at the order of the errors: first, it did not find the field and THEN it said the data is invalid. It means you tried to get the field BEFORE you got the answer from the server. After using GetJSONRequest, from its return value call Bind Event to OnGetResult. After that event is called you can search the fields in the from the server.
  • As it says on the second error, the from the server is invalid. I see it’s actually valid , but Unreal won’t accept JSONs from which ROOT is an array, like yours. So you’ll have to make this array a field from some root object.

Actually it’s an array INSIDE an object that’s INSIDE an unnamed array. You have to get to it’s level by getting the objects that contain it, but since the root array is unnamed you won’t be able to even find it.

So, instead of having




    {
        "id" : 1,
        "ServerConfig" : ]
    },
    {
        "id" : 1,
        "ServerConfig" : ]
    }
]


You’ll need something like this



{
    "data" : 
        {
            "id" : 1,
            "ServerConfig" : ]
        },
        {
            "id" : 1,
            "ServerConfig" : ]
        }
    ]
}


And then it’ll be valid for Unreal and you can get the array using GetObjectArrayField(data) and, for each element, use GetObjectArrayField(ServerConfig)

Binaries for 4.17: download

Dont work in 4.17, after Get request Field is empty.