Browse Source

Schemas rearranged

Artifact Schema rearranged


Battlefield schema rearanged


Bonus schema rearranged


Faction Schema rearanged


Hero Schema rearranged


HeroClass schema rearranged


MapHeader schema updated, something fishy in events


Mod schema updated. Settings not complete


Object schema rearranged


Object schema rearranged


object type schema rearranged


obstacles schema rearranged


Rivers schema updated


roads schema updated


script schema updated


skill schema updated


spell schema updated


template schema update


terrain schemas updated


town buildings schema update


town siege schema updated


town structure schema updated
krs 2 years ago
parent
commit
2e6cae80a9

+ 78 - 81
config/schemas/artifact.json

@@ -1,10 +1,9 @@
 {
-	"type":"object",
-	"$schema": "http://json-schema.org/draft-04/schema",
+	"type" : "object",
+	"$schema" : "http://json-schema.org/draft-04/schema",
 	"title" : "VCMI artifact format",
 	"description" : "Format used to define new artifacts in VCMI",
-	"required" : [ "class", "text", "type", "value" ],
-
+	"required" : [ "type", "class", "value", "text" ],
 	"definitions" : {
 		"growingBonusList" : {
 			"type" : "array",
@@ -20,50 +19,52 @@
 			}
 		}
 	},
-
 	"additionalProperties" : false,
