Skip to content

Posts from Scripts

4.8 (8 ratings)
User Avatar
Auto-translated
I think the "question box" sounds good... The only thing is, it will probably be visible to all players... And there might be several of them in multiplayer.

Added 3 minutes later
And also - maybe just create two maps - one for multiplayer and one for single-player? Copy and paste, changing the necessary scripts and the map type.

Then you'll definitely get one that works in single-player.
And as for its multiplayer copy, which can also be launched in single-player mode, you can simply add a check, and if all players except one are AI, then set it to "loose."
Then in multiplayer, you will definitely have to play against a player - after all, it's multiplayer. And there won't even be any point in launching a multiplayer map in a mode without players.
And single-player... will remain single-player.

Whatever
In reply to Nargott
User Avatar
Auto-translated
Nargott
This is the solution.
If the scripts work differently in single-player and multiplayer, then there exists a sequence of actions that will work differently in both. All you have to do is find it through trial and error.
This is NOT a solution. The solution is to find such a function. I haven't found one yet since yesterday.

Added 3 minutes ago
Heroist
In my opinion, using a question box sounds good... The only thing is, it will probably be visible to all players... And there may be several of them in multiplayer.
More details...
Heroist

Added 3 minutes ago
[/U]and also - maybe just create two maps - one for multiplayer and one for single-player? Copy and paste with changes to the necessary scripts and the map type.

Then, one will definitely work in single-player.
And as for its multiplayer copy, which can also be launched in single-player mode, you can simply add a check, and if all players except one are AI, then set it to "loose".
Then in multiplayer, you will definitely have to play against a player - it's multiplayer after all. And there won't even be any point in launching a multiplayer map in a mode without players.
And single-player... will remain single-player.

This is not needed for a map, but for a mod. Two versions will not solve the problem, because both can be launched in any way. And people like to play multiplayer maps through the single-player menu, because there you can see what the AI heroes are doing during their turn.
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
User Avatar
Auto-translated
"More details" - well, it seemed to me that the mess and question boxes are displayed to all players on the map. Suddenly, one clicks OK, and the other clicks CANCEL...

"and for mods" - hmm, then it's more complicated... I haven't made mods yet (only through maps) =)

Added 1 minute ago
in general, I always thought that such a scripting function exists. Indeed, it's unexpected that it hasn't been implemented yet...

Whatever
In reply to Heroist
User Avatar
Auto-translated
Heroist
"More details" - well, it seemed to me that the mess and question boxes are displayed to all players on the map. Suddenly, one clicks OK, and the other clicks CANCEL...
There are other messages like MessageBoxForPlayers(player number/filter, path, ok function) - they are displayed only to one player.

Added 7 minutes later
In the game, through the single-player menu, there is a checkbox that opens multiplayer maps in the map menu. You can "lock" it, but even then, various tweaks or tools that modify the configuration files will change things where they shouldn't.
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
User Avatar
Auto-translated
And even if they do – isn’t that their problem? They’ll get a half-baked mod.

Whatever
User Avatar
Auto-translated
This is NOT a solution. A solution is finding such a function. I haven't found one yet, even after yesterday.
Well, I'm definitely not going to look for it for you.
I don't understand what the difficulty is in finding it. You have scripts that work differently in single-player and multiplayer; surely it's not difficult to find a sequence of commands in them, and then emulate the same structure, but without game actions? Apparently, the way threads are handled differs in these modes.
Разработчик Heroes 5.5 WarGame Edition.
Сайт проекта - пока неактивен
Автор Асимметричных шахмат
In reply to Nargott
User Avatar
Auto-translated
Nargott
Well, I definitely won't be looking for it for you.
I don't understand what the difficulty is in finding it. You have scripts that work differently in single-player and multiplayer, isn't it difficult to find such a sequence of commands in them, and then emulate the same structure, but without game actions? Apparently, the way threads are handled differs in these modes.
I asked for help. :smile32: And here, it's just some thoughts.
A function has two sides: either the game crashes, or it doesn't. How are you going to check for "game crash"? Are there timer functions, and does it work differently on different computers?
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
In reply to Dyrman
User Avatar
Auto-translated
Dyrman
I asked for help. :smile32: And here, it's just some thoughts.
A function has two sides: either the game crashes, or it doesn't. How are you going to check for "game crash"? Are there timer functions, and does it work differently on different computers?
Try performing operations on the same data in different threads (at least arithmetic), but in a way that the game doesn't crash depending on the different sequence of these actions.
The output will show in what sequence the actions were performed. Or, instead of threads, try calling 2 functions, like (rumor has it) the single-player mode launches the second in a separate thread, without waiting for the first to finish.
Разработчик Heroes 5.5 WarGame Edition.
Сайт проекта - пока неактивен
Автор Асимметричных шахмат
In reply to Nargott
User Avatar
Auto-translated
Nargott
Try performing operations on the same data in different threads (at least arithmetic operations), but in a way that the game doesn't crash depending on the different sequence of these actions.
The output will show in what sequence the actions were performed.
They will be different on different computers.
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
User Avatar
Auto-translated
They will be different on different computers.
You only need these different versions to differ from the standard (multiplayer) execution.
Разработчик Heroes 5.5 WarGame Edition.
Сайт проекта - пока неактивен
Автор Асимметричных шахмат
In reply to Nargott
User Avatar
Auto-translated
Nargott
You only need all these different versions to differ from the standard (multiplayer) execution.
Different, including those that can be found in the standard version.

