Skip to content
#898
Auto-translated
Heroist

What about linking a battle script to a hero? The thing is, I would like to be able to hire such a hero, say, in a tavern, but in this case, he appears on the map without the linked script and loses his functions.
Is there a function that, if such a hero appears on the map, automatically links the battle script to him? Or is there another way?
SetHeroCombatScript(heroname, script)
is not the best option. The script will only work if the hero is under AI control, and it will also be reset if the hero is lost.

I already described it in the neighboring topic:
it is done by adding a few lines of script to the 'combat-common.lua' file - this file is launched by the game when any battle starts.
If needed, I can explain it in more detail. But as always, the best option is to study other people's maps that use battle scripts.

Statistics

Welcome our newest member: leyu