Struct to JSON

Hi there!

I have created a little dialogue tool for a RPG project inside a Editor Utility Widget, so my designers can create content directly inside Unreal with a cool interface (better than in Google Sheets :stuck_out_tongue: ).

I store all dialogues information inside a struct, and I read that you can convert a struct to a json file, then convert this json file into a data table.

I donā€™t understand how to do it in blueprint.

I have tried this, but the ā€œConvert struct to json stringā€ always returns ā€œfalseā€.

Am I even doing things right? x)


In short: I have a struct, I want to convert it into a file (JSON / CSV / other).

Then, I want to import this file in UE to update a data table, like I would do it for a .csv.


Thanks for your help! :smiley:

edit: well, it seems to work only if the struct is not an array. Any idea :eyes: ?

You need to build the thing out with C++ and JSON parsing if you want it to work right with complex jason objects.

Its not difficult, get a lib like newJsoft to do the lifting, create a class that matches the json struct, parse the data into the class, make the node that does the parsing and returns the class values avaliable as a blueprint scriptable node.

Then your team can build any jstruct you like, the output of it is always going to be within the pre-set class type.

Ocf, if you create a custom class and have your team set the variables of that class instead you get a somewhat similar result.
An array of class entities would do pretty much what you are afterā€¦

Hi, I have managed to do what I wanted without using the json :smiley:

Iā€™m kind of formatting a json at runtime, then using the node ā€œfill data table with json stringā€ to automatically update my data table!

Thanks for your help anyway :smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.