Skip to content
User Avatar
#939
Auto-translated
Dyrman
You need to jump into the gates of the enemy city, or into the city itself, if it's your city, even from the gate point.
Then, create an array with the "gate points" at the beginning of the game.
gate_points = {}
function GetGatePoints()
for i, town in GetObjectNamesByType('TOWN') do
for j, hero in GetObjectNamesByType('HERO') do
if IsHeroInTown(hero, town, 1, 0) then
local x, y, z = GetObjectPosition(hero)
gate_points[town]={x, y, z}
end;
end;
end;
end;


Added 6 minutes later
Dyrman
No way. And the city should never be empty BEFORE the script runs (that's why it doesn't work).
You can remove the hero from that city using the same function.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

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