Modding FAQ

Hi again!
I’ve found over the net a pack with new custom boat sprites. I’ve wanted to make mod that adds these sprites to the ‘core’ of existing boat graphics and allow game to randomly choose these ones in the moment of buiyng. So I’ve wriiten such code:

{
	"core:boat" : {
		"base" : {
			"base" : {
				"visitableFrom" :  "+++", "+-+", "+++" ],
				"mask" :  "VVV", "VAV" ]
			}
		},
		"types" : {
			"evil" : { 
				"templates" : {
					"AB01_.def" : 
					{ "animation" : "AB01_.def", //original h3 evil def
					  "editorAnimation": "avxboat0.def"
					},
					"boat07.def" :
					{ "animation" : "boat07.def",
					  "editorAnimation": "boat07ed.def"
					},
					"boat10.def" : 
					{ "animation" : "boat10.def",
					  "editorAnimation": "boat10ed.def"
					},
					"boat11.def" : 
					{ "animation" : "boat11.def",
					  "editorAnimation": "boat11ed.def"
					},
					"boat20.def" : 
					{ "animation" : "boat20.def",
					  "editorAnimation": "boat20ed.def"
					},
					"boat0a.def" : 
					{ "animation" : "boat0a.def",
					  "editorAnimation": "boat0aed.def"
					},
					"boat0c.def" : 
					{ "animation" : "boat0c.def",
					  "editorAnimation": "boat0ced.def"
					},
					"boat0f.def" : 
					{ "animation" : "boat0f.def",
					  "editorAnimation": "boat0fed.def"
					},
					"boat0l.def" : 
					{ "animation" : "boat0l.def",
					  "editorAnimation": "boat0led.def"
					}	
				}
			},	
			"good" : {
				"templates" : {
					"AB02_.def" : 
					{ "animation" : "AB02_.def", //original h3 good def
					  "editorAnimation": "avxboat1.def"
					},
					"boat00.def" : 
					{ "animation" : "boat00.def",
					  "editorAnimation": "boat00ed.def"
					},
					"boat01.def" : 
					{ "animation" : "boat01.def",
					  "editorAnimation": "boat01ed.def"
					},
					"boat02.def" : 
					{ "animation" : "boat02.def",
					  "editorAnimation": "boat02ed.def"
					},
					"boat04.def" : 
					{ "animation" : "boat04.def",
					  "editorAnimation": "boat04ed.def"
					},
					"boat06.def" : 
					{ "animation" : "boat06.def",
					  "editorAnimation": "boat06ed.def"
					},
					"boat09.def" : 
					{ "animation" : "boat09.def",
					  "editorAnimation": "boat09ed.def"
					},
					"boat0i.def" : 
					{ "animation" : "boat0i.def",
					  "editorAnimation": "boat0ied.def"
					},
					"boat0j.def" : 
					{ "animation" : "boat0j.def",
					  "editorAnimation": "boat0jed.def"
					},
					"boat0m.def" : 
					{ "animation" : "boat0m.def",
					  "editorAnimation": "boat0med.def"
					}
				}
			},	
			"neutral" : {
				"templates" : {
					"AB03_.def" : 
					{ "animation" : "AB03_.def", //original h3 neutral def
					  "editorAnimation": "avxboat2.def"
					},
					"boat03.def" : 
					{ "animation" : "boat03.def",
					  "editorAnimation": "boat03ed.def"
					},
					"boat05.def" : 
					{ "animation" : "boat05.def",
					  "editorAnimation": "boat05ed.def"
					},
					"boat08.def" : 
					{ "animation" : "boat08.def",
					  "editorAnimation": "boat08ed.def"
					},
					"boat0b.def" : 
					{ "animation" : "boat0b.def",
					  "editorAnimation": "boat0bed.def"
					},
					"boat0d.def" : 
					{ "animation" : "boat0d.def",
					  "editorAnimation": "boat0ded.def"
					},
					"boat0e.def" : 
					{ "animation" : "boat0e.def",
					  "editorAnimation": "boat0eed.def"
					},
					"boat0g.def" : 
					{ "animation" : "boat0g.def",
					  "editorAnimation": "boat0ged.def"
					},
					"boat0h.def" : 
					{ "animation" : "boat0h.def",
					  "editorAnimation": "boat0hed.def"
					},
					"boat0k.def" : 
					{ "animation" : "boat0k.def",
					  "editorAnimation": "boat0ked.def"
					}					
				}
			}	
		}
	}
}

