Auto-translated
What parameters does a map need to have in order to be included in a campaign?
New here? I'm Roha — want a quick tour?
What parameters does a map need to have in order to be included in a campaign?
That's it. Just write the script name and the city name. ;)
And it's best to set the hidden parameter CanCaptureOnlyNotVisit to true, otherwise the Necromancer might disappear.
Could you now explain what is what and where to put what? So that I don't bother you in the future.
In Map Properties (icon) -> Script -> Edit Script.
function InitBuildings() -- function, its name, and the list of arguments it receives in parentheses
for i, building in GetObjectNamesByType"PEASANT_HUT" do -- iteration through the array of object names of type "PEASANT_HUT" (peasant huts)
Trigger(5, building, "TransformBuilding") -- trigger on capture (5), building - variable in the loop, TransformBuilding - the name of the function called upon capture
end
for i, building in GetObjectNamesByType"ARCHERS_HOUSE" do
Trigger(5, building, "TransformBuilding")
end
for i, building in GetObjectNamesByType"BARRACKS" do
Trigger(5, building, "TransformBuilding")
end
for i, building in GetObjectNamesByType"HEAVEN_MILITARY_POST" do
Trigger(5, building, "TransformBuilding")
end
end
function TransformBuilding(_, _, hero, building)
if hero == "Pelt" then -- check the hero by name
ReplaceDwelling(building, TOWN_NECROMANCY) -- transform the building into the corresponding Necromancy building
end
end
function TransformHavenTown(_, _, hero)
if hero == "Pelt" then
TransformTown("scripted town name", TOWN_NECROMANCY) -- transform the town into a Necromancy town
sleep(10) -- pause for 2 seconds
SetObjectPosition("Pelt", GetObjectPosition("scripted town name")) -- move the hero to the town's coordinates (if the garrison is free, the hero will be placed there)
end
end
startThread(InitBuildings) -- start the function in a new thread; return values are ignored; does not wait for the function to complete
Trigger(5, "scripted town name", "TransformHavenTown")
Yeah, that's right. Thanks. And if Vlad enters the town, will he immediately see the Necropolis, or will there be a chance to see the original human settlement? There's Askhara there, and I'm curious myself what it looks like...
Will the transformation be instantaneous? I wanted it to happen after Vlad sits in the garrison and stays there for a while, and then "appears on the map." By the way, I just realized that I don't know the script name of the city.
Okay, I understand about the name, thank you. I found a compromise – we’ll keep the capital and place a second human town somewhere else. So, according to the script, the town burns down as soon as Vlad captures it, and a “level 0” Necropolis appears in its place, right? Vlad is my main hero, and he can’t disappear. How can I edit the script so that the situation is like in the campaign with Frida – the town burns down as soon as it’s captured, but instead of a Necropolis with a random specialization appearing, a level 0 Necropolis appears?
and its name, history, and specialization remain.
That is, as I, a blonde, understand it, the city will burn down, and "after the fire," a Necropolis city will appear with the name of the Haven and its specialization, but without any buildings?
Isn't it possible to change them immediately using scripts? I think I saw something similar somewhere.