It's easier to remove the multiplayer map checkbox from the single-player map menu and set it to zero, as I suggested.
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
In reply to Dyrman
User Avatar
Auto-translated
Dyrman
They can be different, including those found in the standard version.

It's easier to simply remove the multi-map checkbox from the single-player map menu and set it to zero, as I suggested.
It's definitely easier. Then, there's no need to write a special version of the scripts for single-player mode.
Разработчик Heroes 5.5 WarGame Edition.
Сайт проекта - пока неактивен
Автор Асимметричных шахмат
In reply to Nargott
User Avatar
Auto-translated
Nargott
Definitely easier. Then there’s no need to write a special version of the scripts for single-player mode.
Actually, someone needs it. ;)

It will be easier to determine whether it’s a single-player or multiplayer map based on the map type.

Although, due to the low probability of using new heroes in single-player mode, this can be left for later.
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

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

Script:
w = "Maps/SingleMissions/The Dragons City/"
eh1p = 0
eh2p = 0
eh3p = 0
fac = random(4,5);
eac = random(20, 30);

SetObjectEnabled("eh1",false);
SetObjectEnabled("eh2",false);
SetObjectEnabled("eh3",false);

function AddCreatures(x)
local tmp = GetPlayerHeroes(GetCurrentPlayer());
for i = 0, length(tmp)-1 do
AddHeroCreatures(tmp,x,1000);
end;
if length(tmp) > 0 then print("done"); sleep(5); end;
end;

function CheatsGuide()
print("@AddCreatures(xCreatureID) - adds 1000 of the specified creatures");
sleep(5);
end;

function complete()
SetObjectiveState("obj",OBJECTIVE_COMPLETED);
BlockGame();
sleep(5);
Win();
UnblockGame();
end;

Trigger(REGION_ENTER_AND_STOP_TRIGGER,"target","complete");

function EHR()
if GetDate(DAY_OF_WEEK) == 1 then
eh1p = 0
eh2p = 0
eh3p = 0
sleep(5);
end;
end;

Trigger(NEW_DAY_TRIGGER,"EHR");

function eh1F(heroname) -- that's line 46
if eh1p == 0 then
eh1p = 1
AddHeroCreatures(heroname,91,fac);
AddHeroCreatures(heroname,85,eac);
AddHeroCreatures(heroname,86,eac);
AddHeroCreatures(heroname,87,eac);
AddHeroCreatures(heroname,88,eac);
ShowFlyingSign(w.."ehe.txt");
sleep(5);
end;
else -- line 57
MessageBox(w.."ehp.txt");
end;
end;

function eh2F(heroname)
if eh2p == 0 then
eh2p = 1
AddHeroCreatures(heroname,91,fac);
AddHeroCreatures(heroname,85,eac);
AddHeroCreatures(heroname,86,eac);
AddHeroCreatures(heroname,87,eac);
AddHeroCreatures(heroname,88,eac);
ShowFlyingSign(w.."ehe.txt");
sleep(5);
end;
else
MessageBox(w.."ehp.txt");
end;
end;

function eh3F(heroname)
if eh3p == 0 then
eh3p = 1
AddHeroCreatures(heroname,91,fac);
AddHeroCreatures(heroname,85,eac);
AddHeroCreatures(heroname,86,eac);
AddHeroCreatures(heroname,87,eac);
AddHeroCreatures(heroname,88,eac);
ShowFlyingSign(w.."ehe.txt");
sleep(5);
end;
else
MessageBox(w.."ehp.txt");
end;
end;

Trigger(OBJECT_TOUCH_TRIGGER,"eh1","eh1F");
Trigger(OBJECT_TOUCH_TRIGGER,"eh1","eh1F");
Trigger(OBJECT_TOUCH_TRIGGER,"eh1","eh1F");
This is how:D
Attachments 1
1 file attached • Total size: 160.7 KB
502 Bad Gateway
__________________________________
nginx/0.8.54
User Avatar
Auto-translated
Firstly, you didn't assign an initial army to the hero Nimus. Secondly, in that very function, after the 46th line, you don't need to put 'end;' before ELSE! There should only be 1 'end;' for the entire if ... else statement.
Кампании для 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