New sprites appear in the editor map (see screenshot) but in game there aren’t any changes - when I buy the boat - standard h3 defs are show :frowning: Did not I understand what is “template” command for?
:frowning:


Boat type for Shipyard is hardcoded and can’t be changed via config.

Oh, too bad…
So let this mod can be treated as map editor plugin and in the future let mapmakers put these sprites on their maps :slight_smile:
mediafire.com/file/i8qre3db9 … s_v1.0.zip

Hm… I’ve made another mod, which doesn’t work and I don’t know why :frowning:
Some time ago, J.M.Sower made Castle graphic depending on terrain.


Because VCMI can allow spawning objects depends on terrain type so I wrote a code:

{
	"core:castle" :
	{
		"town" :
		{
			"mapObject" :
			{
				"castle" : {
					"templates" :  
						{ 
							"dirt" :
								{
									"animation" : "castle-dirt/dirtCastleCastle.def",
									"allowedTerrains":  "dirt" ]
								},
							"snow" :
								{
									"animation" : "castle-snow/snowCastleCastle.def",
									"allowedTerrains":  "snow" ]
								},
							"grass" :
								{
									"animation" : "castle-grass/grassCastleCastle.def",
									"allowedTerrains":  "grass" ]
								},
							"lava" :
								{
									"animation" : "castle-lava/lavaCastleCastle.def",
									"allowedTerrains":  "lava" ]
								},
							"rough" :
								{
									"animation" : "castle-rough/roughCastleCastle.def",
									"allowedTerrains":  "rough" ]
								},
							"sand" :
								{
									"animation" : "castle-sand/sandCastleCastle.def",
									"allowedTerrains":  "sand" ]
								},
							"subterra" :
								{
									"animation" : "castle-subterra/subterraCastleCastle.def",
									"allowedTerrains":  "subterra" ]
								},
							"swamp" :
								{
									"animation" : "castle-swamp/swampCastleCastle.def",
									"allowedTerrains":  "swamp" ]
								}
						}
					},	
				"citadel" : { 
					"templates" : 
						{
							"dirt" :
								{
									"animation" : "castle-dirt/dirtCastleCitadel.def",
									"allowedTerrains":  "dirt" ]
								},
							"snow" :
								{
									"animation" : "castle-snow/snowCastleCitadel.def",
									"allowedTerrains":  "snow" ]
								},
							"grass" :
								{
									"animation" : "castle-grass/grassCastleCitadel.def",
									"allowedTerrains":  "grass" ]
								},
							"lava" :
								{
									"animation" : "castle-lava/lavaCastleCitadel.def",
									"allowedTerrains":  "lava" ]
								},
							"rough" :
								{
									"animation" : "castle-rough/roughCastleCitadel.def",
									"allowedTerrains":  "rough" ]
								},
							"sand" :
								{
									"animation" : "castle-sand/sandCastleCitadel.def",
									"allowedTerrains":  "sand" ]
								},
							"subterra" :
								{
									"animation" : "castle-subterra/subterraCastleCitadel.def",
									"allowedTerrains":  "subterra" ]
								},
							"swamp" :
								{
									"animation" : "castle-swamp/swampCastleCitadel.def",
									"allowedTerrains":  "swamp" ]
								} 
						}
					},	
				"fort" : { 
					"templates" :  
						{ 
						"dirt" :
								{
									"animation" : "castle-dirt/dirtCastleFort.def",
									"allowedTerrains":  "dirt" ]
								},
							"snow" :
								{
									"animation" : "castle-snow/snowCastleFort.def",
									"allowedTerrains":  "snow" ]
								},
							"grass" :
								{
									"animation" : "castle-grass/grassCastleFort.def",
									"allowedTerrains":  "grass" ]
								},
							"lava" :
								{
									"animation" : "castle-lava/lavaCastleFort.def",
									"allowedTerrains":  "lava" ]
								},
							"rough" :
								{
									"animation" : "castle-rough/roughCastleFort.def",
									"allowedTerrains":  "rough" ]
								},
							"sand" :
								{
									"animation" : "castle-sand/sandCastleFort.def",
									"allowedTerrains":  "sand" ]
								},
							"subterra" :
								{
									"animation" : "castle-subterra/subterraCastleFort.def",
									"allowedTerrains":  "subterra" ]
								},
							"swamp" :
								{
									"animation" : "castle-swamp/swampCastleFort.def",
									"allowedTerrains":  "swamp" ]
								} 
						}
					},	
				"village" : {
					"templates" :
						{ 
						"dirt" :
								{
									"animation" : "castle-dirt/dirtCastleVillage.def",
									"allowedTerrains":  "dirt" ]
								},
							"snow" :
								{
									"animation" : "castle-snow/snowCastleVillage.def",
									"allowedTerrains":  "snow" ]
								},
							"grass" :
								{
									"animation" : "castle-grass/grassCastleVillage.def",
									"allowedTerrains":  "grass" ]
								},
							"lava" :
								{
									"animation" : "castle-lava/lavaCastleVillage.def",
									"allowedTerrains":  "lava" ]
								},
							"rough" :
								{
									"animation" : "castle-rough/roughCastleVillage.def",
									"allowedTerrains":  "rough" ]
								},
							"sand" :
								{
									"animation" : "castle-sand/sandCastleVillage.def",
									"allowedTerrains":  "sand" ]
								},
							"subterra" :
								{
									"animation" : "castle-subterra/subterraCastleVillage.def",
									"allowedTerrains":  "subterra" ]
								},
							"swamp" :
								{
									"animation" : "castle-swamp/swampCastleVillage.def",
									"allowedTerrains":  "swamp" ]
								} 
						}
					},	
				"capitol" : {
					"templates" :
						{ 
						"dirt" :
								{
									"animation" : "castle-dirt/dirtCastleCapitol.def",
									"allowedTerrains":  "dirt" ]
								},
							"snow" :
								{
									"animation" : "castle-snow/snowCastleCapitol.def",
									"allowedTerrains":  "snow" ]
								},
							"grass" :
								{
									"animation" : "castle-grass/grassCastleCapitol.def",
									"allowedTerrains":  "grass" ]
								},
							"lava" :
								{
									"animation" : "castle-lava/lavaCastleCapitol.def",
									"allowedTerrains":  "lava" ]
								},
							"rough" :
								{
									"animation" : "castle-rough/roughCastleCapitol.def",
									"allowedTerrains":  "rough" ]
								},
							"sand" :
								{
									"animation" : "castle-sand/sandCastleCapitol.def",
									"allowedTerrains":  "sand" ]
								},
							"subterra" :
								{
									"animation" : "castle-subterra/subterraCastleCapitol.def",
									"allowedTerrains":  "subterra" ]
								},
							"swamp" :
								{
									"animation" : "castle-swamp/swampCastleCapitol.def",
									"allowedTerrains":  "swamp" ]
								} 
						}
				}	
			
			}
		}
	}
}

