Posts from Current questions and answers regarding the map editor.
What parameters does a map need to have in order to be included in a campaign?
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
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.
And now, could you explain what everything is and where to put it? So that I don't bother you in the future.
Could you now explain what is what and where to put what? So that I don't bother you in the future.
The script name of the town is in the Name field of its properties tree.
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
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")
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
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...
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
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.
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
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?
Unfortunately, there is no function to create new towns. “TransformTown” only changes the race of the town, but its name, history, and specialization remain the same.
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
and its name, history, and specialization remain.
isn't it possible to change them immediately using scripts? I saw something similar somewhere.
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?
yes. yes, and it makes sense.
Isn't it possible to change them immediately using scripts? I think I saw something similar somewhere.
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4