Skip to content

Posts from Scripts

4.8 (8 ratings)
In reply to Dyrman
User Avatar
#941
Auto-translated
Completely confused. Who? What? And most importantly – whose?
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
#942
Auto-translated
There are four options at the entrance to the city. The easiest way, perhaps, is to launch 4 startThread processes; one of them will work, and the other three will return an error.
 

К А
Стикеры GBF в Telegram
In reply to RedHeavenHero
User Avatar
#943
Auto-translated
RedHeavenHero
Completely confused. Who? What? And most importantly - whose?

Is this cloning?
When creating a map, the hero is displayed in the city screen at the gates, even if you move away from the city on the map. Every time you try to move, the city screen opens, where the hero icon is at the gates on the screen, even though he is moving on the map.
There is also another problem: if the sleep timer is set too low, and the CPU load is high, then the game freezes permanently. If you set a high sleep timer, it becomes uncomfortable to play.

Added after 1 hour
When entering a city, reduce the mana of the hero who is in the city, whether it's an enemy (before the battle) or your own hero.
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
In reply to Dyrman
User Avatar
#944
Auto-translated
Dyrman
When applying a change, the hero is displayed in the city screen at the gates, even if you move away from the city on the map. Each time you try to take a turn, the city screen opens, and the hero's icon is displayed at the gates on the screen, even though he is moving on the map.
If I understand correctly, the following will work:
MoveHeroRealTime('hero', GetObjectPosition('city'))
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to RedHeavenHero
User Avatar
#945
Auto-translated
RedHeavenHero
If I understand correctly, then this should work:
MoveHeroRealTime('hero', GetObjectPosition('city'))
Nope, I've tried it. I'll have to give up on that. There's also a sad situation with delays. Most likely, the game already thinks the hero is in the city, so it doesn't recognize some functions. You could try moving the hero out of the city and back in, but then the visuals will be awkward.
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
In reply to Dyrman
User Avatar
#946
Auto-translated
It really doesn't work, but only if it's your own town. It works on enemy towns.

In 3.1, you can somehow fix the visual aspect... But in general, what's the point of such complexity?
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
#947
Auto-translated
How can you check during a battle whether a unit can shoot, i.e., whether it's a ranged unit? `CommandShot` naturally throws an error if you try to make a peasant shoot...

Whatever
In reply to RedHeavenHero
User Avatar
#948
Auto-translated
RedHeavenHero
It really doesn't work, but only if it's your own city. It works on enemy cities.

In 3.1, you can somehow fix the visual aspect... But in general, what's the point of such complexity?
Implementation of Tessa's special ability in NHF. So that it affects both your own and enemy heroes in cities, or when you are in a city, and an enemy enters, etc...
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
In reply to Heroist
User Avatar
#949
Auto-translated
Heroist
How can you check if a unit can shoot during a battle? (Is it a ranged unit?). CommandShot naturally throws an error if you try to make a peasant shoot...
a) Put the IDs of all ranged units into an array and check as needed whether the unit that needs to shoot is a ranged unit.
b) Forget about it and put it in a separate thread.

Added 6 minutes later
Dyrman
Implementation of Tessa's special ability in NHF. So that it affects both friendly and enemy heroes in cities, or when the hero is in the city, or when someone is entering the city, etc...
Another global trigger. There don't seem to be any other ways for a hero to interact with a city besides MakeHeroInteractWithObject and MoveHeroRealTime...:(
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to RedHeavenHero
User Avatar
#950
Auto-translated
RedHeavenHero

Another global trigger. There don't seem to be any other ways for a hero to interact with a town besides MakeHeroInteractWithObject and MoveHeroRealTime...:(
We'll test it for now. If necessary, all the global triggers from the main version of the mod can be moved out. By the way, two delays of 0.1 work faster and better than one of 1; even a delay of 0.5 doesn't have time to trigger. :)
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
In reply to Dyrman
User Avatar
#951
Auto-translated
Dyrman
By the way, two delays of 0.1 are faster and work better than one delay of 1, because even a delay of 0.5 doesn't have time to take effect.
sleep doesn't seem to accept numbers less than 1. And it doesn't accept any fractional numbers at all.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
#952
Auto-translated
"a) Put the IDs of all archers into an array and check as needed whether the creature that is supposed to shoot is an archer." So, that's why Feadan's ability only works with elves. Apparently, we weren't the only ones who were too lazy to enter all the archer IDs in the game.

Whatever
In reply to RedHeavenHero
User Avatar
#953
Auto-translated
RedHeavenHero
sleep doesn't seem to accept numbers less than 1.
I don't know, but I'm just saying what I observed. The difference between delays of 0.5 and 1 is noticeable. If sleep(0.1) doesn't mean any delay at all, then two such sleeps during processing might create a natural delay. The console definitely doesn't report any errors for these values.
Моды для HeroesV:
NHF 0.90 : NHF - группа в VK

Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...
In reply to Heroist
User Avatar
#954
Auto-translated
Heroist
So, that's why Faydan's ability only works with elves. Apparently, we weren't the only ones too lazy to fill in all the archer IDs in the game.
The developers didn't assign a single specialist to scripts; otherwise, Faydan's ability wouldn't fail in multiplayer. ;)
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
User Avatar
#955
Auto-translated
Who can help me figure this out? Here's a snippet of the battle function: ... if GetHeroName(hero) == 'Laszlo' and hh == 0 then if GetCreatureType(x1[0]) > 2 and GetCreatureType(x1[0]) < 5 then CommandShot(x1[0], x11[0], nil) else end ... The console displays an error: "value was nil when getting global with CommandShot." I don't understand why it's not working. The manual clearly states that GetCreatureType determines the creature's ID. Can anyone help?

Whatever

Statistics

Welcome our newest member: Фёдор Фёдорович