Skip to content

Posts from Current questions and answers regarding the map editor.

5.0 (12 ratings)
User Avatar
#3903
Auto-translated
The ID is definitely in the documentation - IDs_for_scripts.pdf.

Added 43 seconds later
It's strange that the game crashes; script errors are usually not that fatal.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to RedHeavenHero
#3904
Auto-translated
RedHeavenHero
Eleondor,
it's in the map script.
Please advise. Maybe you know what's going on. I was using the editor normally, and now when I open it, there's nothing in the toolbar – no artifacts, no towns, etc. What should I do?
User Avatar
#3905
Auto-translated
well, I have Windows 7 x64 Russian SP1, maybe that's the reason, although I set compatibility mode everywhere - both for the editor and for the game.
This post is addressed to RedHeavenHero!
In reply to Eleondor
#3906
Auto-translated
Eleondor
Well, I have Windows 7 x64 Russian SP1, maybe that's the reason, although I set compatibility mode everywhere - both for the editor and the game.
Everything was working fine this morning, but in the afternoon, I can't install any resources or anything. Maybe something needs to be changed in the editor itself?

Added after 12 hours 56 minutes
RedHeavenHero
The ID is probably in the documentation - IDs_for_scripts.pdf.

Added after 43 seconds
It's strange that the game crashes; script errors are usually not that fatal.
Hey, maybe you know. I was using the editor normally, and then suddenly, when I open it, there's nothing in the toolbar, no artifacts, no towns, etc. What should I do?
User Avatar
#3907
Auto-translated
Is it possible to force the AI to hire a specific hero located in the tavern?
HappyR137
. I was using the editor normally, then suddenly I enter and there is nothing in the toolbar—no artifacts, no cities, etc. What should I do?


I had a similar situation a long time ago. Try checking the view tab to see which panels are available and enable them... I think it's among them, with artifacts, heroes, etc
Мои карты

Возрождённый v 1.5 (обновление от 25/09/2016) :smile24:

готовится продолжение.

Великая Пустыня ( 25%) - про Маркела
Тьма над Иролланом (0%) - про Николаса

Мои моды (скорректированы мод на чумных энтов и циклопов зомби)
User Avatar
#3908
Auto-translated
Is it possible to force the AI to hire a specific hero who is in the tavern?
No.
You can limit his choices, but even then, it's not guaranteed that he will hire the hero immediately.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to Markel the Imperor
User Avatar
#3909
Auto-translated
Markel the Imperor
Is it possible to force the AI to hire a specific hero who is in a tavern?
Specifically, what is required?
The hero is killed, ends up in the tavern, and then needs to be hired again?
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
In reply to Dyrman
User Avatar
#3910
Auto-translated
Dyrman
If a hero dies, does he end up in a tavern and need to be hired again?

yes, that's exactly what happens.
Мои карты

Возрождённый v 1.5 (обновление от 25/09/2016) :smile24:

готовится продолжение.

Великая Пустыня ( 25%) - про Маркела
Тьма над Иролланом (0%) - про Николаса

Мои моды (скорректированы мод на чумных энтов и циклопов зомби)
User Avatar
#3911
Auto-translated
Why aren't the reserved heroes any good?
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to RedHeavenHero
User Avatar
#3912
Auto-translated
well, yes, my hero is indeed reserved.
if you do it like this: DeployReservereHero('duncan',getObjectPosition('towm'))
then he appears either in the castle, but more often in a random spot near the castle. I don't know why this happens. Perhaps the troops in the castle garrison or caravans are somehow interfering with him.

If you first deploy him to a point on the map, and then use SetObjectPosition to move him to the castle, it works...

but this works well on a specific map, where this player only has 1 hero.
but if there are several heroes and at the time of respawn there are already 2 other heroes in the castle, there won't be enough space.
Мои карты

Возрождённый v 1.5 (обновление от 25/09/2016) :smile24:

готовится продолжение.

Великая Пустыня ( 25%) - про Маркела
Тьма над Иролланом (0%) - про Николаса

Мои моды (скорректированы мод на чумных энтов и циклопов зомби)
User Avatar
#3913
Auto-translated
You can place a hero from a castle in a location adjacent to the castle.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to RedHeavenHero
User Avatar
#3914
Auto-translated
`GetObjectCreaturesTypes` for some reason is not an array and cannot be indexed. If they are separated by commas, as indicated in the documentation, can they be split?
Мои карты

Возрождённый v 1.5 (обновление от 25/09/2016) :smile24:

готовится продолжение.

Великая Пустыня ( 25%) - про Маркела
Тьма над Иролланом (0%) - про Николаса

Мои моды (скорректированы мод на чумных энтов и циклопов зомби)
User Avatar
#3915
Auto-translated
You can create an array like this:
local t = {}
t[1], t[2], t[3], t[4], t[5], t[6], t[7] = GetObjectCreaturesTypes(???)
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to RedHeavenHero
User Avatar
#3916
Auto-translated
Is there a direct way to find out how much damage a hero took in battle?
Мои карты

Возрождённый v 1.5 (обновление от 25/09/2016) :smile24:

готовится продолжение.

Великая Пустыня ( 25%) - про Маркела
Тьма над Иролланом (0%) - про Николаса

Мои моды (скорректированы мод на чумных энтов и циклопов зомби)
In reply to Markel the Imperor
User Avatar
#3917
Auto-translated
Markel the Imperor
Is there a direct way to find out the hero's losses in battle?
We set up a trigger:
COMBAT_RESULTS_TRIGGER
In it, we check which hero participated in the battle using
GetSavedCombatArmyHero
We get the units themselves using the functions
GetSavedCombatArmyCreaturesCount
GetSavedCombatArmyCreatureInfo
If the data is not needed immediately, you can save it in an array

Here is an example of the code (losses are recorded in the 'died' variable):
COMBAT_WINNER = 1;
COMBAT_LOSER = 0;
Trigger(COMBAT_RESULTS_TRIGGER, 'CombatResult');

function CombatResult(id)

-- we analyze only for the main hero
if(GetSavedCombatArmyHero(id, COMBAT_WINNER) ~= player_hero) then return end

local n_stacks, creature, count, died;

-- analysis of the losing side
n_stacks = GetSavedCombatArmyCreaturesCount(id, COMBAT_LOSER);
for i = 0,(n_stacks-1) do
creature, count, died = GetSavedCombatArmyCreatureInfo(id, COMBAT_LOSER, i);
-- here you can analyze or save the data somewhere
-- creature - creature ID, count - their number at the beginning of the battle, died - how many died
end;

-- analysis of the winning side
n_stacks = GetSavedCombatArmyCreaturesCount(id, COMBAT_WINNER);
for i = 0,(n_stacks-1) do
creature, count, died = GetSavedCombatArmyCreatureInfo(id, COMBAT_WINNER, i);
end;

end