Posts from Scripts
Has anyone managed to create their own hero specialization using scripts? For example, making a specialist for skeletons… :confused:
If you're interested, you can study and copy scripts from a mod whose main goal is new specializations:
/topic/9337/
Added after 14 hours 41 minutes
Is there a function that determines which direction an object is facing?
NHF 0.90 : NHF - группа в VK
Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
Added 14 hours and 41 minutes ago
Is there a function that determines which direction an object is facing?
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
I don't think this will be necessary. Portals only have 4 possible rotation angles, and they can be determined by the relative position of the mob.
NHF 0.90 : NHF - группа в VK
Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
Please help! I can't figure out what's wrong; the script just won't work, no matter what I try.function biaraF()
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "biara", nil);
MessageBox(GetMapDataPath()..'text9.txt');
SetObjectPosition('Raelag', 8, 129, 0)
end;
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "biara", "biaraF");
It seems like everything is correct, and the hero's name matches the script, so there shouldn't be any errors here. The console displays: "Can't find terrain info file for map... and the map directory." All other scripts work, but this one doesn't react at all when entering the region :smile32:
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
Added 16 minutes later
I fixed the ground texture error, but the script still isn't working. I discovered a strange thing: the hero teleports, but to a completely different function (a different trigger). The regions don't overlap... I don't understand what's wrong.
O_o Hmm... the earth texture file seems to have disappeared. When exiting to the surface in the game, it crashes; in the editor, the texture is simply missing, and objects are floating in the air... I'll try copying this file from another map and editing it there :(
Added 16 minutes later
I fixed the surface error, but the script still isn't working. I discovered a strange thing: the hero teleports, but to a completely different function (a different trigger). The regions don't overlap... I don't understand what's wrong :(
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
I can't seem to get the GetDate function to work.
I need it so that when quest N is received, a countdown starts until day M (in my case, day 10), and when the 10th day arrives since the quest was received, a certain action is performed. But it's also necessary that if the hero completes the quest within those 10 days, the trigger resets, and the function loses its meaning. I wrote a complicated function with a bunch of if statements, but it refuses to work. The console doesn't output anything :( .
And is it possible to make him see portals? For example, if the path to the castle is through a portal, he doesn't react to movehero(... castle coordinates).
Возрождённый v 1.5 (обновление от 25/09/2016) :smile24:
готовится продолжение.
Великая Пустыня ( 25%) - про Маркела
Тьма над Иролланом (0%) - про Николаса
Мои моды (скорректированы мод на чумных энтов и циклопов зомби)
I'm having a problem: (
I can't seem to get the GetDate function to work.
I need it so that when quest N is received, the countdown to day M (in my case, 10) begins, and when the 10th day arrives since the quest was received, a certain action is performed. But it's also necessary that if the hero completes the quest within those 10 days, the trigger resets, and the function loses its meaning. I wrote a complicated function with a bunch of if statements, but it refuses to work. The console doesn't output anything :( .
I don't think it's that complicated. Here's how you can do it. You have the quest being received triggered by a function, right?
Then:
n = 0 (write this outside of all functions)
--Your function--
....
Quest received (the required one)
n = 1 -- now we set n to one
--end of function--
Now, through a trigger for a new day (Trigger(NEW_DAY_TRIGGER , 'day')) (example), call the function to execute.
--new day function--
if n > 0, then
n = n + 1 -- if n > 0, which in our case means that the quest has already become active, we increment n by 1.
--end of new day function--
Thus, we add +1 to n each day, starting from the day after the quest is received.
Now, all that remains is to write the verification function (it can be written directly inside the new day function)
--new day function--
--what is written above--
if n == 11 and the quest has already been completed, then
Your actions
Otherwise, if n == 11, then (this already means that after this time, the quest has not been completed)
Your other actions
"For aesthetics, if you don't need the counter to continue, make n = 0"
--end of new day function--
If "Your actions" are already written in another function, that's not a problem. Instead, write startThread (name_of_function_with_actions). That's it, I think. [/code]Now, a little reference material:
Trigger(NEW_DAY_TRIGGER , 'day') -- trigger for a new day
SetObjectiveState ('objname' , OBJECTIVE_ACTIVE) -- activate the quest, replace the first parameter with the name of your quest
SetObjectiveState ('objname' , OBJECTIVE_COMPLETED/FAILED) -- complete the quest, or fail it.
n = 0 -- and so on (variable)
Trigger(TRIGGER_NAME, nil) -- reset the trigger.
Thus, here is the complete script: (instead of red, you substitute your values):
n = 0
function xxx
...
SetObjectiveState ('obj1' , OBJECTIVE_ACTIVE)
n = 1
end
Trigger(NEW_DAY_TRIGGER , 'day')
function day
if n > 0 then
n = n + 1
end
if n == 11 and GetObjectiveState ('obj1') == OBJECTIVE_COMPLETED then
...
elseif n == 11 then
...
end
endI don't think I wrote anything more complicated. ;)
I don't think it's that complicated. So, here's the idea. You have a function that handles receiving the quest, right?
Then:n = 0 (write this outside of all functions)
--Your function--
....
Receive the quest (the required one)
n = 1 -- now we set n to one
--end of function--
Now, using a trigger for a new day (Trigger(NEW_DAY_TRIGGER , 'day')) (as an example), call the function to execute.
--new day function--
if n > 0, then
n = n + 1 -- if n > 0, which in our case means that the quest has already become active, we increment n by 1.
--end of new day function--
Thus, we add +1 to n every day, starting from the day after the quest is received.
Now, all that remains is to write a check function (it can be written directly inside the new day function)
--new day function--
--what is written above--
if n == 11 and the quest has already been completed, then
Your actions
Otherwise, if n == 11, then (this already means that the quest has not been completed within this time)
Your other actions
"For aesthetics, if you don't need the counter to continue, set n = 0"
--end of new day function--
If "Your actions" are already written in another function, that's fine. Instead, write startThread (name_of_the_function_with_actions). That's it, I think.[/code]
Now, a little reference material:
Trigger(NEW_DAY_TRIGGER , 'day') -- trigger for a new day
SetObjectiveState ('objname' , OBJECTIVE_ACTIVE) -- activate the quest, replace the first parameter with the name of your quest
SetObjectiveState ('objname' , OBJECTIVE_COMPLETED/FAILED) -- complete the quest, or fail it.
n = 0 -- and so on (variable)
Trigger(TRIGGER_NAME, nil) -- reset the trigger.
Thus, here is the complete script: (replace the red with your values):n = 0
function xxx
...
SetObjectiveState ('obj1' , OBJECTIVE_ACTIVE)
n = 1
end
Trigger(NEW_DAY_TRIGGER , 'day')
function day
if n > 0 then
n = n + 1
end
if n == 11 and GetObjectiveState ('obj1') == OBJECTIVE_COMPLETED then
...
elseif n == 11 then
...
end
end
I don't think I wrote anything more complicated. ;)
Thank you very much :) You explained it clearly and understandably. I'll know now :)
Пробуждение зла
Нашествие из Преисподней
Смена эпох
Скачать все кампании одним архивом: Яндекс.Диск Google.Диск
You can download the set of 3 Campaigns (English version) here
Одиночные сценарии Heroes V 3.1:
Незваные гости
Красный кристалл
Синий кристалл
Закат тьмы
Мультиплеерные карты для Heroes V 3.1:
Легендарная война
Сердце вулкана
Передел мира