Hi Being a developer and extremely interested in PA I started to use the free time at hand to dev a suite of tools that help validate the current json files against so called JSON-Schema. So far it is not only telling of the JSON os valid but as well if any given JSON Struct has exactly the attributes and value types that are required. The lib is for javascript and based on node.js. This is stuff that other mod devs can build upon. Test it here Update II New UI Using a specific JSON Editor to help you with JSON outlines Update There is a web tool for weapon.json type files now This will show you the JSON-Schema (Version 4) for weapon http://protected-ravine-6736.herokuapp.com/schema?type=weapon and there is a jsonp service as well. You can use that in any web app http://protected-ravine-6736.herokuapp.com/validate_jsonp?type=weapon&callback=foo&json={} The library, for node.js, can be found at https://github.com/sebs/pa-validate However, I have some questions. Are there any original Informations by uber what the exact specs fo a file are How much are these specs stiull changeing? Does uber has an own lib to validate its .json files? What would mod devs like for a tool? Website, Mac/PC App or just a lib that everyone can use? What would wishes be for this lib? What dataset can I work against? Where do I find that on my mac? Are these JSON Datasets, included with PA in a copyright status so that I can add them to an github repo and use them for testing purposes? HTML: [CODE] var validator = new Validate('weapon'); var res = validator.validate({ "base_spec": "/pa/tools/base_shell_turret/base_shell_turret.json", "ammo_id": "/pa/units/land/tank_light_laser/tank_light_laser_ammo.json", "rate_of_fire": 1, "max_range": 100, "yaw_rate": 90, "pitch_rate": 90, "yaw_range": 180, "pitch_range": 15, "auto_attack": true, "target_layers": ["WL_Air", "WL_Land"] }, function(err, result) { // we dont want a error assert.equal(err, null); assert.equal(result.valid, true); assert.equal(result.errors.length, 0); assert.equal(result.warnings.length, 0); done(); });[/CODE] Feedback / Suggestions very welcome
Glad to have you join the ranks of PA modders! I'm guessing it would be most helpful to have a simple web based version (maybe hosted at our PA mods GitHub repo) and a version that can be easily edited for local use.
I will host the stuff myself. Still getting my head around a quasi-complete set of JSON Schemas. However, its on github already
They're a little bit out of date, but have a look through https://forums.uberent.com/threads/pa-modding-reference-guides-applications-tools.48136/, there's several reference guides for the different json templates in PA.
The basic code is there. The app can say OK/NOK to a given json. It only validates weapon.json. Its a minimal thingie. It needs everything. But the basic setup is there. I will add stuff on a daily basis and hopefully, in beginning of 2014, it will be useful to devs. http://protected-ravine-6736.herokuapp.com/
What I really would like is a simple tool I can run on the PA folder so it processes all json and formats them to be readable.