Posts from Scripts
Does anyone know how TalkBoxForPlayers works?
check my maps – everything is clearly described there (with variables – it's clear from the name)
and in which ones exactly?
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
Where can I get an icon, and how does the "TALK" function work?
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).
By number. This function returns the number of the selected answer in the callback.
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).
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.
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.
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:).
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация
Is it possible to implement a check for the presence of a monster on the map?
you write the monster's name, and then you check
if IsObjectExist ('monster name') then ....
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...).
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация