Skip to content

Posts from Current questions and answers regarding the map editor. Auto-translated

5.0 (12 ratings)
In reply to Безжалостный берсерк 007
User Avatar
#3101
Auto-translated
Ruthless Berserk 007
Hello! Could you please tell me why the map-tag.xdb file is missing from my map files?

I don't know how it could have disappeared from your files, but in the worst-case scenario, it could be re-embedded into the map.
Кампании для 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 Безжалостный берсерк 007
User Avatar
#3102
Auto-translated
There is a function called EnableHeroAI(sHeroName, bEnable). Is there a function that checks the state of bEnable? Something like IsEnableHeroAI?
There isn't such a function, but it's easy to create one.
local enable_hero_ai = EnableHeroAI
local disabled = {}
function EnableHeroAI(hero, enable)
  %enable_hero_ai(hero, enable)
  %disabled[hero] = not enable
end

function IsHeroEnabled(hero)
  return not %disabled[hero]
end
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
#3103
Auto-translated
I would copy the map-tag from another map and then embed it into this map. Then, you can open this file with Notepad, and it will contain text similar to this:

AdvMapDescTag
AdvMapDesc href="map.xdb#xpointer(/AdvMapDesc)"/>
NameFileRef href="name.txt"/>
DescriptionFileRef href="description.txt"/>
TileX>256
TileY>256
MapGoal href="MapGoalText.txt"/>
CustomMapGoal>false
teams>
Item>1
Item>1
Item>1
/teams>
thumbnailImages/>
HasUnderground>true
RandomMap>false
CustomGameMap>false
Version>3
/AdvMapDescTag
Each line also starts with the "<" character. It's not difficult to figure out what's what. You just need to change all the settings to match your map. Is there an easier way?

Added 4 minutes later
RedHeavenHero
There isn't such a function, but it's not difficult to create one.
local enable_hero_ai = EnableHeroAI
local disabled = {}
function EnableHeroAI(hero, enable)
%enable_hero_ai(hero, enable)
%disabled[hero] = not enable
end

function IsHeroEnabled(hero)
return not %disabled[hero]
end

and if the AI for a hero is already disabled, and I "disable" it again by calling the EnableHeroAI function, will that cause an error?
Кампании для Heroes V 3.1 (Трилогия):

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

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

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


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


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

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

Легендарная война
Сердце вулкана
Передел мира
#3105
Auto-translated
I can't figure out how to make opaque water with cool-looking shores. I'm using the Water tool, but the water turns out transparent, and you can see the bottom. If I add water from the Rivers tab, the shores become too gentle. Can you help me?
User Avatar
#3106
Auto-translated
In the map properties tree, there is an item called ReflectiveWater; set it to true and reload the map.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
#3107
Auto-translated
Is it possible to link a sound source to an object in the editor, so that when you activate a building or something else, your sound plays?
Жизнь за Айур!

Карты которые готовятся: Пролог: День незвисимости 4% :smile52:
In reply to Zex Pain
User Avatar
#3108
Auto-translated
You can use scripts (Play2DSound, Play3DSound), as well as in the properties of a Shared object (SoundEffect, AdventureSoundEffect).
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
#3109
Auto-translated
Thanks, everything works.
By the way, what is this thing that happens when you modify a map? You save it in the editor, replacing the original, but in the game, when multiplayer maps are enabled in scenarios, a clone of it appears?
User Avatar
#3110
Auto-translated
I have another question: `SetObjectPosition(sObjectName, nX, nY, nFloorID = -1)` If the coordinates specified in this function are impassable, then, as I understand it, the object will be moved to the nearest "passable" tile, right? Will this work even in the case where there are no passable tiles even remotely close to the tile nX, nY?
Кампании для 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
#3111
Auto-translated
No. If the coordinates are greater than the map coordinates, the game will crash with a critical error; otherwise, the teleportation will occur in any case. I teleported the hero to the top of a mountain, into water, and into a mine.

Whatever
In reply to Heroist
User Avatar
#3112
Auto-translated
Heroist
No. If the coordinates are larger than the map coordinates, it will crash with a critical error, otherwise teleportation will occur in any case. I teleported the hero into a mountain, into water, and into a mine ;)
I plan to do this with one of the creatures. If I accidentally teleport it to the center of a 40x40 mountain, will the creature end up somewhere on the edge of that mountain in a passable location?
Кампании для 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
#3113
Auto-translated
He will end up in the center of the mountain.

Added 18 minutes later
Well, in general, I explained it very unclearly, I apologize: this function works like a regular change of the body's coordinates, like, for example, in the editor; that is, whatever coordinates you specify, the object will be there, regardless of whether we are passing through this tile or not. That's it.

Whatever
User Avatar
#3114
Auto-translated
What if we take a section of the map, say, 100x100, run a loop of 10,000 iterations, checking each tile using IsTilePassable(nX, nY, nFloorID = GROUND), and if the tile is passable, add it to an array? Then, for teleporting a creature, use an element from that array? I don't really know yet how to do this exactly, and whether it would significantly impact the gameplay.
Кампании для 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
#3115
Auto-translated
I would start by considering a certain radius from the desired cell. First, check the cell itself, then all cells within a radius of 1, then 2, and so on, until a traversable tile is found.
 

К А
Стикеры GBF в Telegram