Aim was to generate diffirent Castle defs at particular terrains in random maps. But… mod doesn’t work :frowning:
Castle always is set with standard grass base and defs aren’t placed in map editor.
Maybe someone skilled will look at my mod in free time…
www53.zippyshare.com/v/iM4b7ZuS/file.html

I made my castle terrain replacement this way:

	"core:castle" : {
		"town" : {
			"mapObject" : {
				"filters" : {
					"village_1_dirt": "allOf","villageHall"],"noneOf",  "fort" ],"tavern"],"blacksmith"],"mageGuild1"],"marketplace"],"townHall"]]]  ,				
					"village_2_dirt": "allOf","villageHall"],"tavern"],"noneOf",  "fort" ],"blacksmith"],"mageGuild1"],"marketplace"],"townHall"]]]  ,				
					"village_3_dirt": "allOf","villageHall"],"tavern"],"blacksmith"],"mageGuild1"],"marketplace"],"noneOf",  "fort" ],"townHall"]] ] ,	
					"village_dirt": "allOf","villageHall"],"tavern"],"marketplace"],"mageGuild1"],"townHall"],"noneOf",  "fort" ]]  ],
					"fort_dirt" :  "allOf",  "fort" ],  "noneOf",  "citadel" ] ] ],
					"citadel_dirt" :  "allOf",  "citadel" ],  "noneOf",  "castle" ] ] ],
					"castle_dirt" :  "allOf",  "castle" ],  "noneOf",  "capitol" ] ] ],
					"capitol_dirt" :  "allOf",  "castle"  ],  "capitol"  ] ],
					
					"village_1": "allOf","villageHall"],"noneOf",  "fort" ],"tavern"],"blacksmith"],"mageGuild1"],"marketplace"],"townHall"]]]  ,				
					"village_2": "allOf","villageHall"],"tavern"],"noneOf",  "fort" ],"blacksmith"],"mageGuild1"],"marketplace"],"townHall"]]]  ,				
					"village_3": "allOf","villageHall"],"tavern"],"blacksmith"],"mageGuild1"],"marketplace"],"noneOf",  "fort" ],"townHall"]]]  ,	
					"village": "allOf","villageHall"],"tavern"],"marketplace"],"mageGuild1"],"townHall"],"noneOf",  "fort" ]]  ],
					"fort" :  "allOf",  "fort" ],  "noneOf",  "citadel" ] ] ],
					"citadel" :  "allOf",  "citadel" ],  "noneOf",  "castle" ] ] ],
					"castle" :  "allOf",  "castle" ],  "noneOf",  "capitol" ] ] ],
					"capitol" :  "allOf",  "castle"  ],  "capitol"  ] ],
					
					"village_1_lava": "allOf","villageHall"],"noneOf",  "fort" ],"tavern"],"blacksmith"],"mageGuild1"],"marketplace"],"townHall"]]]  ,				
					"village_2_lava": "allOf","villageHall"],"tavern"],"noneOf",  "fort" ],"blacksmith"],"mageGuild1"],"marketplace"],"townHall"]]]  ,				
					"village_3_lava": "allOf","villageHall"],"tavern"],"blacksmith"],"mageGuild1"],"marketplace"],"noneOf",  "fort" ],"townHall"]]]  ,	
					"village_lava": "allOf","villageHall"],"tavern"],"marketplace"],"mageGuild1"],"townHall"],"noneOf",  "fort" ]]  ],
					"fort_lava" :  "allOf",  "fort" ],  "noneOf",  "citadel" ] ] ],
					"citadel_lava" :  "allOf",  "citadel" ],  "noneOf",  "castle" ] ] ],
					"castle_lava" :  "allOf",  "castle" ],  "noneOf",  "capitol" ] ] ],
					"capitol_lava" :  "allOf",  "castle"  ],  "capitol"  ] ],
					
					"village_1_rough": "allOf","villageHall"],"noneOf",  "fort" ],"tavern"],"blacksmith"],"mageGuild1"],"marketplace"],"townHall"]]]  ,				
					"village_2_rough": "allOf","villageHall"],"tavern"],"noneOf",  "fort" ],"blacksmith"],"mageGuild1"],"marketplace"],"townHall"]]]  ,				
					"village_3_rough": "allOf","villageHall"],"tavern"],"blacksmith"],"mageGuild1"],"marketplace"],"noneOf",  "fort" ],"townHall"]]]  ,	
					"village_rough": "allOf","villageHall"],"tavern"],"marketplace"],"mageGuild1"],"townHall"],"noneOf",  "fort" ]]  ],
					"fort_rough" :  "allOf",  "fort" ],  "noneOf",  "citadel" ] ] ],
					"citadel_rough" :  "allOf",  "citadel" ],  "noneOf",  "castle" ] ] ],
					"castle_rough" :  "allOf",  "castle" ],  "noneOf",  "capitol" ] ] ],
					"capitol_rough" :  "allOf",  "castle"  ],  "capitol"  ] ],
					
					"village_1_sand": "allOf","villageHall"],"noneOf",  "fort" ],"tavern"],"blacksmith"],"mageGuild1"],"marketplace"],"townHall"]]]  ,				
					"village_2_sand": "allOf","villageHall"],"tavern"],"noneOf",  "fort" ],"blacksmith"],"mageGuild1"],"marketplace"],"townHall"]]]  ,				
					"village_3_sand": "allOf","villageHall"],"tavern"],"blacksmith"],"mageGuild1"],"marketplace"],"noneOf",  "fort" ],"townHall"]]]  ,	
					"village_sand": "allOf","villageHall"],"tavern"],"marketplace"],"mageGuild1"],"townHall"],"noneOf",  "fort" ]]  ],
					"fort_sand" :  "allOf",  "fort" ],  "noneOf",  "citadel" ] ] ],
					"citadel_sand" :  "allOf",  "citadel" ],  "noneOf",  "castle" ] ] ],
					"castle_sand" :  "allOf",  "castle" ],  "noneOf",  "capitol" ] ] ],					
					"capitol_sand" :  "allOf",  "castle"  ],  "capitol"  ] ],
					
					"village_1_snow": "allOf","villageHall"],"noneOf",  "fort" ],"tavern"],"blacksmith"],"mageGuild1"],"marketplace"],"townHall"]]]  ,				
					"village_2_snow": "allOf","villageHall"],"tavern"],"noneOf",  "fort" ],"blacksmith"],"mageGuild1"],"marketplace"],"townHall"]]]  ,				
					"village_3_snow": "allOf","villageHall"],"tavern"],"blacksmith"],"mageGuild1"],"marketplace"],"noneOf",  "fort" ],"townHall"]]]  ,	
					"village_snow": "allOf","villageHall"],"tavern"],"marketplace"],"mageGuild1"],"townHall"],"noneOf",  "fort" ]]  ],
					"fort_snow" :  "allOf",  "fort" ],  "noneOf",  "citadel" ] ] ],
					"citadel_snow" :  "allOf",  "citadel" ],  "noneOf",  "castle" ] ] ],
					"castle_snow" :  "allOf",  "castle" ],  "noneOf",  "capitol" ] ] ],		
					"capitol_snow" :  "allOf",  "castle"  ],  "capitol"  ] ],
					
					"village_1_subterra": "allOf","villageHall"],"noneOf",  "fort" ],"tavern"],"blacksmith"],"mageGuild1"],"marketplace"],"townHall"]]]  ,				
					"village_2_subterra": "allOf","villageHall"],"tavern"],"noneOf",  "fort" ],"blacksmith"],"mageGuild1"],"marketplace"],"townHall"]]]  ,				
					"village_3_subterra": "allOf","villageHall"],"tavern"],"blacksmith"],"mageGuild1"],"marketplace"],"noneOf",  "fort" ],"townHall"]]]  ,	
					"village_subterra": "allOf","villageHall"],"tavern"],"marketplace"],"mageGuild1"],"townHall"],"noneOf",  "fort" ]]  ],
					"fort_subterra" :  "allOf",  "fort" ],  "noneOf",  "citadel" ] ] ],
					"citadel_subterra" :  "allOf",  "citadel" ],  "noneOf",  "castle" ] ] ],
					"castle_subterra" :  "allOf",  "castle" ],  "noneOf",  "capitol" ] ] ],	
					"capitol_subterra" :  "allOf",  "castle"  ],  "capitol"  ] ],
					
					"village_1_swamp": "allOf","villageHall"],"noneOf",  "fort" ],"tavern"],"blacksmith"],"mageGuild1"],"marketplace"],"townHall"]]]  ,				
					"village_2_swamp": "allOf","villageHall"],"tavern"],"noneOf",  "fort" ],"blacksmith"],"mageGuild1"],"marketplace"],"townHall"]]]  ,				
					"village_3_swamp": "allOf","villageHall"],"tavern"],"blacksmith"],"mageGuild1"],"marketplace"],"noneOf",  "fort" ],"townHall"]]]  ,	
					"village_swamp": "allOf","villageHall"],"tavern"],"marketplace"],"mageGuild1"],"townHall"],"noneOf",  "fort" ]]  ],
					"fort_swamp" :  "allOf",  "fort" ],  "noneOf",  "citadel" ] ] ],
					"citadel_swamp" :  "allOf",  "citadel" ],  "noneOf",  "castle" ] ] ],
					"castle_swamp" :  "allOf",  "castle" ],  "noneOf",  "capitol" ] ] ],						
					"capitol_swamp" :  "allOf",  "castle"  ],  "capitol"  ] ]
					},
				"templates" : {
					"village_1_dirt": {"allowedTerrains":"dirt"], "animation" : "newlook_castle/CastleDirtHall"},
					"village_2_dirt": {"allowedTerrains":"dirt"], "animation" : "newlook_castle/CastleDirtHall"},
					"village_3_dirt": {"allowedTerrains":"dirt"], "animation" : "newlook_castle/CastleDirtHall"},
					"village_dirt": {"allowedTerrains":"dirt"], "animation" : "newlook_castle/CastleDirtHall"},
					"fort_dirt" : {"allowedTerrains":"dirt"], "animation" : "newlook_castle/CastleDirtCastle1"},
					"citadel_dirt" : {"allowedTerrains":"dirt"], "animation" : "newlook_castle/CastleDirtCastle2"},
					"castle_dirt" : {"allowedTerrains":"dirt"], "animation" : "newlook_castle/CastleDirtCastle3"},
					"capitol_dirt" : {"allowedTerrains":"dirt"], "animation" : "newlook_castle/CastleDirtCastle3F"},

					"village_1": {"allowedTerrains":"grass"], "animation" : "build_castle/CastleGrassBuild1"},
					"village_2": {"allowedTerrains":"grass"], "animation" : "build_castle/CastleGrassBuild2"},
					"village_3": {"allowedTerrains":"grass"], "animation" : "build_castle/CastleGrassBuild3"},
					"village": {"allowedTerrains":"grass"], "animation" : "newlook_castle/CastleGrassHall"},
					"fort" : {"allowedTerrains":"grass"], "animation" : "newlook_castle/CastleGrassCastle1"},
					"citadel" : {"allowedTerrains":"grass"], "animation" : "newlook_castle/CastleGrassCastle2"},
					"castle" : {"allowedTerrains":"grass"], "animation" : "newlook_castle/CastleGrassCastle3"},
					"capitol" : {"allowedTerrains":"grass"], "animation" : "newlook_castle/CastleGrassCastle3F"},

					"village_1_lava": {"allowedTerrains":"lava"], "animation" : "newlook_castle/CastleLavaHall"},
					"village_2_lava": {"allowedTerrains":"lava"], "animation" : "newlook_castle/CastleLavaHall"},
					"village_3_lava": {"allowedTerrains":"lava"], "animation" : "newlook_castle/CastleLavaHall"},
					"village_lava": {"allowedTerrains":"lava"], "animation" : "newlook_castle/CastleLavaHall"},
					"fort_lava" : {"allowedTerrains":"lava"], "animation" : "newlook_castle/CastleLavaCastle1"},
					"citadel_lava" : {"allowedTerrains":"lava"], "animation" : "newlook_castle/CastleLavaCastle2"},
					"castle_lava" : {"allowedTerrains":"lava"], "animation" : "newlook_castle/CastleLavaCastle3"},
					"capitol_lava" : {"allowedTerrains":"lava"], "animation" : "newlook_castle/CastleLavaCastle3F"},

					"village_1_rough": {"allowedTerrains":"rough"], "animation" : "newlook_castle/CastleRoughHall"},
					"village_2_rough": {"allowedTerrains":"rough"], "animation" : "newlook_castle/CastleRoughHall"},
					"village_3_rough": {"allowedTerrains":"rough"], "animation" : "newlook_castle/CastleRoughHall"},
					"village_rough": {"allowedTerrains":"rough"], "animation" : "newlook_castle/CastleRoughHall"},
					"fort_rough" : {"allowedTerrains":"rough"], "animation" : "newlook_castle/CastleRoughCastle1"},
					"citadel_rough" : {"allowedTerrains":"rough"], "animation" : "newlook_castle/CastleRoughCastle2"},
					"castle_rough" : {"allowedTerrains":"rough"], "animation" : "newlook_castle/CastleRoughCastle3"},
					"capitol_rough" : {"allowedTerrains":"rough"], "animation" : "newlook_castle/CastleRoughCastle3F"},

					"village_1_sand": {"allowedTerrains":"sand"], "animation" : "newlook_castle/CastleSandHall"},
					"village_2_sand": {"allowedTerrains":"sand"], "animation" : "newlook_castle/CastleSandHall"},
					"village_3_sand": {"allowedTerrains":"sand"], "animation" : "newlook_castle/CastleSandHall"},
					"village_sand": {"allowedTerrains":"sand"], "animation" : "newlook_castle/CastleSandHall"},
					"fort_sand" : {"allowedTerrains":"sand"], "animation" : "newlook_castle/CastleSandCastle1"},
					"citadel_sand" : {"allowedTerrains":"sand"], "animation" : "newlook_castle/CastleSandCastle2"},
					"castle_sand" : {"allowedTerrains":"sand"], "animation" : "newlook_castle/CastleSandCastle3"},
					"capitol_sand" : {"allowedTerrains":"sand"], "animation" : "newlook_castle/CastleSandCastle3F"},

					"village_1_snow": {"allowedTerrains":"snow"], "animation" : "newlook_castle/CastleSnowHall"},
					"village_2_snow": {"allowedTerrains":"snow"], "animation" : "newlook_castle/CastleSnowHall"},
					"village_3_snow": {"allowedTerrains":"snow"], "animation" : "newlook_castle/CastleSnowHall"},
					"village_snow": {"allowedTerrains":"snow"], "animation" : "newlook_castle/CastleSnowHall"},
					"fort_snow" : {"allowedTerrains":"snow"], "animation" : "newlook_castle/CastleSnowCastle1"},
					"citadel_snow" : {"allowedTerrains":"snow"], "animation" : "newlook_castle/CastleSnowCastle2"},
					"castle_snow" : {"allowedTerrains":"snow"], "animation" : "newlook_castle/CastleSnowCastle3"},
					"capitol_snow" : {"allowedTerrains":"snow"], "animation" : "newlook_castle/CastleSnowCastle3F"},

					"village_1_swamp": {"allowedTerrains":"swamp"], "animation" : "newlook_castle/CastleSwampHall"},
					"village_2_swamp": {"allowedTerrains":"swamp"], "animation" : "newlook_castle/CastleSwampHall"},
					"village_3_swamp": {"allowedTerrains":"swamp"], "animation" : "newlook_castle/CastleSwampHall"},
					"village_swamp": {"allowedTerrains":"swamp"], "animation" : "newlook_castle/CastleSwampHall"},
					"fort_swamp" : {"allowedTerrains":"swamp"], "animation" : "newlook_castle/CastleSwampCastle1"},
					"citadel_swamp" : {"allowedTerrains":"swamp"], "animation" : "newlook_castle/CastleSwampCastle2"},
					"castle_swamp" : {"allowedTerrains":"swamp"], "animation" : "newlook_castle/CastleSwampCastle3"},
					"capitol_swamp" : {"allowedTerrains":"swamp"], "animation" : "newlook_castle/CastleSwampCastle3F"},

					"village_1_subterra": {"allowedTerrains":"subterra"], "animation" : "newlook_castle/CastleSubterraHall"},
					"village_2_subterra": {"allowedTerrains":"subterra"], "animation" : "newlook_castle/CastleSubterraHall"},
					"village_3_subterra": {"allowedTerrains":"subterra"], "animation" : "newlook_castle/CastleSubterraHall"},
					"village_subterra": {"allowedTerrains":"subterra"], "animation" : "newlook_castle/CastleSubterraHall"},
					"fort_subterra" : {"allowedTerrains":"subterra"], "animation" : "newlook_castle/CastleSubterraCastle1"},
					"citadel_subterra" : {"allowedTerrains":"subterra"], "animation" : "newlook_castle/CastleSubterraCastle2"},
					"castle_subterra" : {"allowedTerrains":"subterra"], "animation" : "newlook_castle/CastleSubterraCastle3"},
					"capitol_subterra" : {"allowedTerrains":"subterra"], "animation" : "newlook_castle/CastleSubterraCastle3F"}					
				}
			}
		}
	}

