Skip to content

Posts from Scripts

4.8 (8 ratings)
User Avatar
13 years ago
Auto-translated
How is this possible? I've already used something similar in previous maps, and it worked: function loserF(heroname1, heroname2) if heroname1=="Segref" then Loose(); end; end; Trigger(2, 1, "loserF"); The only difference is that now the losing hero is controlled by the computer, not a human.
Кампании для Heroes V 3.1 (Трилогия):

Пробуждение зла
Нашествие из Преисподней
Смена эпох

Скачать все кампании одним архивом: Яндекс.Диск Google.Диск

You can download the set of 3 Campaigns (English version) here


Одиночные сценарии Heroes V 3.1:


Незваные гости
Красный кристалл
Синий кристалл
Закат тьмы

Мультиплеерные карты для Heroes V 3.1:

Легендарная война
Сердце вулкана
Передел мира
In reply to MasteR
User Avatar
13 years ago
Auto-translated
Something like this. ```html
function checkGrok()
	while IsHeroAlive("Grok") do sleep(10) end
	SetObjectiveState('Sec17', 3)
	sleep(3)
	...
end

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

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
13 years ago
Auto-translated
I'm a bit slow, and I don't quite understand how this function works. I've never used startThread before. Grok is killed almost at the very end of the game; won't this somehow slow down the game?
Couldn't you do something similar using NewDayTrigger?
Кампании для Heroes V 3.1 (Трилогия):

Пробуждение зла
Нашествие из Преисподней
Смена эпох

Скачать все кампании одним архивом: Яндекс.Диск Google.Диск

You can download the set of 3 Campaigns (English version) here


Одиночные сценарии Heroes V 3.1:


Незваные гости
Красный кристалл
Синий кристалл
Закат тьмы

Мультиплеерные карты для Heroes V 3.1:

Легендарная война
Сердце вулкана
Передел мира
User Avatar
13 years ago
Auto-translated
Hooray, it seems to have worked! Thank you.
I've made some slight modifications to the function; I hope it's still correct.
function checkGrok()
while (gro==0) do
sleep(10);
if (IsObjectExists("Grok")==nil) then
gro=1;
SetObjectiveState("Sec17", 3, 1);
sleep(3);
...
end;
sleep(5);
end;
sleep(5);
end;

startThread(checkGrok);
Кампании для Heroes V 3.1 (Трилогия):

Пробуждение зла
Нашествие из Преисподней
Смена эпох

Скачать все кампании одним архивом: Яндекс.Диск Google.Диск

You can download the set of 3 Campaigns (English version) here


Одиночные сценарии Heroes V 3.1:


Незваные гости
Красный кристалл
Синий кристалл
Закат тьмы

Мультиплеерные карты для Heroes V 3.1:

Легендарная война
Сердце вулкана
Передел мира
User Avatar
13 years ago
Auto-translated
something like this might also work

Whatever
In reply to Heroist
User Avatar
13 years ago
Auto-translated
The command
CreateStatic ("mel_quest_tavern", "MapObjects\Effects\Glow\ArtifactGold.(AdvMapStaticShared)", 42, 147, 0)
produces the error "not found static shared". What could be the problem?
Мои карты:
Town
Готовится:Чума (40%), Сосиска(42%), Война Грааля
In reply to Олегарх
User Avatar
13 years ago
Auto-translated
Oligarch
The command
CreateStatic ("mel_quest_tavern", "MapObjects\Effects\Glow\ArtifactGold.(AdvMapStaticShared)", 42, 147, 0)
produces the error "not found static shared". What could be the problem?
try removing ".(AdvMapStaticShared)".
502 Bad Gateway
__________________________________
nginx/0.8.54
In reply to Олегарх
User Avatar
13 years ago
Auto-translated
Oligarch
When the command
CreateStatic ("mel_quest_tavern", "MapObjects\Effects\Glow\ArtifactGold.(AdvMapStaticShared)", 42, 147, 0)
is executed, it produces the error "not found static shared". What could be the problem?
The path is written incorrectly: the slashes are in the wrong direction, and .xdb#xpointer(/AdvMapStaticShared) is missing.
Wouldn't it be easier to create an effect instead of a static object?
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to RedHeavenHero
User Avatar
13 years ago
Auto-translated
RedHeavenHero
The path is written incorrectly: the slashes are in the wrong direction, and .xdb#xpointer(/AdvMapStaticShared) is missing.
Wouldn't it be easier to create an effect instead of a static object?
Can an effect be attached to a building or creature?
"/MapObjects/Effects/Glow/ArtifactGold.xdb#xpointer(/AdvMapStaticShared)" also doesn't work, nor does it work without the slash at the beginning of the path.
Okay, I figured it out: "/MapObjects/Effects/Glow/ArtifactGold.(AdvMapStaticShared).xdb#xpointer(/AdvMapStaticShared)." It's so convoluted!
Thanks to everyone.
Мои карты:
Town
Готовится:Чума (40%), Сосиска(42%), Война Грааля
In reply to Олегарх
User Avatar
13 years ago
Auto-translated
The second parameter of PlayVisualEffect is the name of the object on which the effect will be played.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to RedHeavenHero
User Avatar
13 years ago
Auto-translated
RedHeavenHero
The second parameter in PlayVisualEffect is the name of the object on which the effect will be played.
Thank you.
Here is another question.
TalkBoxForPlayers(PLAYER_1,'/UI/Tavern/RumorsIcon.(Texture).xdb#xpointer(/Texture)', nil,GetMapDataPath().."mel_dopquest_krest_yes_texttalk.txt","","mel_dopquest_krest_yes", 0, "", "", 0, GetMapDataPath()..."mel_dopquest_krest_yes_texttalk.txt", GetMapDataPath().."mel_dopquest_krest_no_texttalk.txt")
In general, the function works as it should. But the 4th parameter, which is specified as the path to the dialogue text in ValexAV's guide, stubbornly does not display this text. If I specify the same path in another parameter, it will be displayed there.
I used Dyrmana's "Journey" map as a basis, its code:
kvest1_1=(GetMapDataPath().."kvest1_vibor_1.txt");
kvest1_2=(GetMapDataPath().."kvest1_vibor_2.txt");
kvest1_3=(GetMapDataPath().."kvest1_vibor_3.txt");
kvest1_4=(GetMapDataPath().."kvest1_vibor_4.txt");

TalkBoxForPlayers(PLAYER_1,'/Textures/Icons/Heroes/Academy/Academy_Razzak_128x128.(Texture).xdb#xpointer(/Texture)',
"",GetMapDataPath().."kvest1_dialog.txt","","na_vibor_kvest_1",1,GetMapDataPath().."kvest1_zagolovok.txt","",0,
kvest1_1,kvest1_2,kvest1_3,kvest1_4) ;
also does not display the dialogue text. If I understand correctly, it should be located to the right of the icon?
Мои карты:
Town
Готовится:Чума (40%), Сосиска(42%), Война Грааля
In reply to Олегарх
User Avatar
13 years ago
Auto-translated
If you create a UI\CommonBoxes\TalkBox\Text.txt file with the following content: `
[h5][color_bright][value=text]
` (replace the square brackets with less than/greater than signs and save it in Unicode), then it will be displayed.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to RedHeavenHero
User Avatar
13 years ago
Auto-translated
RedHeavenHero
If you create a UI\CommonBoxes\TalkBox\Text.txt file with the following content:
[h5][color_bright][value=text]
(just replace the square brackets with less than/greater than signs, and save it in Unicode), then it will be displayed.
So, does this path need to be embedded in the map?
Мои карты:
Town
Готовится:Чума (40%), Сосиска(42%), Война Грааля

Statistics

Welcome our newest member: recijeb