Skip to content
User Avatar
#1561
Auto-translated
RedHeavenHero
If the slot is empty, then the corresponding element is not nil, but 0. Therefore, ~=nil should be replaced with ~=0.
The idea is to remove one-third of the army? Then there is a shorter script.
for i=0,6 do
local t, n = GetObjectArmySlotCreature(heroname, i)
if t ~= 0 then
RemoveHeroCreatures(heroname, t, n/3)
end
end

thank you)) And if n/3 is not an integer, will it throw an error? Or should I still use the intg() function?
Кампании для Heroes V 3.1 (Трилогия):

Пробуждение зла
Нашествие из Преисподней
Смена эпох

Скачать все кампании одним архивом: Яндекс.Диск Google.Диск

You can download the set of 3 Campaigns (English version) here


Одиночные сценарии Heroes V 3.1:


Незваные гости
Красный кристалл
Синий кристалл
Закат тьмы

Мультиплеерные карты для Heroes V 3.1:

Легендарная война
Сердце вулкана
Передел мира