Skip to content

Posts from Current questions and answers regarding the map editor.

5.0 (12 ratings)
User Avatar
ага
"RedHeavenHero01 doesn't exist"
Кампании для Heroes V 3.1 (Трилогия):

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

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

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


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


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

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

Легендарная война
Сердце вулкана
Передел мира
In reply to MasteR
User Avatar
Auto-translated
Juss456
It doesn't work. Because the hero is inside the town, for the game he doesn't exist as an object.
As an object - yes, but as a hero, he exists for scripts even if he is dead or in a tavern.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
Auto-translated
There's still the issue with TalkBox. function TalkBF(num) tlkb=num; end; TalkBoxForPlayers(1, '', '', GetMapDataPath().."skolko.txt", '', "TalkBF", 0, GetMapDataPath().."skolko.txt", '', 0, GetMapDataPath().."skolko1.txt", GetMapDataPath()..."skolko2.txt", GetMapDataPath()..."skolko3.txt", GetMapDataPath()..."skolko4.txt"); Instead of an icon, there's a white screen. This is understandable; I don't know where to find a suitable one. The main text isn't displayed (to the right of the icon). The function doesn't work as it should. Added 1 minute later
RedHeavenHero
As an object - yes, but as a hero, it exists for scripts even if it's dead or in the tavern.
function ubratF() while (ubr==0) do sleep(5); for i=0,6 do local t1, n1=GetObjectArmySlotCreature("RedHeavenHero01", i); if (t1~=0) and (n1>1) then RemoveHeroCreatures("RedHeavenHero01", t1, n1/4); end; end; sleep(8); MessageBox(GetMapDataPath().."chuma.txt"); ubr=1; end; sleep(5); end; startThread(ubratF); This snippet doesn't work
Кампании для Heroes V 3.1 (Трилогия):

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

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

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


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


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

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

Легендарная война
Сердце вулкана
Передел мира
User Avatar
Auto-translated
Here, you can only use the functions I mentioned above, as well as some others that only work with heroes. `GetObjectArmySlotCreature` is not allowed.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to MasteR
User Avatar
Auto-translated
Juss456
There remains a question regarding TalkBox.

function TalkBF(num)
tlkb=num;
end;

TalkBoxForPlayers(1, '', '', GetMapDataPath().."skolko.txt", '', "TalkBF", 0, GetMapDataPath().."skolko.txt", '', 0, GetMapDataPath().."skolko1.txt", GetMapDataPath().."skolko2.txt", GetMapDataPath().."skolko3.txt", GetMapDataPath().."skolko4.txt");
Instead of an icon, a white screen is displayed. This is understandable; I don't know where to find a suitable one. The main text is not displayed (to the right of the icon). The function doesn't work as it should.


if ((dd==3) and (tlkb==1)) or ((dd==4) and (tlkb==2)) or ((dd==5) and (tlkb==3)) or ((dd==6) and (tlkb==4)) then

no matter which option is chosen in the talk box, the condition in the first parenthesis is always met.

Added after 55 seconds
RedHeavenHero
Only the functions I mentioned above can be used here, as well as some others that only work with heroes. GetObjectArmySlotCreature cannot be used.
I understand, so I'll have to do it through other means. Thank you
Кампании для Heroes V 3.1 (Трилогия):

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

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

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


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


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

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

Легендарная война
Сердце вулкана
Передел мира
In reply to MasteR
User Avatar
Auto-translated
The first argument in the called function is the player number, and the second is the answer. Why not use the 'j' variable directly? You can use a loop instead.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to RedHeavenHero
User Avatar
Auto-translated
RedHeavenHero
The first argument in the called function is the player number, and the second is the response.

Why go straight to "ж"?
You can use a loop.
Aha, that's what it is.... Yes, that makes sense. Everything is clear now, thanks! And where do I get the icon address, and what should it look like? Why isn't the main text displayed in the center of the text box?

Added 22 minutes later
RedHeavenHero

Why go straight to "ж"?
You can use a loop.

Is this approximately what you mean?

function ubratF()
while (ubr==0) do
sleep(5);
for i=1,14 do
local t1=GetHeroCreatures("RedHeavenHero01", i);
if (t1>1) then
RemoveHeroCreatures("RedHeavenHero01", i, t1/4);
end;
end;
for i=106,112 do
local t1=GetHeroCreatures("RedHeavenHero01", i);
if (t1>1) then
RemoveHeroCreatures("RedHeavenHero01", i, t1/4);
end;
end;
sleep(8);
MessageBox(GetMapDataPath().."chuma.txt");
ubr=1;
end;
sleep(5);
end;
Кампании для Heroes V 3.1 (Трилогия):

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

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

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


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


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

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

Легендарная война
Сердце вулкана
Передел мира
In reply to MasteR
User Avatar
Auto-translated
The path to the texture should be structured like this. First, the standard path relative to the data folder, but with the slashes reversed, followed by the .xdb extension and then a fragment like #xpointer(/Texture).

Something like this. However, instead of t1/4, it's more reliable to use ceil(t1/4) to avoid errors when the value is less than 4. And I don't quite understand why there's a while loop there.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
Auto-translated
you can also close the loop with `break` to avoid unnecessary script overhead.

Whatever
User Avatar
Auto-translated
Yeah, I get it now.

In that case, a loop isn't really necessary.

Whatever
User Avatar
Auto-translated
The function is launched via startThread, so I added a while loop.
Кампании для Heroes V 3.1 (Трилогия):

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

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

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


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


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

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

Легендарная война
Сердце вулкана
Передел мира
User Avatar
Auto-translated
Even if a function is started with `startThread`, it doesn't necessarily mean that the function must contain a loop.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to MasteR
User Avatar
Auto-translated
Juss456

Instead of an icon, there's a white screen. But that's understandable; I don't know where to find a suitable one. The main text isn't displayed (to the right of the icon). The function doesn't work as it should.
You open the map with an archiver and put the folder from the archive there.
Regarding the image, here's an example:
'/UI/Tavern/RumorsIcon.(Texture).xdb#xpointer(/Texture)'
Attachments 1
1 file attached • Total size: 665 B
Мои карты:
Town
Готовится:Чума (40%), Сосиска(42%), Война Грааля
In reply to RedHeavenHero
User Avatar
Auto-translated
RedHeavenHero
If a function is started with startThread, it doesn't necessarily mean that the function must contain a loop.
Yeah, you can manage without a loop here. Thanks!)

Added after 38 seconds
Oligarch
You open the map with an archiver and put the folder from the archive there.
Regarding the image, here's an example:
'/UI/Tavern/RumorsIcon.(Texture).xdb#xpointer(/Texture)'
I'll try it later. Thank you very much!)
Кампании для Heroes V 3.1 (Трилогия):

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

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

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


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


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

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

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

Statistics

Welcome our newest member: Emil