Posts from Scripts
StartCutScene
StartCutScene – starts a cutscene.
Syntax
StartDialogScene(cutSceneName, callback = "", saveName = "");
Description
This function starts the specified cutscene.
cutSceneName – a pointer to the cutscene in the resource database.
callback – the name of the function that will be called after the dialog scene is played.
saveName – the name of the save file (see the Save command) that will be created before the dialog scene.
StartDialogScene
StartDialogScene – starts a dialog scene.
Syntax
StartDialogScene(dialogSceneName, callback = "", saveName = "");
Description
This function starts the specified dialog scene.
dialogSceneName – a pointer to the dialog scene in the resource database.
callback – the name of the function that will be called after the dialog scene is played.
saveName – the name of the save file (see the Save command) that will be created before the dialog scene.
Example 1:
StartDialogScene("/DialogScenes/C6/M4/C1/DialogScene.xdb#xpointer(/DialogScene)")
Цикл кампаний "Дыхание Смерти" из трёшки в четвёртом исполнении
Учебная карта
Астралия
За Королеву!
Подземелья и Дьяволы
Отголоски войны
Освобождение
Added 50 seconds ago
and the dialogue scene where to create
Added 44 minutes ago
in the MessageBox function, should the path to the text file be specified completely (e.g., D:/games/hmm2mp/folder where the text is) or how?
Added 20 minutes ago
what did I write incorrectly here: MessageBox ("/messagaName/UserCampaigns/dialog.txt(/messageName)")
Added 1 minute ago
if anything, it's like this: MessageBox ("/messageName/UserCampaigns/dialog.txt(/messageName)")
here's an example
MessageBox("/Maps/SingleMissions/Necronomicon/Rss.txt")
+
are you sure you can handle a dialogue and scripting scene?
and you can create a great map without them
++
in general, there are maps on the internet (and maybe even here) with scripting and dialogue scenes
all you need to do is look at the relationship in the script of such a map and understand it
and then copy and paste it to yourself and redo it again for yourself
Цикл кампаний "Дыхание Смерти" из трёшки в четвёртом исполнении
Учебная карта
Астралия
За Королеву!
Подземелья и Дьяволы
Отголоски войны
Освобождение
function reg1()
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "reg1","reg1F");
MessageBox("/Maps/dialog.txt");
end;
function reg2()
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "reg2","reg2F");
MessageBox("/Maps/griffin.txt");
end;
function reg3()
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "reg3","reg3F");
MessageBox("/Maps/ghost.txt");
end;
please tell me what I wrote wrong... I already came up with a plot and I need a message to appear in these regions
Added 3 minutes ago
when I press "chek" (check for errors), it tells me:
function reg1 not defined, line 1
function reg2 not defined, line 5
function reg3 not defined, line 9
if anything, reg1, reg2, reg3 are regions
Added 56 minutes ago
and also this script:
function build()
if HasArtefact("Isabell", ID_runa);
then MessageBox("/Maps/runa.txt");
ChangeHeroStat("Isabell", STAT_EXPERIENCE, 12000);
Trigger(OBJECT_TOUCH_TRIGGER, "build", nil);
else MessageBox("/Maps/runa1.txt");
end;
end;
here:
build - function name
runa - ID of the artifact
Isabell - script name of the hero
something is wrong:confused: but what:confused:
function FunEx (hero)
{code}
Trigger(REGION_ENTER_AND_STOP_TRIGGER,"RegEx",nil);
end;
Trigger(REGION_ENTER_AND_STOP_TRIGGER,"RegEx","FunEx",nil);
The principle is the same in another script.
You don't need to pay attention to the messages. The editor always complains, but sometimes it works anyway.
Цикл кампаний "Дыхание Смерти" из трёшки в четвёртом исполнении
Учебная карта
Астралия
За Королеву!
Подземелья и Дьяволы
Отголоски войны
Освобождение
function primer()
while 1 do
if HasArtefact ("Isabell",ID_86) then
ChangeHeroStat ("Isabell", STAT_EXPERIENCE, 12000);
MessageBox ("/Maps/SingleMissions/Let's go!/runa.txt");
sleep( 3 );
Trigger(OBJECT_TOUCH_TRIGGER, "primerreg", nil );
end;
sleep( 3 );
end;
end;
Trigger(OBJECT_TOUCH_TRIGGER, "primerreg", "primer");
while do is a loop in the C++ language, which is actually used in the game. 1 means it runs once and then stops. In all the developer's scripts, 1 is used; draw your own conclusions and experiment.
It should work like this. If the condition is met, it triggers; if not, it doesn't. You can try using else, or rather, elseif. But again, the tree will only trigger once. And once the artifact is obtained, the script will no longer work. Therefore, you'll have to come up with something more complex.
And yes... ChangeHeroStat seems to work differently; I'll take a look at it sometime and let you know if it doesn't work as expected.
while 1 do
if HasArtefact ("Isabell",ID_86) then
ChangeHeroStat ("Isabell", STAT_EXPERIENCE, 12000);
MessageBox ("/Maps/SingleMissions/Let's go!/runa.txt");
sleep( 3 );
Trigger(OBJECT_TOUCH_TRIGGER, "primerreg", nil );
end;
sleep( 3 );
end;
end;
Trigger(OBJECT_TOUCH_TRIGGER, "primerreg", "primer");
it still doesn't work.
Let's go! - is this a map? In general, try without spaces; I haven't seen any spaces in the developers' scripts except for this: _.