It still works.

Thanks Macron1, it makes sense. I must check that. But tell me one thing: why village is mentioned four times?

Village mentioned 4 times because for grass there are 4 village looks (buildings in progress). If you have only 1 village look for each terrain, you must use only one filter for each terrain.

In hero format, can a hero be set up to carry a artifact?

Yes, but try not to set up artifact in first slot. There’s possibility then to create ‘ghost’ hero.

Creature Spell damage No increase

1 creatures casts Frost Ring damage 60,
2 creatures casts Frost Ring damage still 60.

Unit must have CREATURE_SPELL_POWER bonus to make its count affect spell power.

hero format,hero carry Armageddon’s Blade code?

Hero cannot dig (error code 1)!
Got false in applying 11DigWithHero… that request must have been fishy!
System message: Server encountered a problem: Hero cannot dig (error code 1)!
System message: Server encountered a problem: Got false in applying 11DigWithHer
o… that request must have been fishy!

Yes, sometimes when hero try to dig for Grail, I got the same message. This hero is unable to dig in any place. But when you buy another hero, he can dig without problem. It’s rare bug.

hy guys!
im trying to make a mod of my own. first of all, i want to start from small to big, step by step.

The first teeny tiny step would be to add different types of ‘buffs’ to all creatures so that it reflects reality: humanoid, living, undead,mechanical, golem, elemental, beast, demon.

