User Tag List

Page 1 of 7 123 ... LastLast
Results 1 to 40 of 261

Thread: JSON Query

  1. #1
    0

    JSON Query

    Hey guys!

    For the past couple of nights, while plowing through the codebase, I've been working on a plugin that allows you to communicate with servers through JSON with pure Blueprint nodes! Since I figured it could be helpful to at least some of you, I'm sharing the complete package!

    - Post to any URL
    - Get JSON data from any URL or string
    - Create your own custom post data with the Create JSON Data node
    - Get and set object/string (array) values in the post data, by key



    Example use


    And the resulting output post data from the example:


    Download link *UPDATED 5/12/2015*:
    http://www.stefander.nl/files/JSONQuery_UE4.7.6.zip(133KB)

    Installation
    Unzip the archive to the Engine/Plugins folder and enable the plugin in the Plugins window in the editor

    Changelist 5/12
    - Added an event broadcaster for when the request fails for any reason (cheers Kheka!)

    Changelist 5/11
    - Compiled with UE4.7.6
    - Added header Content Type "application/json" for mobile/Android support (thanks Zakkar!)
    - Added node for getting all keys from the data (thanks johnbo!)
    - Added a "From String" node, so you can load JSON data from a string, instead of being forced to use URLs (cheers conneich!)

    Changelist 3/25
    - Updated the plugin to UE4.7.3
    - Changed the version number to 0.8
    - Built the plugin with the correct version info so it will actually boot from the launcher build (thanks again Patrik2991! )

    Changelist 3/11
    - Updated the plugin to UE4.7.2

    Changelist 12/14
    - Updated the plugin to the 4.6 release branch

    Changelist 11/23
    - Updated the plugin to UE4.6
    - Updated the plugin version to 0.7
    - Changed the plugin type from Developer to Runtime so it will also run in packaged games
    - Added array support for both string and field data
    - Refactored some of the code
    - Created a proper icon for the plugin
    - Made most of the functions pure, so it doesn't require as many intermediate variables

    Changelist 11/11
    - Updated plugin to UE4.5 (sorry for the delay!)

    Changelist 9/8
    - Updated plugin to UE4.4

    Changelist 8/2
    - Updated plugin to UE4.3

    Changelist 7/5
    - Fixed a bug by prefixing the input URL with http:// when needed (it crashed the editor)
    - Fixed crash when trying to load a URL with invalid JSON data

    *NOTE: If you can't see the JSON category or nodes, be sure to turn off "Context Sensitive"

    If you guys have any comments, feature requests or improvements, please don't hesitate to ask.
    Lastly, I just want to give a shoutout to Rama for being a big help with his tutorials, if you're reading this, cheers buddy, you're awesome!
    Attached Images Attached Images    
    Last edited by eXi; 05-23-2015 at 05:09 PM. Reason: Updated to latest version

  2. #2
    0
    Seems like a great plugin! While I don't have any use for it now, I definitely see potential for the future.

  3. #3
    0
    Oh yeah. That's fantastic. I am so happy with the UE4 community being so generous with their code. This is exactly what I needed to prove a concept Cheers!

  4. #4
    0
    I can definitely see use for this, well done Stefan! netjes

  5. #5
    0
    Correctly I'm doing? - http://i.imgur.com/Pg1d9Yl.png
    It return - void

  6. #6
    0
    Denny: Cheers, thanks for the reply!

    Tom: Cheers bro, your support is greatly appreciated, let me know if you need any help!

    iMuse: Thanks man, graag gedaan!

    ga2mer: Actually, you almost got it! You need to assign the return post data value to a variable and then bind to the event, the Get Data By Key node doesn't do anything until you fill it with data So basically you're missing a few nodes, in order to request on button press, you'll have set it up like this (without any validation):

    Name:  JSONButtonPress.jpg
