mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Updated terrain/river/road schema, added docs
This commit is contained in:
		| @@ -9,7 +9,7 @@ | ||||
| 		"shortIdentifier" : | ||||
| 		{ | ||||
| 			"type" : "string", | ||||
| 			"description" : "Two-letters unique indentifier for this road. Used in map format" | ||||
| 			"description" : "Two-letters unique indentifier for this river. Used in map format" | ||||
| 		}, | ||||
| 		"text" : | ||||
| 		{ | ||||
| @@ -29,7 +29,7 @@ | ||||
| 		}, | ||||
| 		"paletteAnimation" : { | ||||
| 			"type" : "array", | ||||
| 			"description" : "If defined, terrain will be animated using palette color cycling effect", | ||||
| 			"description" : "If defined, river will be animated using palette color cycling effect", | ||||
| 			"items" : | ||||
| 			{ | ||||
| 				"type" : "object", | ||||
|   | ||||
| @@ -22,7 +22,7 @@ | ||||
| 			"description" : "Type of this terrain. Can be land, water, subterranean or rock", | ||||
| 			"items" : | ||||
| 			{ | ||||
| 				"enum" : ["LAND", "WATER", "SUB", "ROCK", "SURFACE"], | ||||
| 				"enum" : ["WATER", "SUB", "ROCK", "SURFACE"], | ||||
| 				"type" : "string" | ||||
| 			} | ||||
| 		}, | ||||
| @@ -67,7 +67,7 @@ | ||||
| 		"battleFields" : | ||||
| 		{ | ||||
| 			"type" : "array", | ||||
| 			"description" : "array of battleFields for this terrain", | ||||
| 			"description" : "List of battleFields that can be used on this terrain", | ||||
| 			"items" : | ||||
| 			{ | ||||
| 				"type" : "string" | ||||
| @@ -76,7 +76,7 @@ | ||||
| 		"minimapUnblocked" : | ||||
| 		{ | ||||
| 			"type" : "array", | ||||
| 			"description" : "Color of terrain on minimap without unpassable objects", | ||||
| 			"description" : "Color of terrain on minimap without unpassable objects. RGB triplet, 0-255 range", | ||||
| 			"minItems" : 3, | ||||
| 			"maxItems" : 3, | ||||
| 			"items" : | ||||
| @@ -87,7 +87,7 @@ | ||||
| 		"minimapBlocked" : | ||||
| 		{ | ||||
| 			"type" : "array", | ||||
| 			"description" : "Color of terrain on minimap with unpassable objects", | ||||
| 			"description" : "Color of terrain on minimap with unpassable objects. RGB triplet, 0-255 range", | ||||
| 			"minItems" : 3, | ||||
| 			"maxItems" : 3, | ||||
| 			"items" : | ||||
| @@ -104,14 +104,14 @@ | ||||
| 		"sounds" : | ||||
| 		{ | ||||
| 			"type" : "object", | ||||
| 			"description" : "list of sounds for this terrain", | ||||
| 			"description" : "List of sounds for this terrain", | ||||
| 			"additionalProperties" : false, | ||||
| 			"properties" : | ||||
| 			{ | ||||
| 				"ambient" :  | ||||
| 				{ | ||||
| 					"type" : "array", | ||||
| 					"description" : "list of ambient sounds for this terrain", | ||||
| 					"description" : "List of ambient sounds for this terrain", | ||||
| 					"items" : | ||||
| 					{ | ||||
| 						"type" : "string", | ||||
| @@ -135,7 +135,7 @@ | ||||
| 		"prohibitTransitions" : | ||||
| 		{ | ||||
| 			"type" : "array", | ||||
| 			"description" : "array or terrain names, which is prohibited to make transition from/to", | ||||
| 			"description" : "List or terrain names, which is prohibited to make transition from/to", | ||||
| 			"items" : | ||||
| 			{ | ||||
| 				"type" : "string" | ||||
| @@ -149,7 +149,7 @@ | ||||
| 		"terrainViewPatterns" : | ||||
| 		{ | ||||
| 			"type" : "string", | ||||
| 			"description" : "Can be normal, dirt, water, rock" | ||||
| 			"description" : "Represents layout of tile orientations in terrain tiles file" | ||||
| 		}, | ||||
| 		"index" : | ||||
| 		{ | ||||
|   | ||||
| @@ -1,3 +1,31 @@ | ||||
| < [Documentation](../../Readme.md) / [Modding](../Readme.md) / Entities Format / River Format | ||||
|  | ||||
| TODO | ||||
| ## Format | ||||
|  | ||||
| ```jsonc | ||||
| "newRiver" : | ||||
| { | ||||
| 	// Two-letters unique indentifier for this river. Used in map format | ||||
| 	"shortIdentifier" : "mr", | ||||
| 	 | ||||
| 	// Human-readable name of the river | ||||
| 	"text" : "My Road", | ||||
| 	 | ||||
| 	// Name of file with river graphics | ||||
| 	"tilesFilename" : "myRiver.def" | ||||
| 	 | ||||
| 	// Name of file with river delta graphics | ||||
| 	// TODO: describe how exactly to use this tricky field | ||||
| 	"delta" : "", | ||||
| 	 | ||||
| 	// If defined, river will be animated using palette color cycling effect | ||||
| 	// Game will cycle "length" colors starting from "start" (zero-based index) on each animation update every 180ms | ||||
| 	// Color numbering uses palette color indexes, as seen in image editor | ||||
| 	// Note that some tools for working with .def files may reorder palette.  | ||||
| 	// To avoid this, it is possible to use json with indexed png images instead of def files | ||||
| 	"paletteAnimation" : [ | ||||
| 		{ "start" : 10, "length" : 5 }, | ||||
| 		... | ||||
| 	] | ||||
| } | ||||
| ``` | ||||
| @@ -1,3 +1,20 @@ | ||||
| < [Documentation](../../Readme.md) / [Modding](../Readme.md) / Entities Format / Road Format | ||||
|  | ||||
| TODO | ||||
| ## Format | ||||
|  | ||||
| ```jsonc | ||||
| "newRoad" : | ||||
| { | ||||
| 	// Two-letters unique indentifier for this road. Used in map format | ||||
| 	"shortIdentifier" : "mr", | ||||
| 	 | ||||
| 	// Human-readable name of the road | ||||
| 	"text" : "My Road", | ||||
| 	 | ||||
| 	// Name of file with road graphics | ||||
| 	"tilesFilename" : "myRoad.def" | ||||
| 	 | ||||
| 	// How many movement points needed to move hero | ||||
| 	"moveCost" : 66 | ||||
| } | ||||
| ``` | ||||
| @@ -1,3 +1,78 @@ | ||||
| < [Documentation](../../Readme.md) / [Modding](../Readme.md) / Entities Format / Terrain Format | ||||
|  | ||||
| TODO | ||||
| ## Format | ||||
|  | ||||
| ```jsonc | ||||
| "newTerrain" : | ||||
| { | ||||
| 	// Two-letters unique indentifier for this terrain. Used in map format | ||||
| 	"shortIdentifier" : "mt", | ||||
| 	 | ||||
| 	// Human-readable name of the terrain | ||||
| 	"text" : "My Road", | ||||
| 	 | ||||
| 	// Type(s) of this terrain. | ||||
| 	// WATER - this terrain is water-like terrains that requires boat for movement | ||||
| 	// ROCK - this terrain is unpassable "rock" terrain that is used for inacessible parts of underground layer | ||||
| 	// SUB - this terrain can be placed in underground map layer by RMG | ||||
| 	// SURFACE - this terrain can be placed in surface map layer by RMG | ||||
| 	"type" : [ "WATER", "SUB", "ROCK", "SURFACE" ], | ||||
| 	 | ||||
| 	// Name of file with road graphics | ||||
| 	"tiles" : "myRoad.def", | ||||
| 	 | ||||
| 	// How many movement points needed to move hero on this terrain | ||||
| 	"moveCost" : 150, | ||||
| 	 | ||||
| 	// The name of rock type terrain which will be used as borders in the underground | ||||
| 	// By default, H3 terrain "rock" will be used | ||||
| 	"rockTerrain" : "rock", | ||||
| 	 | ||||
| 	// River type which should be used for that terrain | ||||
| 	"river" : "", | ||||
| 	 | ||||
| 	// If defined, terrain will be animated using palette color cycling effect | ||||
| 	// Game will cycle "length" colors starting from "start" (zero-based index) on each animation update every 180ms | ||||
| 	// Color numbering uses palette color indexes, as seen in image editor | ||||
| 	// Note that some tools for working with .def files may reorder palette.  | ||||
| 	// To avoid this, it is possible to use json with indexed png images instead of def files | ||||
| 	"paletteAnimation" : [ | ||||
| 		{ "start" : 10, "length" : 5 }, | ||||
| 		... | ||||
| 	], | ||||
| 	 | ||||
| 	// List of battleFields that can be used on this terrain | ||||
| 	"battleFields" : [ ] | ||||
| 	 | ||||
| 	// Color of terrain on minimap without unpassable objects. RGB triplet, 0-255 range | ||||
| 	"minimapUnblocked" : [ 150, 100, 50 ], | ||||
| 	 | ||||
| 	// Color of terrain on minimap with unpassable objects. RGB triplet, 0-255 range | ||||
| 	"minimapBlocked" : [ 150, 100, 50 ], | ||||
| 	 | ||||
| 	// Music filename to play on this terrain on adventure map | ||||
| 	"music" : "", | ||||
| 	 | ||||
| 	"sounds" : { | ||||
| 		// List of ambient sounds for this terrain | ||||
| 		"ambient" : [ "" ] | ||||
| 	}, | ||||
| 	 | ||||
| 	// Hero movement sound for this terrain, version for moving on tiles with road | ||||
| 	"horseSound" : "", | ||||
| 	 | ||||
| 	// Hero movement sound for this terrain, version for moving on tiles without road | ||||
| 	"horseSoundPenalty" : "", | ||||
| 	 | ||||
| 	// List or terrain names, which is prohibited to make transition from/to | ||||
| 	"prohibitTransitions" : [ "" ], | ||||
| 	 | ||||
| 	// If sand/dirt transition required from/to other terrains | ||||
| 	"transitionRequired" : false, | ||||
| 	 | ||||
| 	// Represents layout of tile orientations in terrain tiles file | ||||
| 	// Can be normal, dirt, water, rock, or hota | ||||
| 	"terrainViewPatterns" : "", | ||||
| 	 | ||||
| } | ||||
| ``` | ||||
| @@ -58,7 +58,6 @@ TerrainType * TerrainTypeHandler::loadFromJson( const std::string & scope, const | ||||
| 	{ | ||||
| 		//Set bits | ||||
| 		const auto & s = node.String(); | ||||
| 		if (s == "LAND") info->passabilityType |= TerrainType::PassabilityType::LAND; | ||||
| 		if (s == "WATER") info->passabilityType |= TerrainType::PassabilityType::WATER; | ||||
| 		if (s == "ROCK") info->passabilityType |= TerrainType::PassabilityType::ROCK; | ||||
| 		if (s == "SURFACE") info->passabilityType |= TerrainType::PassabilityType::SURFACE; | ||||
|   | ||||
| @@ -44,7 +44,7 @@ class DLL_LINKAGE TerrainType : public EntityT<TerrainId> | ||||
|  | ||||
| 	enum PassabilityType : ui8 | ||||
| 	{ | ||||
| 		LAND = 1, | ||||
| 		//LAND = 1, | ||||
| 		WATER = 2, | ||||
| 		SURFACE = 4, | ||||
| 		SUBTERRANEAN = 8, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user