And i started up with the undeads becasue i saw on the wiki page that you guys have implemented the “UNDEAD” buff. I have tried to modify the skeleton with this buff and the game refused to start. I was sure i was doing something wrong since i have minimal knowledge about c++ and modding in general and then i tried to add a simple cast (sorrow) after attack effect and everything went well until i entered the battle. The game crashed.

I want to mention that both versions (the one which added ‘undead’ to skeletons and this one) have been recognized by the Launcher and they make it in the mods list. And the game was able to enter the battle before (and with my mod disabled).

Am i doing anything wrong? what can i do as a starter to understand modding and vcmi better? (i read all wiki, i didnt find a list of values though, like the list of creature numbers or spell numbers). I really want to do things and i really need help. :slight_smile: thank you in advance.

It’s ok with this simple code, but please upload your mod - sometimes files structure inside is important and can generate crashes!

Kindly see the below link.

https://drive.google.com/open?id=1ma-bDhp4IwO-hK5blOGe1M4bTfLgcM9K

As I thought, you have wrong files structure. I guess you want to make every creature type selectable/de-selectable in launcher so you want to make few submods. Then you must create Mods folder in your mod and inside it put all your sub-mods.
Look at this architecture.
Creature types.zip (1.9 KB)
Creating Mods folder fixes skeletons.
mods

And in game: image

One more thing: casting after attack format is:
SPELL_AFTER_ATTACK
subtype - spell id
value - chance %
additional info - [X, Y]
X - spell level
Y = 0 - all attacks, 1 - shot only, 2 - melee only

So, in your case, percent chance for casting is 1%

Proper configuration should be sth like this:
{
“core:skeleton” :
{
“abilities” :
{
“sorrow” :
{
“type” : “SPELL_AFTER_ATTACK”,
“subtype” : “spell.sorrow”,
“val” : 10,
addInfo [1, 2]
}
}
}
}

It means Sorrow is casted with 10% probability, spell level is 1 - base magic school, and it can be casted after meelle attack (2).

And one more thing:
Code with addInfo in brackets form [ ], is read only with daily builds installed. Old 0.99 version can undestand such format but I don’t remember old format :frowning: