Skip to content

Posts from Scripts

4.8 (8 ratings)
In reply to Heroist
User Avatar
#926
Auto-translated
This is getting too complicated. You need to be a programmer, at the very least. The specializations are hardcoded into the program, which, as far as I can tell, isn't even written in Lua.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
#927
Auto-translated
too bad...

okay, but how can I determine if a unit stack has been destroyed directly in battle? Using the `exist` function? Or some other method?

Added 15 minutes later
Update: At least, I found a very interesting folder called RPGstats. You can change almost everything there, including, by the way, some of the hero specializations.

Whatever
In reply to Heroist
User Avatar
#928
Auto-translated
It seems like that's the way to do it. But there's an alternative: the AttackerCreatureDeath (DefenderCreatureDeath) function is called when a creature dies, with the creature's name as an argument. You only need to write the "body" of the function.
function AttackerCreatureDeath(unit)
...
end
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
#929
Auto-translated
Aha, that’s how you should have dealt with her. I thought she just killed the monster.

Whatever
In reply to RedHeavenHero
User Avatar
#930
Auto-translated
RedHeavenHero
This is getting too complicated. You need to be a programmer, at the very least. The specializations are hardcoded into the program, which, as far as I know, isn't even written in Lua.
Lua is a scripting language; the program itself is written in another language, like C++.
Мои карты:
Town
Готовится:Чума (40%), Сосиска(42%), Война Грааля
User Avatar
#931
Auto-translated
No matter what platform it's on, we currently only have access to the machine code... I wish they would release the source code soon!
 

К А
Стикеры GBF в Telegram
User Avatar
#932
Auto-translated
Is there a function that allows you to place a hero in a town or at the town gates from any point on the map?
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
In reply to Dyrman
User Avatar
#933
Конечно. SetObjectPosition.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to RedHeavenHero
User Avatar
#934
Auto-translated
RedHeavenHero
Sure. SetObjectPosition.
It's based on coordinates. How can I use it to target a town?
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
In reply to Dyrman
User Avatar
#935
Auto-translated
SetObjectPosition('hero', GetObjectPosition('town'))
and the hero ends up in the town's garrison if it is empty.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to RedHeavenHero
User Avatar
#936
Auto-translated
RedHeavenHero
SetObjectPosition('hero', GetObjectPosition('city'))
I tried it this way, but it doesn't work as needed. Is there another way?

Added 1 minute ago
RedHeavenHero

and the hero ends up in the garrison of the city if it's empty.
It is necessary to teleport through the gates of the enemy city, or into the city itself if it's your city, even from the gate's location.
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
In reply to Dyrman
User Avatar
#937
Auto-translated
Dyrman
So, I tried this method, but it doesn't work as expected. Is there another way?
And how does it work?

"City garrison"
"The city itself"
"Portal point"
Which of these is which?
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to RedHeavenHero
User Avatar
#938
Auto-translated
RedHeavenHero
How does it work?
It doesn't work. And the town should never be empty BEFORE the script runs (that's why it's not suitable).
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
In reply to Dyrman
User Avatar
#939
Auto-translated
Dyrman
You need to jump into the gates of the enemy city, or into the city itself, if it's your city, even from the gate point.
Then, create an array with the "gate points" at the beginning of the game.
gate_points = {}
function GetGatePoints()
for i, town in GetObjectNamesByType('TOWN') do
for j, hero in GetObjectNamesByType('HERO') do
if IsHeroInTown(hero, town, 1, 0) then
local x, y, z = GetObjectPosition(hero)
gate_points[town]={x, y, z}
end;
end;
end;
end;


Added 6 minutes later
Dyrman
No way. And the city should never be empty BEFORE the script runs (that's why it doesn't work).
You can remove the hero from that city using the same function.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
#940
Auto-translated
Here's an example of a specific case: 1) The enemy town is disabled, and the hero is also disabled. 2) Conflux, with the desired parameters set. 3) Enable the hero and the town. 4) Now, a battle needs to be initiated. (The "Make" function doesn't work because it clones the hero in the garrison, even though the hero might not enter the town after capturing it, but instead leave the map – this is a bug). Can the parameters be set before the event triggers? For example: During the conflux with the town, but before entering it? How can you enter the gates if someone is already inside the town?
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...

Statistics

Welcome our newest member: Emil