I would like the region to be removed after some time, so that the AI can continue.
SetRegionBlocked("region name", nil, PLAYER_number of the player for whom the region should be unlocked);
Please tell me how to implement the appearance of caravans with troops every month, so that they go directly to the city.
Basically, take the script from that very mission by Arantir, copy and paste it, removing everything that is not needed and substituting your own parameters. It is important to remember a couple of things about the caravan: It spawns only on an empty point; it delivers creatures only to cities (the spawn point is assigned to the point where the city is located), otherwise, write a "dummy" script, like it goes to some point near the desired object (say, a garrison), is removed (RemoveObject), and then the object (in our case, the garrison) is filled with creatures through AddObjectCreatures; yes, the caravan spawns empty, and it will be deleted when the turn of the player to whom it belongs ends if it is not filled with creatures; it is filled and cleared using object interaction commands, i.e., AddObjectCreatures/GetObjectCreatures/RemoveObjectCreatures. Also, the IsObjectExists check and the SetObjectRotation command work on it:
CARAVAN = "caravan"; --let's give the caravan a starting name for use in the function
function respawn_caravan()
if (GetDate( DAY_OF_WEEK ) == 5) then --day of the week on which we will spawn the caravan (you can change it to another date trigger)
car = CARAVAN..GetDate(DAY); --I can't say what the trick was in naming the caravan by the game day, maybe without this the respawn would break. Let's leave it as it is, because why touch what already works correctly, right?
CreateCaravan(car, PLAYER_1, GROUND, 130, 1, GROUND, 136, 14 ); --here is the caravan spawn itself: caravan name, who it belongs to, whether it spawns on the ground or underground, x y spawn points, on the ground or underground, the point to which it goes, x y destination points. The destination point is either an empty place or a city (technically, the caravan does not deliver creatures anywhere else)
sleep(4);
SetObjectRotation(car, 180); --let's turn the caravan so that it looks in the other direction
AddObjectCreatures(car, CREATURE_BONE_DRAGON, 4); --we fill the caravan with creatures, otherwise it will be deleted at the end of the turn of the player to whom it belongs
AddObjectCreatures(car, CREATURE_WIGHT, 8);
AddObjectCreatures(car, CREATURE_LICH, 12);
AddObjectCreatures(car, CREATURE_VAMPIRE, 20);
AddObjectCreatures(car, CREATURE_MANES, 36);
AddObjectCreatures(car, CREATURE_WALKING_DEAD, 60);
AddObjectCreatures(car, CREATURE_SKELETON, 80);
OpenCircleFog(130, 1, 0, 4, 1); --let's open the area of the map around the caravan spawn point so that we can then shift the camera and show the caravan
sleep(4);
MoveCamera(130, 1, 0, 30, 1, 3.14, 0, 0, 1); --let's shift the camera to the caravan spawn point to show the player that reinforcements have arrived
end;
end;
Trigger(NEW_DAY_TRIGGER, "respawn_caravan")
Всякое/карты:
Добавление недостающей музыки гномам