Skip to content

Posts from Scripts

4.8 (8 ratings)
User Avatar
Auto-translated
Bravo1853, I would recommend that after receiving answers on the forum, you refer to the manual for descriptions of the proposed functions; this would significantly shorten the path to finding a solution. The last parameter, PlayObjectAnimation, can be changed to:
IDLE – the animation is played cyclically until it is replaced by another animation.
ONESHOT_STILL – the animation is played once, and after it is finished, the object remains in the posture it took in the last frame of the animation.
ONESHOT – the animation is played once, and after it, the object’s standard idle animation is started.
If you are setting the number of repetitions using your own code, then you should play a single animation using ONESHOT_STILL / ONESHOT.
User Avatar
Auto-translated
Thank you all very much for the advice. Also, could you please tell me if there is a function that identifies the script name of a hero who has entered a specified region, so that you can then work with that hero? For example, if hero N enters a region, and 10 archers are added to his army, how can you use scripts to determine the name of this hero N? And is this even possible? Thank you in advance.
User Avatar
Auto-translated
The Knight of the Abyss, the hero's name will be passed as the first parameter to the trigger handler function.
Auto-translated
Hello everyone! I've become interested in this game and have a few questions about the script. I placed a checkpoint (this road is guarded), then replaced the checkpoint model with an Arena, and added 30 wolves, 12 swordsmen, and 4 adepts. The checkpoint name is Arena. 1. After capturing this Arena object, I need the player who captured it to receive 10 mercury, 200 wood, and 5000 gold. 2. After capturing the Arena, 10 wolves should join the player's hero. 3. And he should receive 2000 experience points, and 12 skeletons should appear in his city. 4. And where should I write all of this? If this question has already been asked, I apologize. Thank you in advance! And I wish everyone good luck!
Auto-translated
How can I make a text message appear for a single player when their hero stops in a region? I looked through the functions, but couldn't find anything. The map is for multiplayer.
User Avatar
Auto-translated

function show_msg(hero)
if IsAIPlayer(GetObjectOwner(hero)) == 0 then
MessageBoxForPlayers(GetPlayerFilter(GetObjectOwner(hero)), "path to text")
end
end

Trigger(REGION_ENTER_AND_STOP_TRIGGER, "region", "show_msg")
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
Auto-translated
It doesn't work; I specified the correct path and region.
function show_msg(hero)
	if IsAIPlayer(GetObjectOwner(hero)) == 0 then
		MessageBoxForPlayers(GetPlayerFilter(GetObjectOwner(hero)), "Maps/Multiplayer/Map/Text.txt")
	end
end

Trigger(REGION_ENTER_AND_STOP_TRIGGER, "Reg", "show_msg")
User Avatar
Auto-translated
function BanditsF()
StartDialogScene("/DialogScenes/Dialogs/Scene1(Bandits)/DialogScene.xdb#xpointer(/DialogScene)");
sleep(5)
StartCombat('RedHeavenHero04', nil, 40, 2, 20, 2, 20, nil, nil, nil)
sleep(5)
PlayObjectAnimation("q3", "death", ONESHOT_STILL);
PlayObjectAnimation("q4", "death", ONESHOT_STILL);
SetObjectEnabled('q3', nil)
SetObjectEnabled('q4', nil)
end;
Help, gentlemen! This script doesn't work! The idea was that after the cutscene, a battle between the hero and the creatures should begin, but for some reason, this doesn't happen. The console displays something about incorrect parameters for the third creature, although I only need two. I haven't seen similar scripts in the Nival campaigns.
...И справедливость я несу
На острие меча.


Кампания "Искупление" - 15%



О кампании

"Искупление" - это мой амбициозный проект. Давняя мечта. С детства играя в героев, я восхищался персонажами и ландшафтами, сюжетом и стилем оригинальной трилогии, я мечтал привнести что-то свое в эту игру,  и наконец, более-менее освоив нелегкий труд картостроителя, взялся за воплощение мечты. Кампания расскажет о будущем выживших рыцарей Кровавой Стали, о пути, который они избрали, и о том, куда этот путь их приведет. К слову, мне нужен тестер-оценщик. Если хочешь принять участие в создании и есть определенный опыт, то - добро пожаловать!



In reply to RedHeavenHero
User Avatar
Auto-translated
RedHeavenHero
The third parameter – the number of units – is missing.
Thank you. I will test it tomorrow.
...И справедливость я несу
На острие меча.


Кампания "Искупление" - 15%



О кампании

"Искупление" - это мой амбициозный проект. Давняя мечта. С детства играя в героев, я восхищался персонажами и ландшафтами, сюжетом и стилем оригинальной трилогии, я мечтал привнести что-то свое в эту игру,  и наконец, более-менее освоив нелегкий труд картостроителя, взялся за воплощение мечты. Кампания расскажет о будущем выживших рыцарей Кровавой Стали, о пути, который они избрали, и о том, куда этот путь их приведет. К слову, мне нужен тестер-оценщик. Если хочешь принять участие в создании и есть определенный опыт, то - добро пожаловать!



User Avatar
Auto-translated
Hey guys! Help a newbie out. I've been searching the internet, but I can't find anything useful. Basically, I need a simple script (or trigger, whatever they're called) so that when the main hero enters a specific area, a hero (hidden in the fog of war, of course) teleports to him, and a window appears with a message. After reading the message, the hero returns to his original location. Whew. I hope you can help. I've read a lot on this forum (but not everything, it's 140 pages!), but I still don't understand. Also, it would be great if you could tell me where to put these triggers and scripts. Thanks in advance.
In reply to OrnsteinDragonslayer
User Avatar
Auto-translated
OrnsteinDragonslayer
Hey guys! Help a newbie out. I've been searching and searching, but I can't find anything useful on the internet. Basically, I need a simple script (or trigger, whatever they're called) so that when the main hero enters a specific area, a hero (hidden in the fog of war, of course) teleports to him, and a window appears with a message. After reading the message, the hero returns to his original location. Whew. I hope you can help. I've read a lot on this forum (but not everything, it's 140 pages!), but I still don't understand. Also, it would be great if you could tell me where to put these triggers and scripts. Thanks in advance.
I haven't been working on maps much lately, but I can help. I'll write to you later with instructions on how to do it. I'll try it myself first.
...И справедливость я несу
На острие меча.


Кампания "Искупление" - 15%



О кампании

"Искупление" - это мой амбициозный проект. Давняя мечта. С детства играя в героев, я восхищался персонажами и ландшафтами, сюжетом и стилем оригинальной трилогии, я мечтал привнести что-то свое в эту игру,  и наконец, более-менее освоив нелегкий труд картостроителя, взялся за воплощение мечты. Кампания расскажет о будущем выживших рыцарей Кровавой Стали, о пути, который они избрали, и о том, куда этот путь их приведет. К слову, мне нужен тестер-оценщик. Если хочешь принять участие в создании и есть определенный опыт, то - добро пожаловать!



Auto-translated
How can I make a town be destroyed when it is captured?

Statistics

Welcome our newest member: Emil