Skip to content

Posts from Scripts

4.8 (8 ratings)
User Avatar
Auto-translated
or here is another clear and quite large table... no, even better, a REALLY BIG table with explanations and descriptions of the functions. I even made a script based on this table, and it works! In short, it's AMAZING!
Attachments 1
1 file attached • Total size: 1.1 MB
User Avatar
Auto-translated
damn, that's not it, here's the thing
Attachments 1
1 file attached • Total size: 88.3 KB






User Avatar
Auto-translated
Please explain the correct way to write the StartDialogScene function.






User Avatar
Auto-translated
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)")
helped :D
Всё, что сейчас происходит во мне, тоже является частью Вселенной. (с) Иванов Александр.
Цикл кампаний "Дыхание Смерти" из трёшки в четвёртом исполнении
Учебная карта
Астралия
За Королеву!
Подземелья и Дьяволы
Отголоски войны
Освобождение
User Avatar
Auto-translated
not very:smile50:

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)")






User Avatar
Auto-translated
the path needs to be correct
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
Всё, что сейчас происходит во мне, тоже является частью Вселенной. (с) Иванов Александр.
Цикл кампаний "Дыхание Смерти" из трёшки в четвёртом исполнении
Учебная карта
Астралия
За Королеву!
Подземелья и Дьяволы
Отголоски войны
Освобождение
User Avatar
Auto-translated
Now I understand everything.






User Avatar
Auto-translated
this script doesn't work((:
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:






User Avatar
Auto-translated
You need to call the Trigger after the function, not during it. During execution, you need to cancel its performance. Example:
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.
 

К А
Стикеры GBF в Telegram
In reply to Ment
User Avatar
Auto-translated
okay..... and here's another one: and here's another question: I need the hero to enter the hut if he has a specific artifact; if he does, the hero gains experience, and if not, a message appears apologizing that the required artifact was not found. Here's what I wrote: ``` function buildF () if HasArtefact ("Isabell",ID_86); then MessageBox ("/Maps/SingleMissions/Let's go!/runa.txt"); ChangeHeroStat ("Isabell", STAT_EXPERIENCE, 12000); Trigger(OBJECT_TOUCH_TRIGGER, "build", nil ); else MessageBox ("/Maps/SingleMissions/Let's go!/runa1.txt"); end; end; Trigger(OBJECT_TOUCH_TRIGGER, "build", "buildF"); ``` What's wrong, because it's not working.






User Avatar
Auto-translated
I don't know how to do it with scripts, but if I remember correctly, you can set everything you need in the property tree of that object.
Всё, что сейчас происходит во мне, тоже является частью Вселенной. (с) Иванов Александр.
Цикл кампаний "Дыхание Смерти" из трёшки в четвёртом исполнении
Учебная карта
Астралия
За Королеву!
Подземелья и Дьяволы
Отголоски войны
Освобождение
User Avatar
Auto-translated
Oh, you've taken on some complex scripts, and now no one but you can help. I once tried to create something similar, but nothing worthwhile came of it. Here's a simpler approach:
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.
Клан "Вершители Асхана" - "Masters of Ashan"
User Avatar
Auto-translated
How do you remove the skirt from the peasant's corpse? Has anyone figured it out? The corpse with the circle underneath looks strange.
Кампания "Судьба Империи" - 25% готовность
User Avatar
Auto-translated
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");

it still doesn't work.






User Avatar
Auto-translated
What does the console say? Also, try testing the script on a new map without any other scripts.

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: _.
Клан "Вершители Асхана" - "Masters of Ashan"

Statistics