Skip to content

Posts from Scripts

4.8 (8 ratings)
In reply to AlekseyS
User Avatar
#2890
Auto-translated
In the SummonCreature combat script, does the number of creatures have to be an integer?
In reply to LetoX
User Avatar
#2891
Auto-translated
LetoX
In the SummonCreature combat script, does the number of creatures have to be an integer?
Not necessarily. You can specify a non-integer number – the function will automatically discard the fractional part.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
#2892
Auto-translated
Is it possible to make it so that during battle, machines (tent and ballista) restore their health during their turn? And my second question: how can I force an enemy hero to stay in defense during their turn? Thank you in advance.
Карты: Экспедиция ГрувераНаследие ШантириВременной парадоксПоиски рунной сферыПуть возвращения
In reply to AlekseyS
User Avatar
#2893
Auto-translated
AlekseyS
Is there a way to make machines (tent and ballista) restore their health during their turn in battle?
And my second question: how can I force an enemy hero to stay in defense during their turn?
Thank you in advance.
1) Perhaps summoning an Elder Gremlin to repair them.
2) The function controlling the AI hero's turn should return 1. For example:
function DefenderHeroMove()
return 1
end
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to AstralLein
#2896
Auto-translated
AstralLein
No way. It's not implemented.

Is there no alternative? I just need the enemy hero to cast either a general speed boost or a general speed reduction on their turn.
Карты: Экспедиция ГрувераНаследие ШантириВременной парадоксПоиски рунной сферыПуть возвращения
In reply to AlekseyS
User Avatar
#2897
Auto-translated
AlekseyS
Is there absolutely no alternative? I just need the enemy hero to cast either a general speed boost or a general speed reduction on their turn.
You could write your own simple generator, for example, one that works using this method.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to AlekseyS
User Avatar
#2900
Auto-translated
AlekseyS
Is Frida's (Vessel of Elrath) specialization a combat script? If so, what does it look like?
No, it's not a script. The developers did not implement general game mechanics through scripts.
Карты для Героев Меча и Магии 5
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога

Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4
In reply to RedHeavenHero
#2901
Auto-translated
RedHeavenHero
No, it's not a script. The developers didn't implement global game mechanics through scripts.

I see... Thanks for the answer.
Карты: Экспедиция ГрувераНаследие ШантириВременной парадоксПоиски рунной сферыПуть возвращения
User Avatar
#2902
Auto-translated
In the Warlock campaign in the Hammers of Fate expansion, in one of the missions, the main hero travels with a dragon that cannot be lost (losing it means losing the mission). So, he ends up with a bunch of dragons and doesn't lose them, but that's not what I'm talking about. I added this function to track the dragon, but my situation is slightly different - at one point in the story, the main hero must lose this unit. So, the question is: is it possible to make the loss of this unit a condition for losing the mission, but at one specific moment, when this unit dies as part of the story, the game doesn't end?
Автор карт:
Долина расхитителей
Выбор мира
User Avatar
#2903
Auto-translated
dragon_death_must_finish_game = 1; ... if (dragon_death_must_finish_game == 1) then -- check for dragon loss end ... if (the moment when the dragon can be lost has arrived) then dragon_death_must_finish_game = 0; end
РПГ-сценарий для HoMM5: Путь героя
ЧаВо по созданию карт для HoMM5: ЧаВо
#2904
Auto-translated
Help me!
As soon as I create a script (a simple one, for an attack animation), the map editor crashes.

Statistics

Welcome our newest member: Emil