Skip to content

Posts from Scripts

4.8 (8 ratings)
In reply to AlekseyS
User Avatar
7 years ago
Auto-translated
In the SummonCreature combat script, does the number of creatures have to be an integer?
In reply to LetoX
User Avatar
7 years ago
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.
7 years ago
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
7 years ago
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
7 years ago
Auto-translated
Another question: how do I make the random function work in battle? The console keeps giving me an error.
User Avatar
7 years ago
Auto-translated
No way. It hasn't been implemented.
In reply to AstralLein
7 years ago
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
7 years ago
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.
In reply to RedHeavenHero
7 years ago
Auto-translated
RedHeavenHero
You can write your own simple generator, for example, one that works using this method.

I'll give it a try.
7 years ago
Auto-translated
Is Frida's (Vessel of Elrath) specialization a combat script? If so, what does it look like?
In reply to AlekseyS
User Avatar
7 years ago
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.
In reply to RedHeavenHero
7 years ago
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
7 years ago
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
7 years ago
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
7 years ago
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: recijeb