Skip to content

Posts from Scripts

4.8 (8 ratings)
User Avatar
Auto-translated
Warrior777
This script doesn't work for me, by the way!:smile29:
if GetDifficulty () = 0 then
I'm completely frustrated! :smile33: What should I do :smile45:

It's not "=", but "==" - double equals, it's a comparison, not an assignment ;)
if GetDifficulty () == 0 then
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
User Avatar
Auto-translated
Thank you! Everything works! Now the console happily displays the number of units in the hero's army :D
502 Bad Gateway
__________________________________
nginx/0.8.54
User Avatar
Auto-translated
Sorry if this is an inappropriate question, but I've searched the entire forum and couldn't find the answer (I just forgot how to do it).
How do I open the dialogue scene editor?
I edited the editor.cfg file (there was no editor_a2.cfg), and I can open resources, but I don't know how to open the scene editor, and maybe I edited the file incorrectly?
Could you provide a manual? Thanks in advance.
In reply to KhaBeLeh
Auto-translated
Good afternoon! Part of the script:
QuestionBoxForPlayers ( GetPlayerFilter(num2), {GetMapDataPath().."logabonus.txt"; eq = 10000}, 'logab2', 'logabno2');
In logabonus.txt:
Хотите получить (угловая скобка)value=eq(угловая скобка) золота в качестве бонуса?
In the game, a message pops up:
Хотите получить 10000 золота в качестве бонуса?
I need the text to appear in this way:
Хотите получить десять тысяч золота в качестве бонуса?
If I set eq = 'десять тысяч' or eq = "10.txt", and "10.txt" contains "десять тысяч", then only the message
Хотите получить  золота в качестве бонуса?
appears in the game. What is the catch? How can I make the actual text appear?
In reply to Mostovik
User Avatar
Auto-translated
Mostovik

What's the catch? How do I make sure the text appears?
It doesn't display the text string.
And why is this not suitable:
eq = "logabonus.txt";
QuestionBoxForPlayers ( 1, GetMapDataPath()..eq, "logab2", "logabno2");
?
Different files can be used with different eq values.

The message is incorrect...
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
Auto-translated
That code was provided only as an example. I was interested in the possibility of passing text specifically.
In reply to Mostovik
Auto-translated
Mostovik

If I set eq = 'ten thousand' or eq = "10.txt", and "10.txt" contains "ten thousand", then the game only displays the message
Do you want to receive gold as a bonus?
What's the catch? How do I make the actual text appear?
:smile33:
Basically, here are the script lines (for ...ForPlayers, something similar, there shouldn't be a big difference for single-player or multiplayer)
gold = GetMapDataPath().."text_2.txt";
MessageBox ({GetMapDataPath().."text_1.txt";eq=gold},nil);

In the text file 'text_1.txt', we write Do you want to receive (angle bracket)value=eq(angle bracket) gold as a bonus?
In the text file 'text_2.txt', we write ten thousand

P.s.: I don't think I missed anything, it was a while ago, but non-numeric variables worked and were displayed for me ;)
Auto-translated
Thank you! Actually, I've already implemented it using fly-in messages (I needed to display a list of possible heroes that the opponent received in the RTA).
In reply to JonnyP
User Avatar
Auto-translated
JonnyP
:smile33:
Basically, the script lines themselves (for ...ForPlayers, something similar, there shouldn't be much difference for single-player or multiplayer)
gold = GetMapDataPath().."text_2.txt";
MessageBox ({GetMapDataPath().."text_1.txt";eq=gold},nil);

in the text file 'text_1.txt', we write Do you want to receive (angle bracket)value=eq(angle bracket) gold as a bonus?
in the text file 'text_2.txt', we write ten thousand

P.s.: I don't think I missed anything, it was a while ago, but non-numeric variables worked and were displayed for me ;)
Thank you! It turns out you can pass the entire text file :) So, the parameter being passed stores the file path, but cannot store the text itself. Interesting....
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
Auto-translated
JonnyP, is it possible to somehow transmit icons in messages?
In reply to Mostovik
Auto-translated
Mostovik
JonnyP, is it possible to somehow transmit icons in messages?
I think I already wrote that you can do it through TalkBox, but it's not designed for multiplayer (I haven't checked it myself, but they say it glitches in multiplayer). In principle, it might be possible to do it with mods – for example, by changing the standard MessageBox icon. Tell me what you specifically want to do, and we'll think about it and brainstorm:rolleyes:
Auto-translated
In the Real-Time Arena (RTA), it’s necessary to display a list of possible heroes that the opponent has. Currently, I’ve implemented it so that their names are repeated above the opponent’s castle using fly-text messages. Visually, it’s not very clear to identify the heroes by name; it would be better if their faces were visible. I considered using posters, but it’s too time-consuming – I would need to create 88 posters. Creating posters for 48 spells took about 3 hours, but it was necessary because the spells need to be displayed in every game, while the possible heroes are only shown when the Scouting perk is acquired. Another quick option is to retrieve the necessary heroes from the reserve and keep them in a special enclosure with their movement points removed, but then the heroes would also appear in the bottom panel, which isn’t ideal either.
In reply to Mostovik
Auto-translated
Mostovik
In the Real-Time Arena (RTA), it's necessary to display a list of possible heroes that the opponent has acquired. Currently, I've implemented it so that their names are repeatedly shown above the opponent's castle using a fly-text message. However, it's visually difficult to recognize the heroes by their names; it would be better if their faces were visible. I considered using posters, but it would be too time-consuming – I'd need to create 88 posters. Creating posters for the 48 spells took me about 3 hours, but it was necessary because the spells need to be displayed in every game, while the possible heroes only need to be shown when the Scouting perk is acquired.
Another quick option would be to retrieve the necessary heroes from the reserve and keep them in a special enclosure with their movement points deducted, but then the heroes would also appear in the bottom panel, which isn't ideal.
Overall, after some digging, I found a way to display more than one icon in a MessageBox. But this raises another problem – how to call up the necessary icons using a script, i.e., a reference to the texture. It exists in TalkBox as one of the parameters (you can vary it with variables from an array) – but again, there's only one parameter, i.e., one icon. The MessageBox doesn't have such a parameter (only text).
Overall, the poster implementation will be simpler and faster :smile33:

Statistics

Welcome our newest member: Emil