Read external data


Do you know what is the best way to read external data in logic nodes ?

(we have that here in Haxe … did you test it on different plateforms ? others solutions too or experiences with different OS/Filesystems ?)


This is a biggie, also if it was possible to read data while the simulation is running in html or c++, that would be huge.


If can help you, this is the best solution I have found for the moment, thanks to @lubos and @Naxela !


Thank you @Didier, this is great, loading/saving data is of great use for some cases I want to use Armory in.


Finally, after several search and try, I am using the following code which is simple.

Here we try to read a json file with a node NN Json Get


The json file, called DT.json to read

“fruits”: [
{ “kiwis”: 3,
“mangues”: 4,
“pommes”: null
{ “panier”: true }
“legumes”: {
“patates”: “amandine”,
“poireaux”: false
“viandes”: [“poisson”,“poulet”,“boeuf”]

**The interesting part of the NNJsonGetNode code **

class NNJsonGetNode extends LogicNode {

	override function run() {
		var value:String = inputs[1].get();
		var adr = "http://localhost:8040/Data/" + value;
		var http = new haxe.Http(adr);
		http.onData = function (data:String) {
			var res:{method:String,fruits:Array<Dynamic>} = haxe.Json.parse(data);
			for (n in res.fruits) {				

			var res1  = haxe.Json.parse(data);
			for (n in Reflect.fields(res1.legumes))
				trace(Reflect.field(res1.legumes, n));

			var res2:{method:String,viandes:Array<Dynamic>} = haxe.Json.parse(data);
			for (n in res2.viandes) {				

		http.onError = function (error) {
		trace('error: $error');


tadaaa, in the console of the firefox browser, the result.

Armory as Web Application - Data Management?