Skip to content

Current questions and answers regarding the map editor.

User Avatar
#927
Auto-translated
jackysm
Could you please provide guidance on how to correctly create a MessageBox (preferably with an example) so that the message appears for each player on a Multiplayer map? I've tried using this approach: MessageBox(GetMapDataPath().."qwerty.txt"); but it doesn't work.
To avoid various errors, it is strongly recommended to use a different function in Multiplayer, even if you need to send a message to all players ;)
MessageBoxForPlayers(player identifier, path to the message, function to be executed when OK is pressed)
Example:
MessageBoxForPlayers(GetPlayerFilter(GetCurrentPlayer()),GetMapDataPath().."win.txt");
GetPlayerFilter(GetCurrentPlayer()) 
- in this case, it's the current player;
GetMapDataPath().."win.txt"
- the path to the message.
To display it for each player, you'll need to write a line for each player, or use what I wrote above, but how exactly - it's up to you.
Example specifically for player 1 and player 2:
MessageBoxForPlayers(1,GetMapDataPath().."win.txt", "FF");
MessageBoxForPlayers(2,GetMapDataPath().."win.txt", "FF");

There are also Multiplayer equivalents for some functions. Just add ForPlayers to the end of the function name and the player identifier as the first parameter ;)
jackysm
Could you please provide guidance on how to correctly create a MessageBox (preferably with an example) so that the message appears for each player on a Multiplayer map? I've tried using this approach: MessageBox(GetMapDataPath().."qwerty.txt"); but it doesn't work.
Ment
Hmm, I don't know. Are you sure that it's not working specifically because of Multiplayer?
Of course, it wouldn't hurt to check the file encoding, the file path (even with the GetMapDataPath() function, the file might be in a completely different folder), etc. - these are very common mistakes too.

Added 15 minutes later
Ment

2. The lighting on the arenas is defined in the game's resources and cannot be changed without a special mod. That is, on other maps, if the arena is present in the maps folder, it will also become nighttime.

Is it possible to copy the lighting object from the arena to avoid affecting all files? And is it even possible? I would try, but I don't have the editor on hand right now
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...