Views: 17885
Size:  257.9 KB

    Sorry for the confusion, let me know if that helps, I'll add this example to my first post as well!
    Last edited by Stefander; 05-26-2014 at 04:55 PM.

  7. #7
    0
    very sweet plugin! I really can't wait for the marketplace and many of these little plugins are incorporated.

    Its one of those things i would much prefer to prototype in blueprints and then go back and rewrite important things in C++. But even something like this, assuming its not time critical/looping multiple times i wouldn't even rewrite it! (say for just pulling update news or something like that).

  8. #8
    0
    Great job!

    One note though - You shouldn't need the Intermediate directory in your rar. By including the source those libraries and such are generated when building your plugin into a given project.

    Bravo!

  9. #9
    0
    KRushin: Cheers man, if you stumble across any issues be sure to let me know! At my current company we mainly use JSON to communicate with our servers, so I figured it'd make sense to start my Unreal 4 journey with this little plugin!

    Bob: Thanks for the feedback man, I've removed the folder.. Should I add the plugin to the Wiki as well so it's a little more visible to the new users? Not sure what the policy is on that

    I'm planning to integrate nested keys as well in a few days, as well as XML support, to make it a little more flexible!

  10. #10
    0
    Please do. The wiki is open to all contributions, but you should be willing to allow others to modify it =)

    Keep up the good work!

  11. #11
    0
    Samaritan
    Join Date
    Mar 2014
    Posts
    122
    wow all these cool plugins around the forum... saving me a lot of work thanks Stefander

  12. #12
    0
    Bob: No worries, I'd love that! I'll put it up later today, cheers!

    Xces: Glad you like it, it's my very first contribution!

    I'm very grateful for all these kind comments, thanks everyone, I'll be releasing more stuff soon!

  13. #13
    0
    Samaritan
    Join Date
    Mar 2014
    Posts
    122
    one quick question: does it works with JSONArrays ? if yes how ?

  14. #14
    0
    And how safe is it against hacking?

  15. #15
    0
    Will we see this updated for 4.2.1? It says it's not compatible?

  16. #16
    0
    This looks great - i'm pretty rubbish at the visual studio side -I can't get it to recompile for 4.2.1. Would I be able to point this at a local python JSON server rather than an URL? I've been looking for a way to drive Unreal through a UDP or something but I know i won't be able to get my head around the visual studio stuff. If I can send and receive through a local JSON that would probably do what I need it to do. Cheers (could you recompile for us dummies?)

    Dan.

  17. #17
    0
    Quote Originally Posted by Dannington View Post
    Would I be able to point this at a local python JSON server rather than an URL? I've been looking for a way to drive Unreal through a UDP or something but I know i won't be able to get my head around the visual studio stuff.
    Absolutely yes if your local server is a http server And no, if your server is not http server and works with your own protocol. In case of socket server, you should use this approach.
    Developer. Bass player. Cats owner. Unreal Engine addicted. Check my.alyamkin.com
    [Plugin] VaRest - REST API with blueprintable JSON plugin
    [Plugin] VaTexAltas - simple way to use texture atlases for UMG

  18. #18
    0
    I can't get it to work with Unreal Engine 4.2.1… Any help is highly appreciated!

    When I put the plugin in "GameFolder/Plugins/JSONQuery" and I start up my project it says: „Project modules are missing or out of date. Would you like to recompile them?"
    If I click Yes the compilation fails…

    Oh, I'm on Mac OS X, so maybe this is an issue…?!

    When I start my project with 4.1.2 the following error appears:

    "Plugin 'JSONQuery' failed to load because module 'JSONQuery' could not be found. This plugin's functinality will not be available. Please ensure the plugin is properly installes, otherwise consider disabling the plugin for this project."

    Plugin is placed in UnrealEngine/4.1/Engine/Plugins/JSONQuery

  19. #19
    0
    Sorry for the late reply guys, it's been crazy busy!

    @Xces: It doesn't currently, but nice idea, if I have some spare time soon I'll see what I can do! Cheers!
    @orgertot: Well, it does exactly what it says right now, I didn't explicitly check the input and/or strings for any suspicious activity (but I might add it in a future release if there are any real threats)! All it does is expose this functionality to blueprints, which was the original intent of the plugin
    @Darkkitten and thomasaull: The binaries in the OP are compiled for 4.1, but I've just recompiled and overwrote the download link in the original post for 4.2. I'm at the office right now and I don't have the latest engine version, but this one should work fine! But if you guys still have any problems, let me know!
    Also thomasaull, I've provided the binaries for Win64, but not OSX, so you'll need to compile them yourself unfortunately (I don't have a Mac at my disposal)..
    Stefan Wijnker | Senior Game Engineer at Little Chicken Game Company | Stefander.nl
    Happy Happy Joy Joy!
    JSON Query - Interior Mapping - Looping Louie

  20. #20
    0
    Hi Stefander,

    I've tried to use this exactly as you've specified in the 'request page on button' example, but it just crashes the editor. I'm using a local python JSON server which seems to work fine using a python client. Any ideas there?

    Thanks.

  21. #21
    0
    Hey Dannington!

    That's a good question - I've just tried to recreate the example and it seems to work fine, can't get it to crash as long as the URL is valid (including trying to get non-existant keys from the post data).. Does it work with the test URL? Does it display any errors? What version of UE are you using?

    Cheers!
    Stefan Wijnker | Senior Game Engineer at Little Chicken Game Company | Stefander.nl
    Happy Happy Joy Joy!
    JSON Query - Interior Mapping - Looping Louie

  22. #22
    0
    I'll check a bit later - thanks for the plug-in by the way - I hope I can contribute to the forum at some point in the future.

  23. #23
    0
    Hey Stefander, the plugin is working as intended! I do however have one problem. From the Get JSON Request node, I promoted the Return Value to a variable called Request. Then I can't assign it as the target for Bind Event to OnGetResult. What variable type should it be? I get PageData when promoting and no matter what I try, I can't set it as target.

    Do I have to create a special type of Blueprint for this? I used Level Blueprint for testing this.

    Edit*
    I missed that I had to drag out a connection from the variable and choose Assign from context menu. Problem solved. :P

    Edit**
    Now I tried it again in another blueprint and I can't bind the event again. Is there something I am missing?

    Edit***
    Works again after restarting the editor. This is very weird behaviour. Happens with the VaRest plugin as well.

    Edit****
    So finally some results. I can get what hat my character should wear from my local server. Great plugin!



    I did notice a bug though. If you type a URL without http:// you get an editor crash.
    Last edited by Denny; 07-04-2014 at 07:42 PM.

  24. #24
    0
    Hey Denny, cheers, means a lot!

    I just noticed any non-valid URL will cause the editor to crash - I'll look into it as soon as I finish the latest work due for Looping Louie (yay!), hopefully that should be in a few hours! If I find the bug I'll report back here!

    Thanks again and if you run into any other troubles, let me know!

    *EDIT*
    I've just uploaded a new version that should be a lot more stable, turns out it was a stupid error on my behalf, sorry for any troubles the crashes might have caused any of you!
    Last edited by Stefander; 07-05-2014 at 11:12 AM.
    Stefan Wijnker | Senior Game Engineer at Little Chicken Game Company | Stefander.nl
    Happy Happy Joy Joy!
    JSON Query - Interior Mapping - Looping Louie

  25. #25
    0
    Does it work with the 4.3 preview?

  26. #26
    0
    Not sure about 4.3, but if it doesn't, a recompile should fix it
    Stefan Wijnker | Senior Game Engineer at Little Chicken Game Company | Stefander.nl
    Happy Happy Joy Joy!
    JSON Query - Interior Mapping - Looping Louie

  27. #27
    0
    Confirmed, doesn't work with 4.3 because the engine detects it being compiled for an older version.

  28. #28
    0
    Infiltrator
    Join Date
    Mar 2014
    Posts
    14
    Stefander, thanks for this, super thanks. I think it's just what I need for my project. I recently attended a webinar with Cloudant regarding the potential to scale for potentially heavy data requirements should the game we are building take off. While we are busy building assets and game play, we are just starting to investigate data issues. Cloudant works with JSON Data Stores, if I understand your contribution correctly, this is the type of functionality your plugin is offering. I should apologize for this noob question, but hope you'll help anyway. Cloudant has free trial accounts if you could investigate, though I will explore this soon too. Finally, will you be maintaining a freshly compiled version from UE build to build?

  29. #29
    0
    @KillerSneak & @Denny: Cheers guys, updated the zip with x64 binaries for the 4.3 release! Sorry for the delay!
    @jwise: Thanks for your interest man! This plugin doesn't require any specific backend setup, all it needs is a valid URL that returns JSON data! So I'm pretty sure you can make Cloudant work without modifying this plugin
    Stefan Wijnker | Senior Game Engineer at Little Chicken Game Company | Stefander.nl
    Happy Happy Joy Joy!
    JSON Query - Interior Mapping - Looping Louie

  30. #30
    0
    Keep up the good work.

  31. #31
    0
    Hi

    Thank you for your efforts but I can't download it.

    Anybody can help me?

    I got the below message from the URL

    Not Found

    The requested URL /files/JSONQuery.zip was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    Apache Server at www.stefander.nl Port 80

  32. #32
    0
    @ckyun777: I accidentally made a rar instead of a zip, rookie mistake, changed the link, hope that helps!
    Stefan Wijnker | Senior Game Engineer at Little Chicken Game Company | Stefander.nl
    Happy Happy Joy Joy!
    JSON Query - Interior Mapping - Looping Louie

  33. #33
    0
    Samaritan
    Join Date
    Aug 2014
    Posts
    101
    Let me chime in and say that you are an awesome person for making and sharing this for free! This means a lot! As web developer I can setup up a webservice that will let me persist my data! THANKS!!!!!

  34. #34
    0
    Hey Irakli, thanks for the kind comments, the pleasure's all mine! Let me know if you have any issues!
    Stefan Wijnker | Senior Game Engineer at Little Chicken Game Company | Stefander.nl
    Happy Happy Joy Joy!
    JSON Query - Interior Mapping - Looping Louie

  35. #35
    0
    Quote Originally Posted by Stefander View Post
    Hey Irakli, thanks for the kind comments, the pleasure's all mine! Let me know if you have any issues!
    Just to let you know your plugin doesn't seem to work when it get's packaged. No idea why, it just refuses to do anything or I'm running the game wrong but I don't think I am.

  36. #36
    0
    That's a general issue with packaging though, this workaround might work for you, let me know!

    https://answers.unrealengine.com/que...or-plugin.html
    Stefan Wijnker | Senior Game Engineer at Little Chicken Game Company | Stefander.nl
    Happy Happy Joy Joy!
    JSON Query - Interior Mapping - Looping Louie

  37. #37
    0
    Hi!

    Will you get time over to do a recompile for 4.4 on this great plugin?

    //Oscar

  38. #38
    0
    Sorry for the delay - it's been crazy busy!
    Here's are updated binaries for 4.4: http://www.stefander.nl/files/JSONQuery_UE4.4.rar
    Let me know if you have any more issues!
    Stefan Wijnker | Senior Game Engineer at Little Chicken Game Company | Stefander.nl
    Happy Happy Joy Joy!
    JSON Query - Interior Mapping - Looping Louie

  39. #39
    0
    Infiltrator
    Join Date
    Mar 2014
    Posts
    14
    Quote Originally Posted by Stefander View Post
    Sorry for the delay - it's been crazy busy!
    Here's are updated binaries for 4.4: http://www.stefander.nl/files/JSONQuery_UE4.4.rar
    Let me know if you have any more issues!
    It's not working in 4.4.2, I suppose at some point I'm going to have to suck it up and compile my own build but oh how I hate that. I've recently had the same "Module" error where version numbers aren't matching.

  40. #40
    0
    I've compiled the binaries with the 4.4 branch on Github since I thought that was the newest 'mainstream' version (haven't had enough free time to toy around more in the last couple of weeks).. Sorry about that man, I agree it's a bit annoying
    Stefan Wijnker | Senior Game Engineer at Little Chicken Game Company | Stefander.nl
    Happy Happy Joy Joy!
    JSON Query - Interior Mapping - Looping Louie

Page 1 of 7 123 ... LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •