Skip to content

Current questions and answers regarding the map editor.

User Avatar
#4723
Auto-translated
Godric's Hollow, your script will not work correctly if there are insufficient resources. But this is a minor issue. The castle destruction is handled by the RazeTown() function, and that part is correct. I haven't experimented with it, so I can't offer any practical advice, but it is described in detail in the official documentation, and it doesn't seem to be particularly complex (except for creating the model of the destroyed castle):
RazeTown

RazeTown – raze a town on the map

Syntax

RazeTown(townName);

Description

Removes the specified town from the map and replaces it with a static object – razed town. The ‘razed town’ object is determined by the razedfield in AdvMapTownShared. If this field is empty, the town can’t be razed. The set of blocking tiles of the razed town must be the same as those of the original one’s. The razed town, as any other static object, must have no interactive tiles.

townName – town name

Warning!

The modifications made in the "Shared" properties of an object will affect all the objects of that kind in the game.
If you want your modification to be effective only on a specific map, follow these steps:
1) Place on the map the desired object.
2) Go to the Shared field of that object.
3) In the Objects list, create a new folder (Right click - New Folder) with the name of your map.
4) Place in this folder a copy of the object you want to modify.
5) Make the desired modifications to the copy.
For the modifications to be in effect, make sure that the path of the shared property leads to the copy.
РПГ-сценарий для HoMM5: Путь героя
ЧаВо по созданию карт для HoMM5: ЧаВо