Skip to content

Posts from Current questions and answers regarding the map editor.

5.0 (12 ratings)
User Avatar
Auto-translated
What parameters does a map need to have in order to be included in a campaign?
In reply to Иней
User Avatar
Auto-translated
Iney
What parameters does a map need to have in order to be included in a campaign?
No special parameters are required.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to RedHeavenHero
User Avatar
Auto-translated
RedHeavenHero
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.
In reply to Rhenish
User Avatar
Auto-translated
Rhenish
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.
The script name of the town is in the Name field of its properties tree.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to RedHeavenHero
User Avatar
Auto-translated
RedHeavenHero
In Map Properties (icon) -> Script -> Edit Script.
No, I know that. I meant something else. For example, this is how I learned from websites - - this is the color, etc. so I could get an idea of what it is and try to apply it to other buildings. For example, I need the farms to burn down when Vlad arrives...
Правило во взгляде...
In reply to Rhenish
User Avatar
Auto-translated
Okay?
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")
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
Auto-translated
Yeah, that makes sense. Thanks. And if Vlad enters the city, will he immediately see the Necropolis, or will there be a chance to see the original human settlement? There's an Ash in the city, and I'm curious what it looks like myself...
Правило во взгляде...
In reply to Rhenish
User Avatar
Auto-translated
Rhenish
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...
The town will be without any buildings after the transformation.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
Auto-translated
Will the transformation be instantaneous? I wanted him to transform 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 for the city.
Правило во взгляде...
In reply to Rhenish
User Avatar
Auto-translated
Rhenish
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.
During transformation, the hero disappears. Script names for non-hero objects are assigned in the Name field in the properties tree of that object.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
Auto-translated
Okay, good, I've figured out the name, thanks. I've found a compromise – we'll keep the capital and place another human town somewhere else. In the script, it turns out that 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, so he can't disappear. How do I edit the script now so that the situation is the same as in the campaign with Frida – the town burns down as soon as it's captured, but instead of a Necropolis, a Necropolis with a random specialization appears?
Правило во взгляде...
In reply to Rhenish
User Avatar
Auto-translated
Rhenish
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?
Right-click on the properties tree, select “Show Hidden,” and hidden properties will appear. Set “CanCaptureOnlyNotVisit” to true. Then, it won’t disappear.
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.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
Auto-translated
So, as a blonde, how do I understand it? Will the city burn down, and "after the fire," a Necropolis city will appear with a name and specialization from Haven, but without any buildings?
Правило во взгляде...
User Avatar
Auto-translated
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.

Whatever
User Avatar
Auto-translated
Isn't it possible to change them immediately using scripts? I think I saw something similar somewhere.
No, that's not possible.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4

Statistics

Welcome our newest member: Emil