Skip to content

Posts from Scripts

4.8 (8 ratings)
In reply to Олегарх
User Avatar
Auto-translated
Does anyone know how TalkBoxForPlayers works?
In reply to Олегарх
Auto-translated
Oligarch
Does anyone know how TalkBoxForPlayers works?
Check out my maps – everything is clearly described there (with variables – it’s all clear from the name).
In reply to JonnyP
User Avatar
Auto-translated
JonnyP
check my maps – everything is clearly described there (with variables – it's clear from the name)
and which ones exactly?
In reply to Олегарх
Auto-translated
Oligarch
and in which ones exactly?
Here, take a look:
TalkBoxForPlayers (PLAYER_1, face_Derin, bio_Derin, nil, nil, 'TALK', 0, name_Derin, GetMapDataPath().."names_and_desc/q000.txt", 1, GetMapDataPath().."dialogs/derin001.txt");

PLAYER_1 - indicates which player the message is shown to
face_Derin - variable - this is the icon texture
bio_Derin - variable, text that appears when you right-click the icon
'TALK' - function (here it selects the answer number)
0 or 1 - window type ("ok" or "ok/close")
name_Derin - variable, text at the very top of the window
GetMap.... - here it's the path to the file (by default, it writes 'your choice')
1...5 or nil - the number of the highlighted answer
then come the paths to files from 1 to 5 (in the example, only 1)

(the path of the Fallen or the death of the Raven - it's used in both cases, it's not difficult to figure out)
And also - the function is non-modal, all variables are the path to specific files

Added 6 minutes later
Here's another one, you might not know, in MapScriptEditor, when you type a function and put the first parenthesis '(', a hint appears - it's conveniently done, and in principle, the same thing I described will pop up
In reply to JonnyP
User Avatar
Auto-translated
Where can I get the icon, and how does the "TALK" function work?
In reply to Олегарх
Auto-translated
Oligarch
Where can I get an icon, and how does the "TALK" function work?
There are plenty of icons in the game – creatures, heroes... the size is 128x128. For example, here's a path:
face_Dugal = "/Textures/Icons/Heroes/Heaven/Heaven_Dougal_128x128.(Texture).xdb#xpointer(/Texture)";
This will display Dugal's face.
TALK, like MessageBox, displays a message, but with answer options (from 1 to 5).
In reply to JonnyP
User Avatar
Auto-translated
So, how do you determine which answer is correct?
User Avatar
Auto-translated
By number. This function returns the number of the selected answer in the callback.
 

К А
Стикеры GBF в Telegram
In reply to Ment
User Avatar
Auto-translated
Ment
By number. This function returns the number of the selected answer in the callback.
Does this function actually work everywhere? When entered into the script editor, the editor doesn't recognize it as a function (it doesn't color it red).
In reply to Олегарх
Auto-translated
Oligarch
Does this function actually work everywhere? When I enter it into the script editor, it doesn't recognize it as a function (it doesn't highlight it in red).
Yes, it definitely works, but only in version 3.1 of the game. It seems you're writing scripts directly in the editor. It's better to use MapScriptEditor – it's clearer (it's a separate program).
Regarding the 'TALK' function:

function TALK(g1,g2) --response to choice--
answer=0;
if g1>0 then ask=1; answer=g2; end;
end;

Do I need to explain it, or is it clear? And of course, you need to make TalkBoxForPlayers modal, for example like this:

ask=0; TalkBoxForPlayers (....); while ask<=0 do sleep(2); end;

After that, you write the conditions:
if answer==1 then
else
if answer==2 then
.........
and so on.
In reply to JonnyP
User Avatar
Auto-translated
JonnyP
Yes, it definitely works, but only in version 3.1 of the game. It seems you are writing scripts directly in the editor; it would be better to use MapScriptEditor – it's clearer (it's a separate program).
Regarding the 'TALK' function:

function TALK(g1,g2) --response to a choice--
answer=0;
if g1>0 then ask=1; answer=g2; end;
end;

Do I need to explain it, or is it clear? And of course, you need to make TalkBoxForPlayers modal, for example like this:

ask=0; TalkBoxForPlayers (....); while ask<=0 do sleep(2); end;

After that, you write the conditions:
if answer==1 then
else
if answer==2 then
.........
and so on.

___Thank you.
Мои карты:
Town
Готовится:Чума (40%), Сосиска(42%), Война Грааля
In reply to Победитель
User Avatar
Auto-translated
Winner
Why force them to run across the entire map when you can just teleport them?

to make it more realistic, heroes should run; they're not teleporters after all (from the movie "Teleport" :smile26:).
Карты для Heroes V: Повелители орды:
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация
In reply to KioM
User Avatar
Auto-translated
Is it possible to implement a check for the presence of a monster on the map?
Мои карты:
Town
Готовится:Чума (40%), Сосиска(42%), Война Грааля
In reply to Олегарх
Auto-translated
Oligarch
Is it possible to implement a check for the presence of a monster on the map?
of course, you can )
you write the monster's name, and then you check
if IsObjectExist ('monster name') then ....
User Avatar
Auto-translated
Hello everyone, can anyone help me understand the command:
CreateStatic
Here's an example from the description:
CreateStatic(scriptName, DataFile, x, y, floorId, rotation, terrainAligned, scalePercent);

All parameters are clear except for DataFile
For some reason, I thought that the path to the extracted object should be specified, but it seems like something else is needed there (I need the name, but I don't understand what kind of name it is...).
Карты для Heroes V: Повелители орды:
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация

Statistics

Welcome our newest member: Emil