-	"properties":{
-		"bonuses": {
-			"type":"array",
-			"description": "Bonuses provided by this artifact using bonus system",
-			"items": { "$ref" : "bonus.json" }
+	"properties" : {
+		"warMachine" :
+		{
+			"type" : "string",
+			"description" : "Creature id to use on battle field. If set, this artifact is war machine"
+		},
+		"type" : {
+			"type" : "array",
+			"description" : "Type of this artifact - creature, hero or commander",
+			"items" : {
+				"type" : "string",
+				"enum" : [ "HERO", "CREATURE", "COMMANDER" ]
+			}
+		},
+		"slot" : {
+			"description" : "Slot to which this artifact can be put, if applicable",
+			"oneOf" : [
+				{
+					"type" : "string"
+				},
+				{
+					"type" : "array",
+					"minItems" : 1,
+					"additionalItems" : { "type" : "string" }
+				}
+			]
 		},
-		"class": {
-			"type":"string",
+		"class" : {
+			"type" : "string",
 			"enum" : [ "SPECIAL", "TREASURE", "MINOR", "MAJOR", "RELIC" ],
-			"description": "Artifact class, treasure, minor, major or relic"
+			"description" : "Artifact class, treasure, minor, major or relic"
 		},
-		"index" : {
+		"value" : {
 			"type" : "number",
-			"description" : "Private field to break things, do not use."
+			"description" : "Cost of this artifact, in gold"
 		},
-		"components": {
-			"type":"array",
-			"description": "Optional, list of components for combinational artifacts",
-			"items": { "type":"string" }
+		"components" : {
+			"type" : "array",
+			"description" : "Optional, list of components for combinational artifacts",
+			"items" : { "type" : "string" }
 		},
-		"graphics": {
-			"type":"object",
-			"additionalProperties" : false,
-			"description": "Graphical files associated with the artifact",
-			"required" : [ "image", "map" ],
-			"properties":{
-				"image": {
-					"type":"string",
-					"description": "Base image for this artifact, used for example in hero screen",
-					"format" : "imageFile"
-				},
-				"large": {
-					"type":"string",
-					"description": "Large image, used for drag-and-drop and popup messages",
-					"format" : "imageFile"
-				},
-				"map": {
-					"type":"string",
-					"description": ".def file for adventure map",
-					"format" : "defFile"
-				}
-			}
+		"bonuses" : {
+			"type" : "array",
+			"description" : "Bonuses provided by this artifact using bonus system",
+			"items" : { "$ref" : "bonus.json" }
 		},
 		"growing" : {
 			"type" : "object",
@@ -73,56 +74,52 @@
 				"thresholdBonuses" : { "$ref" : "#/definitions/growingBonusList"}
 			}
 		},
-		"slot": {
-			"description": "Slot to which this artifact can be put, if applicable",
-			"oneOf" : [
-				{
-					"type":"string"
+		"graphics" : {
+			"type" : "object",
+			"additionalProperties" : false,
+			"description" : "Graphical files associated with the artifact",
+			"required" : [ "image", "map" ],
+			"properties" : {
+				"image" : {
+					"type" : "string",
+					"description" : "Base image for this artifact, used for example in hero screen",
+					"format" : "imageFile"
 				},
-				{
-					"type" : "array",
-					"minItems" : 1,
-					"additionalItems" : { "type" : "string" }
+				"large" : {
+					"type" : "string",
+					"description" : "Large image, used for drag-and-drop and popup messages",
+					"format" : "imageFile"
+				},
+				"map" : {
+					"type" : "string",
+					"description" : ".def file for adventure map",
+					"format" : "defFile"
 				}
-			]
+			}
 		},
-		"text": {
-			"type":"object",
+		"text" : {
+			"type" : "object",
 			"additionalProperties" : false,
-			"description": "Texts associated with artifact",
+			"description" : "Texts associated with artifact",
 			"required" : [ "description", "event", "name" ],
-			"properties":{
-				"description": {
-					"type":"string",
-					"description": "Long description of this artifact"
+			"properties" : {
+				"name" : {
+					"type" : "string",
+					"description" : "Name of the artifact"
 				},
-				"event": {
-					"type":"string",
-					"description": "Text that visible on picking this artifact on map"
+				"description" : {
+					"type" : "string",
+					"description" : "Long description of this artifact"
 				},
-				"name": {
-					"type":"string",
-					"description": "Name of the artifact"
+				"event" : {
+					"type" : "string",
+					"description" : "Text that visible on picking this artifact on map"
 				}
 			}
 		},
-		"type": {
-			"type":"array",
-			"description": "Type of this artifact - creature, hero or commander",
-			"items": {
-				"type":"string",
-				"enum" : [ "HERO", "CREATURE", "COMMANDER" ]
-			}
-		},
-		"value": {
-			"type":"number",
-			"description": "Cost of this artifact, in gold"
-		},
-		"warMachine":
-		{
-			"type":"string",
-			"description": "Creature id to use on battle field. If set, this artifact is war machine"
+		"index" : {
+			"type" : "number",
+			"description" : "Private field to break things, do not use."
 		}
-
 	}
 }

+ 17 - 18
config/schemas/battlefield.json

@@ -1,35 +1,34 @@
 {
-	"type":"object",
-	"$schema": "http://json-schema.org/draft-04/schema",
+	"type" : "object",
+	"$schema" : "http://json-schema.org/draft-04/schema",
 	"title" : "VCMI battlefield format",
 	"description" : "Format used to define new battlefields in VCMI",
 	"required" : [ "graphics" ],
 
 	"additionalProperties" : false,
-	"properties":{
-		"bonuses": {
-			"type":"array",
-			"description": "Bonuses provided by this battleground using bonus system",
-			"items": { "$ref" : "bonus.json" }
+	"properties" : {
+		"name" : {
+			"type" : "string",
+			"description" : "Name of the battleground"
 		},
-		"name": {
-			"type":"string",
-			"description": "Name of the battleground"
+		"isSpecial" : {
+			"type" : "boolean",
+			"description" : "Shows if this battleground has own obstacles"
 		},
 		"graphics": {
 			"type":"string",
 			"format" : "imageFile",
 			"description": "BMP battleground resource"
 		},
-		"isSpecial": {
-			"type":"boolean",
-			"description": "Shows if this battleground has own obstacles"
+		"graphics" : {
+			"type" : "string",
+			"description" : "BMP battleground resource"
 		},
-		"impassableHexes": {
-			"type":"array",
-			"description": "Battle hexes always impassable for this type of battlefield (ship to ship for instance)",
-			"items": {
-				"type":"number"
+		"impassableHexes" : {
+			"type" : "array",
+			"description" : "Battle hexes always impassable for this type of battlefield (ship to ship for instance)",
+			"items" : {
+				"type" : "number"
 			}
 		}
 	}

+ 50 - 50
config/schemas/bonus.json

@@ -41,40 +41,28 @@
 
 	"additionalProperties" : false,
 	"properties":{
-		"addInfo": {
+		"type": {
+			"type":"string",
+			"description": "type"
+		},
+		"subtype": {
 			"anyOf" : [
 				{ "type" : "string" },
-				{ "type" : "number" },
-				{
-					"type" : "array",
-					"items" : {
-						"anyof" : [
-							{ "type" : "string" },
-							{ "type" : "number" }
-						]
-					}
-				}
+				{ "type" : "number" }
 			],
-			"description": "addInfo"
-		},
-		"description": {
-			"type":"string",
-			"description": "description"
+			"description": "subtype"
 		},
-		"duration": {
-                        "anyOf" : [
-                                { "type": "string"},
-                                { "type": "array", "items": {"type": "string"} }
-                        ],
-			"description": "duration"
+		"sourceID": {
+			"type":"number",
+			"description": "sourceID"
 		},
-		"effectRange": {
+		"sourceType": {
 			"type":"string",
-			"description": "effectRange"
+			"description": "sourceType"
 		},
-		"limiters" : {
-			"$ref" : "#/definitions/nestedLimiter",
-			"description" : "limiter"
+		"targetSourceType": {
+			"type":"string",
+			"description": "targetSourceType"
 		},
 		"propagator": {
 			"description": "propagator",
@@ -139,44 +127,56 @@
 				}
 			]
 		},
-		"sourceID": {
-			"type":"number",
-			"description": "sourceID"
+		"limiters" : {
+			"$ref" : "#/definitions/nestedLimiter",
+			"description" : "limiter"
 		},
-		"sourceType": {
+		"effectRange": {
 			"type":"string",
-			"description": "sourceType"
+			"description": "effectRange"
 		},
-		"targetSourceType": {
-			"type":"string",
-			"description": "targetSourceType"
+		"val": {
+			"type":"number",
+			"description": "val"
 		},
-		"stacking" : {
-			"type" : "string",
-			"description" : "stacking"
+		"valueType": {
+			"type":"string",
+			"description": "valueType"
 		},
-		"subtype": {
+		"addInfo": {
 			"anyOf" : [
 				{ "type" : "string" },
-				{ "type" : "number" }
+				{ "type" : "number" },
+				{
+					"type" : "array",
+					"items" : {
+						"anyof" : [
+							{ "type" : "string" },
+							{ "type" : "number" }
+						]
+					}
+				}
 			],
-			"description": "subtype"
+			"description": "addInfo"
+		},
+		"duration": {
+                        "anyOf" : [
+                                { "type": "string"},
+                                { "type": "array", "items": {"type": "string"} }
+                        ],
+			"description": "duration"
 		},
 		"turns": {
 			"type":"number",
 			"description": "turns"
 		},
-		"type": {
-			"type":"string",
-			"description": "type"
-		},
-		"val": {
-			"type":"number",
-			"description": "val"
+		"stacking" : {
+			"type" : "string",
+			"description" : "stacking"
 		},
-		"valueType": {
+		"description": {
 			"type":"string",
-			"description": "valueType"
+			"description": "description"
 		}
 	}
 }

+ 214 - 217
config/schemas/creature.json

@@ -1,8 +1,8 @@
 {
-	"type":"object",
-	"$schema": "http://json-schema.org/draft-04/schema",
+	"type" : "object",
+	"$schema" : "http://json-schema.org/draft-04/schema",
 	"title" : "VCMI creature format",
-	"description": "Json format for defining new creatures in VCMI",
+	"description" : "Json format for defining new creatures in VCMI",
 	"required" : [ "faction" ],
 	"anyOf" : [
 		{
@@ -10,302 +10,299 @@
 		},
 		{
 			"required" : [
-				"name", "cost", "level", "fightValue", "aiValue",
-				"attack", "defense", "hitPoints", "speed", "damage", "advMapAmount",
-				"graphics", "sound"
+				"name", "level", "cost", "speed", "hitPoints", "attack", "defense", "damage",
+				"fightValue", "aiValue", "advMapAmount", "graphics", "sound"
 			]
 		}
 	],
-	
 	"additionalProperties" : false,
-	"properties":{
-		"name": {
-			"type":"object",
+	"properties" : {
+		"special" : {
+			"type" : "boolean",
+			"description" : "Marks this object as special and not available by default"
+		},
+		"disabled" : {
+			"type" : "boolean",
+			"description" : "Object is competely disabled and may not be even loaded in-game"
+		},
+		"name" : {
+			"type" : "object",
 			"additionalProperties" : false,
-			"description": "Translatable names for this creature",
+			"description" : "Translatable names for this creature",
 			"required" : [ "singular", "plural" ],
-			"properties":{
-				"singular": {
-					"type":"string",
-					"description": "Singular version"
+			"properties" : {
+				"singular" : {
+					"type" : "string",
+					"description" : "Singular version"
 				},
-				"plural": {
-					"type":"string",
-					"description": "Plural version"
+				"plural" : {
+					"type" : "string",
+					"description" : "Plural version"
 				}
 			}
 		},
-		"abilityText" : {
+		"faction" : {
 			"type" : "string",
-			"description" : "Text version of creature abilities. Used only with original creature window"
-		},
-		"index" : {
-			"type" : "number",
-			"description" : "Private field to break things, do not use."
+			"description" : "Faction this creature belongs to. Examples: castle, rampart"
 		},
-		"extraNames" : {
+		"level" : { "type" : "number"},
+		"upgrades" : {
 			"type" : "array",
-			"items" : { "type" : "string" },
-			"description" : "Private field to break things, do not use."
-		},
-		"faction": {
-			"type":"string",
-			"description": "Faction this creature belongs to. Examples: castle, rampart"
+			"description" : "List of creatures to which this one can be upgraded",
+			"items" : { "type" : "string" }
 		},
-		"cost": {
-			"type":"object",
+		"cost" : {
+			"type" : "object",
 			"additionalProperties" : false,
-			"description": "Cost to recruit this creature",
-			"properties":{
-				"wood":    { "type":"number"},
-				"mercury": { "type":"number"},
-				"ore":     { "type":"number"},
-				"sulfur":  { "type":"number"},
-				"crystal": { "type":"number"},
-				"gems":    { "type":"number"},
-				"gold":    { "type":"number"}
+			"description" : "Cost to recruit this creature",
+			"properties" : {
+				"gold" :    { "type" : "number"},
+				"wood" :    { "type" : "number"},
+				"ore" :     { "type" : "number"},
+				"mercury" : { "type" : "number"},
+				"sulfur" :  { "type" : "number"},
+				"crystal" : { "type" : "number"},
+				"gems" :    { "type" : "number"},
+
 			}
 		},
-		"special": {
-			"type":"boolean",
-			"description": "Marks this object as special and not available by default"
-		},
-		"disabled": {
-			"type":"boolean",
-			"description": "Object is competely disabled and may not be even loaded in-game"
+		"speed" :     { "type" : "number" },
+		"hitPoints" : { "type" : "number" },
+		"attack" :    { "type" : "number" },
+		"defense" :   { "type" : "number" },
+		"damage" : {
+			"type" : "object",
+			"additionalProperties" : false,
+			"properties" : {
+				"max" : { "type" : "number" },
+				"min" : { "type" : "number" }
+			}
 		},
-		"level": { "type":"number"},
-		"fightValue": {
-			"type":"number",
-			"description": " \"value\" of creature, used to determine for example army strength"
+		"shots" :     { "type" : "number" },
+		"spellPoints" : {
+			"type" : "number",
+			"description" : "Spell points this creature has (usually equal to number of casts)"
 		},
-		"aiValue": {
-			"type":"number",
-			"description": "Describes how valuable this creature is to AI. Usually similar to fightValue"
+		"doubleWide" : {
+			"type" : "boolean",
+			"description" : "If set, creature will be two tiles wide on battlefield"
 		},
-		"growth": {
-			"type":"number",
-			"description": "Basic growth of this creature in town or in external dwellings"
+		"fightValue" : {
+			"type" : "number",
+			"description" : " \"value\" of creature, used to determine for example army strength"
 		},
-		"horde": {
-			"type":"number",
-			"description": "Bonus growth of this creature from built horde"
+		"aiValue" : {
+			"type" : "number",
+			"description" : "Describes how valuable this creature is to AI. Usually similar to fightValue"
 		},
-		"attack":    { "type":"number" },
-		"defense":   { "type":"number" },
-		"hitPoints": { "type":"number" },
-		"speed":     { "type":"number" },
-		"shots":     { "type":"number" },
-
-		"damage": {
-			"type":"object",
-			"additionalProperties" : false,
-			"properties":{
-				"max": { "type":"number" },
-				"min": { "type":"number" }
-			}
+		"growth" : {
+			"type" : "number",
+			"description" : "Basic growth of this creature in town or in external dwellings"
 		},
-		"spellPoints": {
-			"type":"number",
-			"description": "Spell points this creature has (usually equal to number of casts)"
+		"horde" : {
+			"type" : "number",
+			"description" : "Bonus growth of this creature from built horde"
 		},
-		"advMapAmount": {
-			"type":"object",
+		"advMapAmount" : {
+			"type" : "object",
 			"additionalProperties" : false,
 			"description" : "Initial size of random stacks on adventure map",
-			"properties":{
-				"min": { "type":"number" },
-				"max": { "type":"number" }
+			"properties" : {
+				"min" : { "type" : "number" },
+				"max" : { "type" : "number" }
 			}
 		},
-		"upgrades": {
-			"type":"array",
-			"description": "List of creatures to which this one can be upgraded",
-			"items": { "type":"string" }
+		"hasDoubleWeek" : {
+			"type" : "boolean",
+			"description" : "creature may receive \"week of\" events"
 		},
-		"doubleWide": {
-			"type":"boolean",
-			"description": "If set, creature will be two tiles wide on battlefield"
-		},
-		"hasDoubleWeek": {
-			"type":"boolean",
-			"description": "creature may receive \"week of\" events"
-		},
-		"abilities": {
-			"description": "Creature abilities described using Bonus system",
-			"type":"object",
-			"additionalProperties": {
+		"abilities" : {
+			"description" : "Creature abilities described using Bonus system",
+			"type" : "object",
+			"additionalProperties" : {
 				"$ref" : "bonus.json"
 			}
 		},
-		"stackExperience": {
-			"type":"array",
-			"description": "Stack experience, using bonus system",
-			"items":{
-				"type":"object",
-				"additionalProperties" : false,
-				"required" : [ "bonus", "values" ],
-				"description": "0",
-				"properties":{
-					"bonus": {"$ref" : "bonus.json" },
-					"values": {
-						"type":"array",
-						"minItems" : 10,
-						"maxItems" : 10,
-						"description": "Strength of the bonus",
-						"anyOf" : [
-							{ "items": { "type" : "number"  } },
-							{ "items": { "type" : "boolean" } }
-						]
-					}
-				}
-			}
+		"abilityText" : {
+			"type" : "string",
+			"description" : "Text version of creature abilities. Used only with original creature window"
 		},
-		"graphics": {
-			"type":"object",
+		"graphics" : {
+			"type" : "object",
 			"additionalProperties" : false,
-			"description": "Describes how this creature looks like during battles",
+			"description" : "Describes how this creature looks like during battles",
 			"required" : [
-				"animationTime", "animation", "timeBetweenFidgets"
+				"animation", "animationTime", "timeBetweenFidgets"
 			],
-			"properties":{
-				"animationTime": {
-					"type":"object",
+			"properties" : {
+				"animation" : {
+					"type" : "string",
+					"description" : ".def file with animation of this creature in battles",
+					"format" : "defFile"
+				},
+				"map" : {
+					"type" : "string",
+					"description" : ".def file with animation of this creature on adventure map",
+					"format" : "defFile"
+				},
+				"iconLarge" : {
+					"type" : "string",
+					"description" : "Large icon for this creature, used for example in town screen",
+					"format" : "imageFile"
+				},
+				"iconSmall" : {
+					"type" : "string",
+					"description" : "Small icon for this creature, used for example in exchange screen",
+					"format" : "imageFile"
+				},
+				"animationTime" : {
+					"type" : "object",
 					"additionalProperties" : false,
 					"required" : [ "attack", "walk", "idle" ],
-					"description": "Length of several animations",
-					"properties":{
-						"attack": {
-							"type":"number",
-							"description": "attack"
+					"description" : "Length of several animations",
+					"properties" : {
+						"attack" : {
+							"type" : "number",
+							"description" : "attack"
 						},
-						"idle": {
-							"type":"number",
-							"description": "idle"
+						"idle" : {
+							"type" : "number",
+							"description" : "idle"
 						},
-						"walk": {
-							"type":"number",
-							"description": "walk"
+						"walk" : {
+							"type" : "number",
+							"description" : "walk"
 						}
 					}
 				},
-				"iconLarge": {
-					"type":"string",
-					"description": "Large icon for this creature, used for example in town screen",
-					"format" : "imageFile"
-				},
-				"iconSmall": {
-					"type":"string",
-					"description": "Small icon for this creature, used for example in exchange screen",
-					"format" : "imageFile"
-				},
-
-				"map": {
-					"type":"string",
-					"description": ".def file with animation of this creature on adventure map",
-					"format" : "defFile"
-				},
-				"animation": {
-					"type":"string",
-					"description": ".def file with animation of this creature in battles",
-					"format" : "defFile"
-				},
-				"missile": {
-					"type":"object",
+				"missile" : {
+					"type" : "object",
 					"additionalProperties" : false,
 					"required" : [ "frameAngles", "offset", "attackClimaxFrame" ],
-					"description": "Missile description for archers",
-					"properties":{
-						"projectile": {
-							"type":"string",
-							"description": "Path to projectile animation",
+					"description" : "Missile description for archers",
+					"properties" : {
+						"projectile" : {
+							"type" : "string",
+							"description" : "Path to projectile animation",
 							"format" : "defFile"
 						},
-						"ray": {
-							"type":"array",
-							"description": "Colors of ray projectile animation",
+						"ray" : {
+							"type" : "array",
+							"description" : "Colors of ray projectile animation",
 							"minItems" : 1,
-							"items": {
-								"type":"object",
+							"items" : {
+								"type" : "object",
 								"required" : [ "start", "end" ],
-								"properties":{
-									"start":  {
-										"type":"array",
+								"properties" : {
+									"start" :  {
+										"type" : "array",
 										"minItems" : 4,
 										"maxItems" : 4,
-										"items": {
+										"items" : {
 											"minimum" : 0,
 											"maximum" : 255,
-											"type":"number"
+											"type" : "number"
 										}
 									 },
-									"end":  {
-										"type":"array",
+									"end" :  {
+										"type" : "array",
 										"minItems" : 4,
 										"maxItems" : 4,
-										"items": {
+										"items" : {
 											"minimum" : 0,
 											"maximum" : 255,
-											"type":"number"
+											"type" : "number"
 										}
 									}
 								}
 							}
 						},
-						"frameAngles": {
-							"type":"array",
-							"description": "Angles of missile images, should go from 90 to -90",
+						"frameAngles" : {
+							"type" : "array",
+							"description" : "Angles of missile images, should go from 90 to -90",
 							"minItems" : 1,
-							"items": {
+							"items" : {
 								"minimum" : -90,
 								"maximum" :  90,
-								"type":"number"
+								"type" : "number"
 							}
 						},
-						"offset": {
-							"type":"object",
+						"offset" : {
+							"type" : "object",
 							"additionalProperties" : false,
 							"required" : [ "lowerX", "lowerY", "middleX", "middleY", "upperX", "upperY" ],
-							"description": "Position where projectile image appears during shooting in specific direction",
-							"properties":{
-								"lowerX":  { "type":"number" },
-								"lowerY":  { "type":"number" },
-								"middleX": { "type":"number" },
-								"middleY": { "type":"number" },
-								"upperX":  { "type":"number" },
-								"upperY":  { "type":"number" }
+							"description" : "Position where projectile image appears during shooting in specific direction",
+							"properties" : {
+								"lowerX" :  { "type" : "number" },
+								"lowerY" :  { "type" : "number" },
+								"middleX" : { "type" : "number" },
+								"middleY" : { "type" : "number" },
+								"upperX" :  { "type" : "number" },
+								"upperY" :  { "type" : "number" }
 							}
 						},
-						"attackClimaxFrame": {
-							"type":"number",
-							"description": "Frame from attack animation during which creature deals damage"
+						"attackClimaxFrame" : {
+							"type" : "number",
+							"description" : "Frame from attack animation during which creature deals damage"
 						}
 					}
 				},
-				"timeBetweenFidgets": {
-					"type":"number",
-					"description": "How often creature will play idling animation"
+				"timeBetweenFidgets" : {
+					"type" : "number",
+					"description" : "How often creature will play idling animation"
 				},
-				"troopCountLocationOffset": {
-					"type":"number",
-					"description": "Position of troop count label?"
+				"troopCountLocationOffset" : {
+					"type" : "number",
+					"description" : "Position of troop count label?"
 				}
 			}
 		},
-		"sound": {
-			"type":"object",
+		"sound" : {
+			"type" : "object",
 			"additionalProperties" : false,
-			"description": "Various sound files associated with this creature",
-			"properties":{
-				"attack":      { "type":"string", "format" : "soundFile" },
-				"defend":      { "type":"string", "format" : "soundFile" },
-				"killed":      { "type":"string", "format" : "soundFile" },
-				"startMoving": { "type":"string", "format" : "soundFile" },
-				"endMoving":   { "type":"string", "format" : "soundFile" },
-				"move":        { "type":"string", "format" : "soundFile" },
-				"shoot":       { "type":"string", "format" : "soundFile" },
-				"wince":       { "type":"string", "format" : "soundFile" }
+			"description" : "Various sound files associated with this creature",
+			"properties" : {
+				"attack" :      { "type" : "string", "format" : "soundFile" },
+				"defend" :      { "type" : "string", "format" : "soundFile" },
+				"killed" :      { "type" : "string", "format" : "soundFile" },
+				"startMoving" : { "type" : "string", "format" : "soundFile" },
+				"endMoving" :   { "type" : "string", "format" : "soundFile" },
+				"move" :        { "type" : "string", "format" : "soundFile" },
+				"shoot" :       { "type" : "string", "format" : "soundFile" },
+				"wince" :       { "type" : "string", "format" : "soundFile" }
 			}
+		},
+		"stackExperience" : {
+			"type" : "array",
+			"description" : "Stack experience, using bonus system",
+			"items" : {
+				"type" : "object",
+				"additionalProperties" : false,
+				"required" : [ "bonus", "values" ],
+				"description" : "0",
+				"properties" : {
+					"bonus" : {"$ref" : "bonus.json" },
+					"values" : {
+						"type" : "array",
+						"minItems" : 10,
+						"maxItems" : 10,
+						"description" : "Strength of the bonus",
+						"anyOf" : [
+							{ "items" : { "type" : "number"  } },
+							{ "items" : { "type" : "boolean" } }
+						]
+					}
+				}
+			}
+		},
+		"index" : {
+			"type" : "number",
+			"description" : "Private field to break things, do not use."
+		},
+		"extraNames" : {
+			"type" : "array",
+			"items" : { "type" : "string" },
+			"description" : "Private field to break things, do not use."
 		}
 	}
 }

+ 130 - 131
config/schemas/faction.json

@@ -31,7 +31,7 @@
 	"$schema": "http://json-schema.org/draft-04/schema",
 	"title" : "VCMI faction format",
 	"description": "Json format for defining new faction (aka towns) in VCMI",
-	"required" : [ "name", "alignment", "creatureBackground", "nativeTerrain" ],
+	"required" : [ "name", "alignment", "nativeTerrain", "creatureBackground" ],
 	"dependencies" : {
 		"town" : [ "puzzleMap" ]
 	},
@@ -42,15 +42,19 @@
 			"type" : "string",
 			"description" : "Translatable name of town"
 		},
-		"index" : {
-			"type" : "number",
-			"description" : "Private field to break things, do not use."
-		},
 		"alignment": {
 			"type":"string",
 			"enum" : [ "good", "neutral", "evil" ],
 			"description": "Town alignment, good, neutral or evil"
 		},
+		"nativeTerrain": {
+			"type":"string",
+			"description": "Native terrain for creatures. Creatures fighting on native terrain receive several bonuses"
+		},
+		"preferUndergroundPlacement": {
+			"type":"boolean",
+			"description": "Random map generator places player/cpu-owned towns underground if true is specified and on the ground otherwise. Parameter is unused for maps without underground. False by default."
+		},
 		"creatureBackground": {
 			"type":"object",
 			"additionalProperties" : false,
@@ -69,41 +73,6 @@
 				}
 			}
 		},
-		"nativeTerrain": {
-			"type":"string",
-			"description": "Native terrain for creatures. Creatures fighting on native terrain receive several bonuses"
-		},
-		"preferUndergroundPlacement": {
-			"type":"boolean",
-			"description": "Random map generator places player/cpu-owned towns underground if true is specified and on the ground otherwise. Parameter is unused for maps without underground. False by default."
-		},
-		"puzzleMap": {
-			"type":"object",
-			"additionalProperties" : false,
-			"required" : [ "prefix", "pieces" ],
-			"description": "Puzzle map from obelisks for this town. Must contain 48 pieces",
-			"properties":{
-				"pieces": {
-					"type":"array",
-					"description": "Lits of pieces definitions",
-					"minItems" : 48,
-					"maxItems" : 48,
-					"items": {
-						"type":"object",
-						"additionalProperties" : false,
-						"properties":{
-							"index": { "type":"number", "description" : "Order in which images will be opened" },
-							"x":     { "type":"number", "description" : "X coordinate on screen" },
-							"y":     { "type":"number", "description" : "X coordinate on screen" }
-						}
-					}
-				},
-				"prefix": {
-					"type":"string",
-					"description": "Prefix for image names, e.g. \"PUZCAS\" for name \"PUZCAS12.png\""
-				}
-			}
-		},
 		"town": {
 			"type":"object",
 			"additionalProperties" : false,
@@ -113,56 +82,6 @@
 			],
 			"description": "town",
 			"properties":{
-				"mapObject" : {
-					"properties" : {
-						"filters" : {
-							"type" : "object",
-							"additionalProperties" : { "type" : "array" }
-						}
-					}
-				},
-				"guildSpells" : {
-					"type" : "object",
-					"description" : "Spells available in mage guild. Value indicates chance for this spell to appear",
-					"additionalProperties" : {
-						"type" : "number"
-					}
-				},				
-				"defaultTavern" : {
-					"type" : "number",
-					"description" : "Default chance for hero to appear in tavern, used only when value vas not set in tavern field",
-					"minimum" : 0
-				},
-				"tavern" : {
-					"type" : "object",
-					"description" : "Hero classes available in tavern. Value indicates chance for hero of this class to appear",
-					"additionalProperties" : {
-						"type" : "number",
-						"minimum" : 0
-					}
-				},
-				"tavernVideo" : {
-					"type" : "string",
-					"description" : "Video for tavern window",
-					"format" : "videoFile"
-				},
-				"names" : {
-					"type" : "array",
-					"description" : "Names for towns on adventure map",
-					"minItems" : 1,
-					"items" : { "type" : "string" }
-				},
-				"buildingsIcons": {
-					"type" : "string",
-					"description": "Path to .def file with building icons",
-					"format" : "animationFile"
-				},
-				"buildings": {
-					"type" : "object",
-					"additionalProperties" : {
-						"$ref" : "townBuilding.json"
-					}
-				},
 				"creatures": {
 					"type":"array",
 					"minItems" : 7,
@@ -173,21 +92,6 @@
 						"items" : { "type" : "string" }
 					}
 				},
-				"guildWindow": {
-					"type":"string",
-					"description": "Image with small view on town from mage guild"
-				},
-				"guildBackground": {
-					"type":"string",
-					"description": "Image with background of mage guild",
-					"format" : "imageFile"
-				},
-
-				"hallBackground": {
-					"type":"string",
-					"description": "background image for town hall",
-					"format" : "imageFile"
-				},
 				"hallSlots": {
 					"type":"array",
 					"description": "Description of town hall",
@@ -204,12 +108,85 @@
 						}
 					}
 				},
+				"buildings": {
+					"type" : "object",
+					"additionalProperties" : {
+						"$ref" : "townBuilding.json"
+					}
+				},
+				"mageGuild": {
+					"type":"number",
+					"description": "Maximal level of mage guild"
+				},
+				"primaryResource": {
+					"type":"string",
+					"description": "Primary resource for this town. Produced by Silo and offered as starting bonus"
+				},
+				"warMachine": {
+					"type":"string",
+					"description": "Identifier of war machine produced by blacksmith in town"
+				},
 				"horde": {
 					"type":"array",
 					"maxItems" : 2,
 					"description": "Levels of creatures that have hordes in town",
 					"items": { "type":"number" }
 				},
+				"moatAbility": {
+					"type":"string",
+					"description": "Identifier of ability to use as town moat during siege"
+				},
+				"siege": {
+					"$ref" : "townSiege.json"
+				},
+				"musicTheme": {
+					"type":"string",
+					"description": "Path to town music theme",
+					"format" : "musicFile"
+				},
+				"tavernVideo" : {
+					"type" : "string",
+					"description" : "Video for tavern window",
+					"format" : "videoFile"
+				},
+				"townBackground": {
+					"type":"string",
+					"description": "Background for town screen",
+					"format" : "imageFile"
+				},
+				"guildWindow": {
+					"type":"string",
+					"description": "Image with small view on town from mage guild"
+				},
+				"guildBackground": {
+					"type":"string",
+					"description": "Image with background of mage guild",
+					"format" : "imageFile"
+				},
+				"hallBackground": {
+					"type":"string",
+					"description": "background image for town hall",
+					"format" : "imageFile"
+				},
+				"buildingsIcons": {
+					"type" : "string",
+					"description": "Path to .def file with building icons",
+					"format" : "animationFile"
+				},
+				"mapObject" : {
+					"properties" : {
+						"filters" : {
+							"type" : "object",
+							"additionalProperties" : { "type" : "array" }
+						}
+					}
+				},
+				"structures": {
+					"type" : "object",
+					"additionalProperties" : {
+						"$ref" : "townStructure.json"
+					}
+				},
 				"icons": {
 					"type":"object",
 					"additionalProperties" : false,
@@ -226,42 +203,64 @@
 						}
 					}
 				},
-				"mageGuild": {
-					"type":"number",
-					"description": "Maximal level of mage guild"
-				},
-				"moatAbility": {
-					"type":"string",
-					"description": "Identifier of ability to use as town moat during siege"
-				},
-				"musicTheme": {
-					"type":"string",
-					"description": "Path to town music theme",
-					"format" : "musicFile"
-				},
-				"siege": {
-					"$ref" : "townSiege.json"
+				"defaultTavern" : {
+					"type" : "number",
+					"description" : "Default chance for hero to appear in tavern, used only when value vas not set in tavern field",
+					"minimum" : 0
 				},
-				"structures": {
+				"tavern" : {
 					"type" : "object",
+					"description" : "Hero classes available in tavern. Value indicates chance for hero of this class to appear",
 					"additionalProperties" : {
-						"$ref" : "townStructure.json"
+						"type" : "number",
+						"minimum" : 0
 					}
 				},
-				"townBackground": {
-					"type":"string",
-					"description": "Background for town screen",
-					"format" : "imageFile"
+				"guildSpells" : {
+					"type" : "object",
+					"description" : "Spells available in mage guild. Value indicates chance for this spell to appear",
+					"additionalProperties" : {
+						"type" : "number"
+					}
 				},
-				"primaryResource": {
-					"type":"string",
-					"description": "Primary resource for this town. Produced by Silo and offered as starting bonus"
+				"names" : {
+					"type" : "array",
+					"description" : "Names for towns on adventure map",
+					"minItems" : 1,
+					"items" : { "type" : "string" }
+				}
+			}
+		},
+		"puzzleMap": {
+			"type":"object",
+			"additionalProperties" : false,
+			"required" : [ "prefix", "pieces" ],
+			"description": "Puzzle map from obelisks for this town. Must contain 48 pieces",
+			"properties":{
+				"pieces": {
+					"type":"array",
+					"description": "Lits of pieces definitions",
+					"minItems" : 48,
+					"maxItems" : 48,
+					"items": {
+						"type":"object",
+						"additionalProperties" : false,
+						"properties":{
+							"index": { "type":"number", "description" : "Order in which images will be opened" },
+							"x":     { "type":"number", "description" : "X coordinate on screen" },
+							"y":     { "type":"number", "description" : "X coordinate on screen" }
+						}
+					}
 				},
-				"warMachine": {
+				"prefix": {
 					"type":"string",
-					"description": "Identifier of war machine produced by blacksmith in town"
+					"description": "Prefix for image names, e.g. \"PUZCAS\" for name \"PUZCAS12.png\""
 				}
 			}
+		},
+		"index" : {
+			"type" : "number",
+			"description" : "Private field to break things, do not use."
 		}
 	}
 }

+ 44 - 44
config/schemas/hero.json

@@ -3,7 +3,7 @@
 	"$schema": "http://json-schema.org/draft-04/schema",
 	"title" : "VCMI hero format",
 	"description" : "Format used to define new heroes in VCMI",
-	"required": [ "army", "class", "skills", "texts" ],
+	"required": [ "class", "army", "skills", "texts" ],
 	
 	"oneOf" : [
 		{
@@ -16,40 +16,9 @@
 
 	"additionalProperties" : false,
 	"properties":{
-		"army": {
-			"type":"array",
-			"description": "Initial hero army when recruited in tavern",
-			"minItems" : 1,
-			"maxItems" : 3,
-			"items": {
-				"type":"object",
-				"additionalProperties" : false,
-				"required" : [ "creature", "min", "max" ],
-				"properties":{
-					"creature": {
-						"type":"string",
-						"description": "creature"
-					},
-					"max": {
-						"type":"number",
-						"description": "max",
-						"minimum" : 1
-					},
-					"min": {
-						"type":"number",
-						"description": "min",
-						"minimum" : 1
-					}
-				}
-			}
-		},
-		"index" : {
-			"type" : "number",
-			"description" : "Private field to break things, do not use."
-		},
 		"special": {
-				"type":"boolean",
-				"description": "Marks this object as special and not available by default"
+			"type":"boolean",
+			"description": "Marks this object as special and not available by default"
 		},
 		"class": {
 			"type":"string",
@@ -92,6 +61,33 @@
 				}
 			}
 		},
+		"army": {
+			"type":"array",
+			"description": "Initial hero army when recruited in tavern",
+			"minItems" : 1,
+			"maxItems" : 3,
+			"items": {
+				"type":"object",
+				"additionalProperties" : false,
+				"required" : [ "creature", "min", "max" ],
+				"properties":{
+					"creature": {
+						"type":"string",
+						"description": "creature"
+					},
+					"max": {
+						"type":"number",
+						"description": "max",
+						"minimum" : 1
+					},
+					"min": {
+						"type":"number",
+						"description": "min",
+						"minimum" : 1
+					}
+				}
+			}
+		},
 		"skills": {
 			"type":"array",
 			"description": "List of skills initially known by hero",
@@ -142,30 +138,30 @@
 			"type":"object",
 			"additionalProperties" : false,
 			"description": "All translatable texts related to hero",
-			"required" : [ "biography", "name", "specialty" ],
+			"required" : [ "name", "biography", "specialty" ],
 			"properties":{
-				"biography": {
-					"type":"string",
-					"description": "Hero biography"
-				},
 				"name": {
 					"type":"string",
 					"description": "Hero name"
 				},
+				"biography": {
+					"type":"string",
+					"description": "Hero biography"
+				},
 				"specialty": {
 					"type":"object",
 					"additionalProperties" : false,
 					"description": "Hero specialty information",
-					"required" : [ "description", "name", "tooltip" ],
+					"required" : [ "name", "description", "tooltip" ],
 					"properties":{
-						"description": {
-							"type":"string",
-							"description": "Description visible when hovering over specialty icon"
-						},
 						"name": {
 							"type":"string",
 							"description": "Name of the specialty"
 						},
+						"description": {
+							"type":"string",
+							"description": "Description visible when hovering over specialty icon"
+						},
 						"tooltip": {
 							"type":"string",
 							"description": "Tooltip visible on clicking icon."
@@ -173,6 +169,10 @@
 					}
 				}
 			}
+		},
+		"index" : {
+			"type" : "number",
+			"description" : "Private field to break things, do not use."
 		}
 	}
 }

+ 32 - 33
config/schemas/heroClass.json

@@ -4,13 +4,30 @@
 	"title" : "VCMI hero class format",
 	"description" : "Format used to define classes of heroes in VCMI",
 	"required" : [
-		"animation", "faction", "highLevelChance", "lowLevelChance",
-		"name", "primarySkills", "secondarySkills", "tavern", "defaultTavern",
-		"affinity", "commander", "mapObject"
+		"name", "faction", "affinity", "commander", "animation", "mapObject",
+		"primarySkills", "secondarySkills", "lowLevelChance", "highLevelChance", 
+		"defaultTavern", "tavern"
 	],
 
 	"additionalProperties" : false,
 	"properties":{
+		"name": {
+			"type":"string",
+			"description": "Translatable name of hero class"
+		},
+		"faction": {
+			"type":"string",
+			"description": "Faction this hero class belongs to"
+		},
+		"affinity" : {
+			"type" : "string",
+			"description" : "Affinity of hero class, might or magic",
+			"enum" : [ "might", "magic"]
+		},
+		"commander": {
+			"type":"string",
+			"description": "Identifier of creature that is used as commander by heroes"
+		},
 		"animation": {
 			"type":"object",
 			"additionalProperties" : false,
@@ -45,51 +62,30 @@
 				}
 			}
 		},
-		"index" : {
-			"type" : "number",
-			"description" : "Private field to break things, do not use."
-		},
-		"faction": {
-			"type":"string",
-			"description": "Faction this hero class belongs to"
-		},
-		"affinity" : {
-			"type" : "string",
-			"description" : "Affinity of hero class, might or magic",
-			"enum" : [ "might", "magic"]
-		},
-		"commander": {
-			"type":"string",
-			"description": "Identifier of creature that is used as commander by heroes"
-		},
-		"highLevelChance": {
+		"primarySkills": {
 			"type":"object",
-			"description": "Chance to get specific primary skill on level-up, applicable for levels starting from 10",
+			"description": "Initial primary skills of heroes",
 			"additionalProperties":{
 				"type":"number"
 			}
 		},
-		"lowLevelChance": {
+		"secondarySkills": {
 			"type":"object",
-			"description": "Chance to get specific primary skill on level-up, applicable for levels less than 10",
+			"description": "Chance to get specific secondary skill on level-up. All missing skills are considered to be banned",
 			"additionalProperties":{
 				"type":"number"
 			}
 		},
-		"name": {
-			"type":"string",
-			"description": "Translatable name of hero class"
-		},
-		"primarySkills": {
+		"lowLevelChance": {
 			"type":"object",
-			"description": "Initial primary skills of heroes",
+			"description": "Chance to get specific primary skill on level-up, applicable for levels less than 10",
 			"additionalProperties":{
 				"type":"number"
 			}
 		},
-		"secondarySkills": {
+		"highLevelChance": {
 			"type":"object",
-			"description": "Chance to get specific secondary skill on level-up. All missing skills are considered to be banned",
+			"description": "Chance to get specific primary skill on level-up, applicable for levels starting from 10",
 			"additionalProperties":{
 				"type":"number"
 			}
@@ -99,7 +95,6 @@
 			"description" : "Default chance for hero to appear in tavern, used only when value vas not set in tavern field",
 			"minimum" : 0
 		},
-
 		"tavern": {
 			"type":"object",
 			"description": "Chance for this hero to appear in tavern of this factions. Reversed version of field \"tavern\" from town format",
@@ -107,6 +102,10 @@
 				"type":"number",
 				"minimum" : 0
 			}
+		},
+		"index" : {
+			"type" : "number",
+			"description" : "Private field to break things, do not use."
 		}
 	}
 }

+ 6 - 12
config/schemas/mapHeader.json

@@ -3,42 +3,36 @@
 	"$schema": "http://json-schema.org/draft-04/schema",
 	"title" : "VCMI map header format",
 	"description" : "Part of map in json format, defines core settings of the map",
-	"required": [ "defeatIconIndex", "defeatString", "victoryIconIndex", "victoryString" ],
+	"required": [ "victoryIconIndex", "victoryString", "defeatIconIndex", "defeatString" ],
 
 	"additionalProperties" : false,
 	"properties":{
-		"defeatIconIndex": {
+		"victoryIconIndex": {
 			"type":"number"
 		},
-		"defeatString": {
+		"victoryString": {
 			"type":"string"
 		},
-		"victoryIconIndex": {
+		"defeatIconIndex": {
 			"type":"number"
 		},
-		"victoryString": {
+		"defeatString": {
 			"type":"string"
 		},
 		"triggeredEvents" : {
 			"type" : "object",
-
 			"additionalProperties" : {
 				"type" : "object",
-				"additionalProperties" : "false",
-
+				"additionalProperties" : false,
 				"properties" : {
 					"required" : [ "condition", "message", "effect" ],
-
 					"condition" : { "type" : "array" },
-
 					"description" : { "type" : "string" },
 					"message" : { "type" : "string" },
 					"effect" : {
 						"type" : "object",
 						"additionalProperties" : false,
-
 						"required" : [ "type", "messageToSend" ],
-
 						"properties" : {
 							"type" : { "type" : "string" },
 							"messageToSend" : { "type" : "string" }

+ 99 - 113
config/schemas/mod.json

@@ -3,7 +3,7 @@
 	"$schema": "http://json-schema.org/draft-04/schema",
 	"title" : "VCMI mod file format",
 	"description" : "Format used to define main mod file (mod.json) in VCMI",
-	"required" : [ "name", "description", "version", "author", "contact", "modType" ],
+	"required" : [ "name", "description", "modType", "version", "author", "contact" ],
 	"definitions" : {
 		"localizable" : {
 			"type":"object",
@@ -22,6 +22,14 @@
 					"type":"string",
 					"description": "Author of the mod. Can be nickname, real name or name of team"
 				},
+				"changelog" : {
+					"type":"object",
+					"description": "List of changes/new features in each version",
+					"additionalProperties" : {
+						"type" : "array",
+						"items" : { "type":"string" }
+					}
+				},
 				"skipValidation" : {
 					"type":"boolean",
 					"description": "If set to true, vcmi will skip validation of current translation json files"
@@ -30,14 +38,6 @@
 					"type":"array",
 					"description": "List of files with translations for this language",
 					"items": { "type":"string", "format" : "textFile" }
-				},
-				"changelog" : {
-					"type":"object",
-					"description": "List of changes/new features in each version",
-					"additionalProperties" : {
-						"type" : "array",
-						"items" : { "type":"string" }
-					}
 				}
 			}
 		}
@@ -53,52 +53,38 @@
 			"type":"string",
 			"description": "More lengthy description of mod. No hard limit"
 		},
-
 		"modType" : {
 			"type":"string",
 			"enum" : [ "Translation", "Town", "Test", "Templates", "Spells", "Music", "Sounds", "Skills", "Other", "Objects", "Mechanics", "Interface", "Heroes", "Graphical", "Expansion", "Creatures", "Artifacts", "AI" ],
 			"description": "Type of mod, e.g. Town, Artifacts, Graphical."
 		},
-
-		"version" : {
-			"type":"string",
-			"description": "Current mod version, up to 3 numbers, dot-separated. Format: A.B.C"
-		},
-
 		"author" : {
 			"type":"string",
 			"description": "Author of the mod. Can be nickname, real name or name of team"
 		},
-
+		"contact" : {
+			"type":"string",
+			"description": "Home page of mod or link to forum thread"
+		},
 		"licenseName" : {
 			"type":"string",
 			"description": "Name of the license, recommended is Creative Commons Attribution-ShareAlike"
 		},
-
 		"licenseURL" : {
 			"type":"string",
 			"description": "Url to license text, e.g. http://creativecommons.org/licenses/by-sa/4.0/deed"
 		},
-
-		"contact" : {
-			"type":"string",
-			"description": "Home page of mod or link to forum thread"
-		},
-
-		"language" : {
+		"version" : {
 			"type":"string",
-			"description": "Base language of the mod, before applying localizations. By default vcmi assumes English",
-			"enum" : [ "chinese", "english", "korean", "german", "polish", "russian", "spanish", "ukrainian" ],
-		},
-		"depends": {
-			"type":"array",
-			"description": "List of mods that are required to run this one",
-			"items": { "type":"string" }
+			"description": "Current mod version, up to 3 numbers, dot-separated. Format: A.B.C"
 		},
-		"conflicts": {
-			"type":"array",
-			"description": "List of mods that can't be enabled in the same time as this one",
-			"items": { "type":"string" }
+		"changelog" : {
+			"type":"object",
+			"description": "List of changes/new features in each version",
+			"additionalProperties" : {
+				"type" : "array",
+				"items" : { "type":"string" }
+			}
 		},
 		"compatibility" : {
 			"type":"object",
@@ -117,11 +103,58 @@
 				}
 			}
 		},
-
+		"depends": {
+			"type":"array",
+			"description": "List of mods that are required to run this one",
+			"items": { "type":"string" }
+		},
+		"conflicts": {
+			"type":"array",
+			"description": "List of mods that can't be enabled in the same time as this one",
+			"items": { "type":"string" }
+		},
 		"keepDisabled" : {
 			"type":"boolean",
 			"description": "If set to true, mod will not be enabled automatically on install"
 		},
+		"settings" : {
+			"type":"object",
+			"description": "List of changed game settings by mod",
+			"additionalProperties" : {
+				"type" : "object",
+				"properties" : { 
+					"type" : "object"
+				}
+			}
+		},
+		"filesystem": {
+			"type":"object",
+			"description": "Optional, description on how files are organized in your mod. In most cases you do not need to use this field",
+			"additionalProperties":{
+				"type":"array",
+				"description" : "list of data sources attached to this mount point",
+				"items": {
+					"type":"object",
+					"additionalProperties" : false,
+					"properties":{
+						"path": {
+							"type":"string",
+							"description": "Path to data source"
+						},
+						"type": {
+							"type" : "string",
+							"enum" : [ "dir", "lod", "snd", "vid", "map", "zip" ],
+							"description" : "Type of data source"
+						}
+					}
+				}
+			}
+		},
+		"language" : {
+			"type":"string",
+			"description": "Base language of the mod, before applying localizations. By default vcmi assumes English",
+			"enum" : [ "chinese", "english", "korean", "german", "polish", "russian", "spanish", "ukrainian" ]
+		},
 		"chinese" : {
 			"$ref" : "#/definitions/localizable"
 		},
@@ -151,22 +184,6 @@
 			"description": "List of files with translations for this language",
 			"items": { "type":"string", "format" : "textFile" }
 		},
-		"artifacts": {
-			"type":"array",
-			"description": "List of configuration files for artifacts",
-			"items": { "type":"string", "format" : "textFile" }
-		},
-		"bonuses":{
-			"type":"array",
-			"description": "List of configuration files for bonuses",
-			"items": { "type":"string", "format" : "textFile" }
-
-		},
-		"creatures": {
-			"type":"array",
-			"description": "List of configuration files for creatures",
-			"items": { "type":"string", "format" : "textFile" }
-		},
 		"factions": {
 			"type":"array",
 			"description": "List of configuration files for towns/factions",
@@ -182,41 +199,34 @@
 			"description": "List of configuration files for heroes",
 			"items": { "type":"string", "format" : "textFile" }
 		},
-		"objects": {
-			"type":"array",
-			"description": "List of configuration files for objects",
-			"items": { "type":"string", "format" : "textFile" }
-		},
-		"scripts": {
+		"skills": {
 			"type":"array",
-			"description": "List of configuration files for scripts",
+			"description": "List of configuration files for skills",
 			"items": { "type":"string", "format" : "textFile" }
 		},
-		"spells": {
+		"creatures": {
 			"type":"array",
-			"description": "List of configuration files for spells",
+			"description": "List of configuration files for creatures",
 			"items": { "type":"string", "format" : "textFile" }
 		},
-		"skills": {
+		"artifacts": {
 			"type":"array",
-			"description": "List of configuration files for skills",
+			"description": "List of configuration files for artifacts",
 			"items": { "type":"string", "format" : "textFile" }
 		},
-		"templates":{
+		"spells": {
 			"type":"array",
-			"description": "List of configuration files for RMG templates",
+			"description": "List of configuration files for spells",
 			"items": { "type":"string", "format" : "textFile" }
-
 		},
-		"battlefields":{
+		"objects": {
 			"type":"array",
-			"description": "List of configuration files for battlefields",
+			"description": "List of configuration files for objects",
 			"items": { "type":"string", "format" : "textFile" }
-
 		},
-		"obstacles":{
+		"bonuses":{
 			"type":"array",
-			"description": "List of configuration files for obstacles",
+			"description": "List of configuration files for bonuses",
 			"items": { "type":"string", "format" : "textFile" }
 		},
 		"terrains":{
@@ -234,49 +244,25 @@
 			"description": "List of configuration files for rivers",
 			"items": { "type":"string", "format" : "textFile" }
 		},
-
-		"changelog" : {
-			"type":"object",
-			"description": "List of changes/new features in each version",
-			"additionalProperties" : {
-				"type" : "array",
-				"items" : { "type":"string" }
-			}
+		"battlefields":{
+			"type":"array",
+			"description": "List of configuration files for battlefields",
+			"items": { "type":"string", "format" : "textFile" }
 		},
-		
-		"settings" : {
-			"type":"object",
-			"description": "List of changed game settings by mod",
-			"additionalProperties" : {
-				"type" : "object",
-				"properties" : { 
-					"type" : "object"
-				}
-			}
+		"obstacles":{
+			"type":"array",
+			"description": "List of configuration files for obstacles",
+			"items": { "type":"string", "format" : "textFile" }
 		},
-
-		"filesystem": {
-			"type":"object",
-			"description": "Optional, description on how files are organized in your mod. In most cases you do not need to use this field",
-			"additionalProperties":{
-				"type":"array",
-				"description" : "list of data sources attached to this mount point",
-				"items": {
-					"type":"object",
-					"additionalProperties" : false,
-					"properties":{
-						"path": {
-							"type":"string",
-							"description": "Path to data source"
-						},
-						"type": {
-							"type" : "string",
-							"enum" : [ "dir", "lod", "snd", "vid", "map", "zip" ],
-							"description" : "Type of data source"
-						}
-					}
-				}
-			}
+		"templates":{
+			"type":"array",
+			"description": "List of configuration files for RMG templates",
+			"items": { "type":"string", "format" : "textFile" }
+		},
+		"scripts": {
+			"type":"array",
+			"description": "List of configuration files for scripts",
+			"items": { "type":"string", "format" : "textFile" }
 		}
 	}
 }

+ 4 - 4
config/schemas/object.json

@@ -3,10 +3,13 @@
 	"$schema": "http://json-schema.org/draft-04/schema",
 	"title" : "VCMI map object format",
 	"description" : "Description of map object class",
-	"required": [ "handler", "name" ],
+	"required": [ "name", "handler" ],
 	"additionalProperties" : false,
 
 	"properties":{
+		"name": {
+			"type":"string"
+		},
 		"index": {
 			"type":"number"
 		},
@@ -19,9 +22,6 @@
 		"base": {
 			"type" : "object"
 		},
-		"name": {
-			"type":"string"
-		},
 		"types": {
 			"type":"object",
 			"additionalProperties": {

+ 7 - 8
config/schemas/objectTemplate.json

@@ -24,16 +24,10 @@
 			"maxItems" : 3,
 			"items": {
 				"type": "string",
-				"maxLength" : 3,
-				"minLength" : 3
+				"minLength" : 3,
+				"maxLength" : 3
 			}
 		},
-
-		"allowedTerrains" : {
-			"type":"array",
-			"items": { "type": "string" },
-			"description": "List of terrain on which this object can be placed"
-		},
 		"mask" :  {
 			"type":"array",
 			"items": { "type": "string" },
@@ -42,6 +36,11 @@
 		"zIndex" :  {
 			"type":"number",
 			"description": "Defines order in which objects on same tile will be blit."
+		},
+		"allowedTerrains" : {
+			"type":"array",
+			"items": { "type": "string" },
+			"description": "List of terrain on which this object can be placed"
 		}
 	}
 }

+ 9 - 10
config/schemas/objectType.json

@@ -13,6 +13,15 @@
 		"aiValue": {
 			"type":"number"
 		},
+		"base": {
+			"type" : "object"
+		},
+		"templates": {
+			"type":"object",
+			"additionalProperties": {
+				"$ref" : "objectTemplate.json"
+			}
+		},
 		"sounds": {
 			"type":"object",
 			"additionalProperties" : false,
@@ -43,16 +52,6 @@
 					}
 				}
 			}
-		},
-
-		"base": {
-			"type" : "object"
-		},
-		"templates": {
-			"type":"object",
-			"additionalProperties": {
-				"$ref" : "objectTemplate.json"
-			}
 		}
 	}
 }

+ 4 - 4
config/schemas/obstacle.json

@@ -17,6 +17,10 @@
 			"description": "Obstacles can be placed on specified specified battlefields",
 			"items": { "type" : "string" }
 		},
+		"absolute": {
+			"type": "boolean",
+			"description": "Should be used absolute or relative coordinates for obstacle. There is possible only one absolute obstacle"
+		},
 		"width": {
 			"type": "number",
 			"description": "Width ob obstacle"
@@ -41,10 +45,6 @@
 		"unknown": {
 			"type": "number",
 			"description": "Unknown field"
-		},
-		"absolute": {
-			"type": "boolean",
-			"description": "Should be used absolute or relative coordinates for obstacle. There is possible only one absolute obstacle"
 		}
 	}
 }

+ 9 - 9
config/schemas/river.json

@@ -3,25 +3,20 @@
 	"$schema": "http://json-schema.org/draft-04/schema",
 	"title" : "VCMI river format",
 	"description" : "Format used to define new rivers in VCMI",
-	"required" : [ "text", "shortIdentifier", "tilesFilename", "delta" ],
+	"required" : [ "shortIdentifier", "text", "tilesFilename", "delta" ],
 
 	"additionalProperties" : false,
 	"properties":{
-		"index" : 
+		"shortIdentifier":
 		{
-			"type": "number",
-			"description": "Internal, do not use"
+			"type": "string",
+			"description": "Two-letters unique indentifier for this road. Used in map format"
 		},
 		"text":
 		{
 			"type": "string",
 			"description": "Human-readable name of the river"
 		},
-		"shortIdentifier":
-		{
-			"type": "string",
-			"description": "Two-letters unique indentifier for this road. Used in map format"
-		},
 		"tilesFilename":
 		{
 			"type": "string",
@@ -32,6 +27,11 @@
 		{
 			"type": "string",
 			"description": "Name of file with river delta graphics"
+		},
+		"index" : 
+		{
+			"type": "number",
+			"description": "Internal, do not use"
 		}
 	}
 }

+ 9 - 9
config/schemas/road.json

@@ -3,25 +3,20 @@
 	"$schema": "http://json-schema.org/draft-04/schema",
 	"title" : "VCMI road format",
 	"description" : "Format used to define new roads in VCMI",
-	"required" : [ "text", "shortIdentifier", "tilesFilename", "moveCost" ],
+	"required" : [ "shortIdentifier", "text", "tilesFilename", "moveCost" ],
 
 	"additionalProperties" : false,
 	"properties":{
-		"index" : 
+		"shortIdentifier":
 		{
-			"type": "number",
-			"description": "Internal, do not use"
+			"type": "string",
+			"description": "Two-letters unique indentifier for this road. Used in map format"
 		},
 		"text":
 		{
 			"type": "string",
 			"description": "Human-readable name of the road"
 		},
-		"shortIdentifier":
-		{
-			"type": "string",
-			"description": "Two-letters unique indentifier for this road. Used in map format"
-		},
 		"tilesFilename":
 		{
 			"type": "string",
@@ -32,6 +27,11 @@
 		{
 			"type": "number",
 			"description": "How many movement points needed to move hero"
+		},
+		"index" : 
+		{
+			"type": "number",
+			"description": "Internal, do not use"
 		}
 	}
 }

+ 0 - 4
config/schemas/script.json

@@ -1,13 +1,9 @@
 {
 	"type" : "object",
 	"$schema" : "http://json-schema.org/draft-04/schema",
-
 	"title" : "VCMI script format",
 	"description" : "Format used to configure script environment",
-
-
 	"required" : ["source"],
-
 	"properties" : {
 		"source" : {
 			"type": "string",

+ 8 - 15
config/schemas/skill.json

@@ -1,18 +1,18 @@
 {
-
 	"type" : "object",
 	"$schema" : "http://json-schema.org/draft-04/schema",
-
 	"title" : "VCMI skill format",
 	"description" : "Format used to replace bonuses provided by secondary skills in VCMI",
-
 	"definitions" : {
-
 		"skillBonus" : {
 			"type" : "object",
 			"description" : "Set of bonuses provided by skill at given level",
 			"required" : ["description", "effects"],
 			"properties" : {
+				"description" : {
+					"type" : "string",
+					"description" : "localizable description"
+				},
 				"images" : {
 					"type" : "object",
 					"description" : "skill icons of varying size",
@@ -34,10 +34,6 @@
 						}
 					}
 				},
-				"description" : {
-					"type" : "string",
-					"description" : "localizable description"
-				},
 				"effects" : {
 					"type" : "object",
 					"additionalProperties" : {
@@ -46,20 +42,17 @@
 				}
 			}
 		}
-		
 	},
-
 	"required" : ["name", "basic", "advanced", "expert"],
-
 	"properties" : {
-		"index" : {
-			"type": "number",
-			"description": "numeric id of skill, required for existing skills"
-		},
 		"name" : {
 			"type": "string",
 			"description": "localizable skill name"
 		},
+		"index" : {
+			"type": "number",
+			"description": "numeric id of skill, required for existing skills"
+		},
 		"obligatoryMajor":{
 			"type": "boolean",
 			"description": "This skill is major obligatory (like H3 Wisdom)"

+ 39 - 61
config/schemas/spell.json

@@ -1,12 +1,8 @@
 {
-
 	"type":"object",
 	"$schema": "http://json-schema.org/draft-04/schema",
-
 	"title" : "VCMI spell format",
 	"description" : "Format used to define new spells in VCMI",
-
-
 	"definitions" : {
 		"animationQueue":{
 			"type": "array",
@@ -44,8 +40,8 @@
 					"items":{
 						"type": "object",
 						"properties":{
-							"minimumAngle": {"type":"number", "minimum" : 0},
-							"defName": {"type":"string", "format": "defFile"}
+							"defName": {"type":"string", "format": "defFile"},
+							"minimumAngle": {"type":"number", "minimum" : 0}
 						},
 						"additionalProperties" : false
 					}
@@ -60,7 +56,7 @@
 		},
 		"levelInfo":{
 			"type": "object",
-			"required":["range","description","cost","power","aiValue","range"],
+			"required":["range", "description", "cost", "power", "aiValue"],
 
 			"additionalProperties" : false,
 			"properties":{
@@ -75,14 +71,13 @@
 				"power":{
 					"type": "number"
 				},
-				"aiValue":{
-					"type": "number"
-				},
-
 				"range":{
 					"type": "string",
 					"description": "spell range description in SRSL"
 				},
+				"aiValue":{
+					"type": "number"
+				},
 				"effects":{
 					"type": "object",
 					"description": "Timed effects (updated by prolongation)",
@@ -125,46 +120,37 @@
 				}
 			}
 		},
-
 		"texts":{
 			"type": "object",
-
-
 			"additionalProperties" : false
 		}
 	},
-
 	"required" : ["type", "name", "school", "level", "power","gainChance","flags","levels"],
 	"additionalProperties" : false,
-
 	"properties": {
 		"index":{
 				"type": "number",
 				"description": "numeric id of spell required only for original spells, prohibited for new spells"
 		},
+		"name":{
+			"type": "string",
+			"description": "Localizable name"
+		},
 		"type":{
 				"type": "string",
 				"enum": ["adventure", "combat", "ability"],
 				"description":"Spell type"
 		},
-		"name":{
-				"type": "string",
-				"description": "Localizable name"
-
-		},
 		"school":{
 				"type": "object",
 				"description": "Spell schools",
 				"additionalProperties": false,
-
 				"properties":{
-
 						"air":{"type": "boolean"},
 						"fire":{"type": "boolean"},
 						"earth":{"type": "boolean"},
 						"water":{"type": "boolean"}
 				}
-
 		},
 		"level":{
 				"type": "number",
@@ -172,18 +158,15 @@
 				"minimum" : 0,
 				"maximum" : 5
 		},
-
 		"power":{
 				"type": "number",
 				"description": "Base power"
 		},
-
 		"defaultGainChance":{
 				"type": "number",
 				"description": "Gain chance by default for all factions"
 
 		},
-
 		"gainChance":{
 				"type": "object",
 				"description": "Chance in % to gain for faction. NOTE: this field is merged with faction config",
@@ -261,40 +244,37 @@
 			"additionalProperties" : true
 		},
 		"animation":{"$ref": "#/definitions/animation"},
-
 		"graphics":{
-				 "type": "object",
-				 "additionalProperties" : false,
-				 "properties":{
-						 "iconImmune":{
-							  "type": "string",
-							  "description": "Resourse path of icon for SPELL_IMMUNITY bonus (relative to DATA or SPRITES)",
-							  "format" : "imageFile"
-						 },
-						 "iconScenarioBonus":{
-							  "type": "string",
-							  "description": "Resourse path of icon for scenario bonus" ,
-							  "format" : "imageFile"
-						 },
-						 "iconEffect":{
-							  "type": "string",
-							  "description": "Resourse path of icon for spell effects during battle" ,
-							  "format" : "imageFile"
-						 },
-						 "iconBook":{
-							  "type": "string",
-							  "description":"Resourse path of icon for spellbook" ,
-							  "format" : "imageFile"
-						 },
-						 "iconScroll":{
-							  "type": "string",
-							  "description": "Resourse path of icon for spell scrolls",
-							  "format": "imageFile"
-						 }
-				 }
-
+			"type": "object",
+			"additionalProperties" : false,
+			"properties":{
+				"iconBook":{
+						"type": "string",
+						"description":"Resourse path of icon for spellbook" ,
+						"format" : "imageFile"
+				},
+				"iconScroll":{
+						"type": "string",
+						"description": "Resourse path of icon for spell scrolls",
+						"format": "imageFile"
+				},
+				"iconEffect":{
+					"type": "string",
+					"description": "Resourse path of icon for spell effects during battle" ,
+					"format" : "imageFile"
+				},
+				"iconImmune":{
+					"type": "string",
+					"description": "Resourse path of icon for SPELL_IMMUNITY bonus (relative to DATA or SPRITES)",
+					"format" : "imageFile"
+				},
+				"iconScenarioBonus":{
+					"type": "string",
+					"description": "Resourse path of icon for scenario bonus" ,
+					"format" : "imageFile"
+				}
+			}
 		},
-
 		"sounds":{
 			 "type": "object",
 			 "additionalProperties" : false,
@@ -305,12 +285,10 @@
 					 }
 			 }
 		},
-
 		"levels":{
 			 "type": "object",
 			 "additionalProperties" : false,
 			 "required" : ["none", "basic", "advanced", "expert"],
-
 			 "properties":{
 				"base":{
 					"type": "object",

+ 6 - 11
config/schemas/template.json

@@ -1,12 +1,8 @@
 {
-
 	"type":"object",
 	"$schema": "",
-
 	"title" : "VCMI random map template format",
 	"description" : "Format used to define random map templates in VCMI",
-
-
 	"definitions" :
 	{
 		"zone":{
@@ -35,14 +31,14 @@
 			}		
 		},
 		"type" :{
-			"enum": ["playerStart", "cpuStart", "treasure", "junction"],
+			"type":"string",
 			"additionalProperties" : false,
-			"type":"string"
+			"enum": ["playerStart", "cpuStart", "treasure", "junction"]
 		},
 		"size":{
 			"type": "number",
 			"minimum": 1,
-			"additionalProperties" : false,
+			"additionalProperties" : false
 		},
 		"connection":
 		{
@@ -68,9 +64,10 @@
 			"type": "string"
 		}
 	},
-
 	"properties":
 	{
+		"required" : ["zones", "connections"],
+		"additionalProperties" : false,
 		"zones":{
 			"type": "object",
 			"additionalProperties":{"$ref" : "#/definitions/zone"	}						
@@ -82,8 +79,6 @@
 		"allowedWaterContent": {
 			"type": "array",
 			"items": {"$ref" : "#/definitions/waterContent"}
-		},
-		"required" : ["zones", "connections"],
-		"additionalProperties" : false
+		}
 	}
 }

+ 54 - 55
config/schemas/terrain.json

@@ -4,51 +4,32 @@
 	"title" : "VCMI terrain format",
 	"description" : "Format used to define new terrains in VCMI",
 	"required" : [ "text", "moveCost", "minimapUnblocked", "minimapBlocked", "music", "tiles", "type", "horseSound", "horseSoundPenalty", "shortIdentifier", "battleFields" ],
-
 	"additionalProperties" : false,
 	"properties":{
-		"index" :
-		{
-			"type": "number",
-			"description": "Internal, do not use"
-		},
 		"text":
 		{
 			"type": "string",
 			"description": "Human-readable name of this terrain"
 		},
-		"moveCost":
-		{
-			"type": "number",
-			"description": "How many movement points needed to move hero"
-		},
-		"minimapUnblocked":
+		"shortIdentifier":
 		{
-			"type": "array",
-			"description": "Color of terrain on minimap without unpassable objects",
-			"minItems": 3,
-			"maxItems": 3,
-			"items":
-			{
-				"type": "number"
-			}
+			"type": "string",
+			"description": "Two-letters unique indentifier for this terrain. Used for map format"
 		},
-		"minimapBlocked":
+		"type":
 		{
 			"type": "array",
-			"description": "Color of terrain on minimap with unpassable objects",
-			"minItems": 3,
-			"maxItems": 3,
+			"description": "Type of this terrain. Can be land, water, subterranean or rock",
 			"items":
 			{
-				"type": "number"
+				"enum": ["LAND", "WATER", "SUB", "ROCK", "SURFACE"],
+				"type": "string"
 			}
 		},
-		"music":
+		"moveCost":
 		{
-			"type": "string",
-			"description": "Music filename to play on this terrain on adventure map",
-			"format": "musicFile"
+			"type": "number",
+			"description": "How many movement points needed to move hero"
 		},
 		"tiles":
 		{
@@ -56,16 +37,6 @@
 			"description": "Name of file with graphicks",
 			"format": "defFile"
 		},
-		"type":
-		{
-			"type": "array",
-			"description": "Type of this terrain. Can be land, water, subterranean or rock",
-			"items":
-			{
-				"enum": ["LAND", "WATER", "SUB", "ROCK", "SURFACE"],
-				"type": "string"
-			}
-		},
 		"rockTerrain":
 		{
 			"type": "string",
@@ -76,32 +47,43 @@
 			"type": "string",
 			"description": "River type which should be used for that terrain"
 		},
-		"horseSound":
-		{
-			"type": "string",
-			"description": "Hero movement sound for this terrain, version for moving on tiles with road",
-			"format": "soundFile"
-		},
-		"horseSoundPenalty":
+		"battleFields":
 		{
-			"type": "string",
-			"description": "Hero movement sound for this terrain, version for moving on tiles without road",
-			"format": "soundFile"
+			"type": "array",
+			"description": "array of battleFields for this terrain",
+			"items":
+			{
+				"type": "string"
+			}
 		},
-		"shortIdentifier":
+		"minimapUnblocked":
 		{
-			"type": "string",
-			"description": "Two-letters unique indentifier for this terrain. Used for map format"
+			"type": "array",
+			"description": "Color of terrain on minimap without unpassable objects",
+			"minItems": 3,
+			"maxItems": 3,
+			"items":
+			{
+				"type": "number"
+			}
 		},
-		"battleFields":
+		"minimapBlocked":
 		{
 			"type": "array",
-			"description": "array of battleFields for this terrain",
+			"description": "Color of terrain on minimap with unpassable objects",
+			"minItems": 3,
+			"maxItems": 3,
 			"items":
 			{
-				"type": "string"
+				"type": "number"
 			}
 		},
+		"music":
+		{
+			"type": "string",
+			"description": "Music filename to play on this terrain on adventure map",
+			"format": "musicFile"
+		},
 		"sounds":
 		{
 			"type": "object",
@@ -121,6 +103,18 @@
 				}
 			}
 		},
+		"horseSound":
+		{
+			"type": "string",
+			"description": "Hero movement sound for this terrain, version for moving on tiles with road",
+			"format": "soundFile"
+		},
+		"horseSoundPenalty":
+		{
+			"type": "string",
+			"description": "Hero movement sound for this terrain, version for moving on tiles without road",
+			"format": "soundFile"
+		},
 		"prohibitTransitions":
 		{
 			"type": "array",
@@ -139,6 +133,11 @@
 		{
 			"type": "string",
 			"description": "Can be normal, dirt, water, rock"
+		},
+		"index" :
+		{
+			"type": "number",
+			"description": "Internal, do not use"
 		}
 	}
 }

+ 19 - 21
config/schemas/townBuilding.json

@@ -4,7 +4,6 @@
 	"$schema": "http://json-schema.org/draft-04/schema",
 	"title" : "VCMI town building format",
 	"description" : "Format used to define town buildings in VCMI",
-
 	"definitions" :
 	{
 		"buildingRequirement" : {
@@ -22,26 +21,33 @@
 			}
 		} 
 	},
-
 	"properties":{
 		"id": {
 			"type":"number",
 			"description" : "Numeric identifier of this building"
 		},
+		"name" : {
+			"description" : "Name of this building",
+			"type" : "string"
+		},
+		"description" : {
+			"description" : "Full decsription of this building",
+			"type" : "string"
+		},
 		"type": {
 			"type":"string",
 			"description" : "Subtype for some special buildings"
 		},
-		"height": {
-			"type":"string",
-			"enum" : [ "skyship", "high", "average", "low"],
-			"description" : "Height for lookout towers and some grails"
-		},
 		"mode": {
 			"type":"string",
 			"enum" : [ "normal", "auto", "special", "grail" ],
 			"description" : "Mode in which this building will be built"
 		},
+		"height": {
+			"type":"string",
+			"enum" : [ "skyship", "high", "average", "low"],
+			"description" : "Height for lookout towers and some grails"
+		},
 		"requires": {
 			"$ref" : "#/definitions/buildingRequirement",
 			"description" : "List of town buildings that must be built before this one"
@@ -50,26 +56,18 @@
 			"description" : "If this building is upgrade, identifier of base building",
 			"type":"string"
 		},
-		"name" : {
-			"description" : "Name of this building",
-			"type" : "string"
-		},
-		"description" : {
-			"description" : "Full decsription of this building",
-			"type" : "string"
-		},
 		"cost": {
 			"type":"object",
 			"additionalProperties" : false,
 			"description": "Cost to build this building",
 			"properties":{
+				"gold":    { "type":"number"},
 				"wood":    { "type":"number"},
-				"mercury": { "type":"number"},
 				"ore":     { "type":"number"},
+				"mercury": { "type":"number"},
 				"sulfur":  { "type":"number"},
 				"crystal": { "type":"number"},
-				"gems":    { "type":"number"},
-				"gold":    { "type":"number"}
+				"gems":    { "type":"number"}
 			}
 	    },		
 		"produce": {
@@ -77,13 +75,13 @@
 			"additionalProperties" : false,
 			"description": "Resources this building produce each day",
 			"properties":{
+				"gold":    { "type":"number"},
 				"wood":    { "type":"number"},
-				"mercury": { "type":"number"},
 				"ore":     { "type":"number"},
+				"mercury": { "type":"number"},
 				"sulfur":  { "type":"number"},
 				"crystal": { "type":"number"},
-				"gems":    { "type":"number"},
-				"gold":    { "type":"number"}
+				"gems":    { "type":"number"}
 			}
 		},
 		"overrides": {

+ 50 - 53
config/schemas/townSiege.json

@@ -5,11 +5,9 @@
 	"title" : "VCMI siege screen format",
 	"description" : "Format used to define town siege screen in VCMI",
 	"required" : [
-		"gate", "imagePrefix", "moat", "shooter",
-		"towerIconLarge", "towerIconSmall",
-		"static", "towers", "walls"
+		"shooter", "towerIconLarge", "towerIconSmall", "imagePrefix", 
+		"static", "towers", "walls", "gate", "moat"
 	 ],
-	
 	"definitions" :
 	{
 		"point" : {
@@ -26,6 +24,10 @@
 			"additionalProperties" : false,
 			"required" : [ "battlement", "creature", "tower" ],
 			"properties":{
+				"tower": {
+					"description" : "Location of main segment of tower",
+					"$ref" : "#/definitions/point"
+				},
 				"battlement": {
 					"description" : "Location of battlement, part of tower that covers shooter",
 					"$ref" : "#/definitions/point"
@@ -33,50 +35,11 @@
 				"creature": {
 					"description" : "Location of shooter in tower",
 					"$ref" : "#/definitions/point"
-				},
-				"tower": {
-					"description" : "Location of main segment of tower",
-					"$ref" : "#/definitions/point"
 				}
 			}
 		}
 	},
-
 	"properties":{
-		"gate": {
-			"type":"object",
-			"additionalProperties" : false,
-			"description" : "Town gates",
-			"properties":{
-				"arch": {
-					"description" : "Static, top part of gates",
-					"$ref" : "#/definitions/point"
-				},
-				"gate": {
-					"description" : "Main section of gates",
-					"$ref" : "#/definitions/point"
-				}
-			}
-		},
-		"imagePrefix": {
-			"type":"string",
-			"description" : "Prefix to all images related to siege screen"
-		},
-		"moat": {
-			"type":"object",
-			"additionalProperties" : false,
-			"description" : "Castle moat description",
-			"properties":{
-				"bank": {
-					"description" : "Small section with bank of the moat",
-					"$ref" : "#/definitions/point"
-				},
-				"moat": {
-					"description" : "Main section of the moat",
-					"$ref" : "#/definitions/point"
-				}
-			}
-		},
 		"shooter": {
 			"type":"string",
 			"description" : "Identifier of creature that will be used as tower shooter"
@@ -91,6 +54,10 @@
 			"description": "Large icon for tower, used in battle queue",
 			"format" : "imageFile"
 		},
+		"imagePrefix": {
+			"type":"string",
+			"description" : "Prefix to all images related to siege screen"
+		},
 		"static": {
 			"type":"object",
 			"additionalProperties" : false,
@@ -100,13 +67,13 @@
 					"description" : "Very top section of the wall located above hero",
 					"$ref" : "#/definitions/point"
 				},
-				"bottom": {
-					"description" : "Bottom section located between destructible sections",
-					"$ref" : "#/definitions/point"
-				},
 				"top": {
 					"description" : "Top section located between destructible sections",
 					"$ref" : "#/definitions/point"
+				},
+				"bottom": {
+					"description" : "Bottom section located between destructible sections",
+					"$ref" : "#/definitions/point"
 				}
 			}
 		},
@@ -115,9 +82,9 @@
 			"additionalProperties" : false,
 			"description" : "Decription of towers",
 			"properties":{
-				"bottom": { "$ref" : "#/definitions/tower", "description" : "Bottom tower" },
+				"top":    { "$ref" : "#/definitions/tower", "description" : "Top tower" },
 				"keep":   { "$ref" : "#/definitions/tower", "description" : "Central keep" },
-				"top":    { "$ref" : "#/definitions/tower", "description" : "Top tower" }
+				"bottom": { "$ref" : "#/definitions/tower", "description" : "Bottom tower" }
 			}
 		},
 		"walls": {
@@ -125,6 +92,14 @@
 			"additionalProperties" : false,
 			"description" : "Destructible sections of the walls",
 			"properties":{
+				"upper": {
+					"description" : "Topmost section located near top tower",
+					"$ref" : "#/definitions/point"
+				},
+				"upperMid": {
+					"description" : "Second from top section located near gates",
+					"$ref" : "#/definitions/point"
+				},
 				"bottomMid": {
 					"description" : "Second from bottom section located near gates",
 					"$ref" : "#/definitions/point"
@@ -132,13 +107,35 @@
 				"bottom": {
 					"description" : "Bottommost section located near bottom tower",
 					"$ref" : "#/definitions/point"
+				}
+			}
+		},
+		"gate": {
+			"type":"object",
+			"additionalProperties" : false,
+			"description" : "Town gates",
+			"properties":{
+				"arch": {
+					"description" : "Static, top part of gates",
+					"$ref" : "#/definitions/point"
 				},
-				"upperMid": {
-					"description" : "Second from top section located near gates",
+				"gate": {
+					"description" : "Main section of gates",
+					"$ref" : "#/definitions/point"
+				}
+			}
+		},
+		"moat": {
+			"type":"object",
+			"additionalProperties" : false,
+			"description" : "Castle moat description",
+			"properties":{
+				"bank": {
+					"description" : "Small section with bank of the moat",
 					"$ref" : "#/definitions/point"
 				},
-				"upper": {
-					"description" : "Topmost section located near top tower",
+				"moat": {
+					"description" : "Main section of the moat",
 					"$ref" : "#/definitions/point"
 				}
 			}

+ 8 - 8
config/schemas/townStructure.json

@@ -6,6 +6,14 @@
 	"required": [ "animation", "x", "y"],
 	"additionalProperties" : false,
 	"properties":{
+		"builds": {
+			"type" : "string",
+			"description" : ""
+		},
+		"hidden": {
+			"type":"boolean",
+			"description" : "If upgrade, this building will replace parent animation but will not alter its behaviour"
+		},
 		"animation": {
 			"type":"string",
 			"description" : "Main animation file for this building",
@@ -21,14 +29,6 @@
 			"description" : "Golden border around building, displayed when building is selected",
 			"format" : "imageFile"
 		},
-		"builds": {
-			"type" : "string",
-			"description" : ""
-		},
-		"hidden": {
-			"type":"boolean",
-			"description" : "If upgrade, this building will replace parent animation but will not alter its behaviour"
-		},
 		"x": {
 			"type":"number",
 			"description" : "Position on screen"