Skip to content

How do I set a hero limit for the AI?

User Avatar
#4
Auto-translated
Azgalor
Overall, it doesn't work. Because even if you implement a ban after hiring 3 heroes, one will still remain in the tavern, and the bot will hire him anyway. On the other hand, if you need to ban all heroes except certain ones, you can use AllowPlayerTavernRace(player, race, 0/1 (ban/allow)) 8 times for each race, and then use AllowPlayerTavernHero(player, script name of the hero, 0/1 (ban/allow)) to allow the bot to hire specific heroes. For example, I used this method to create a player who could only hire Andreas and Lorenzo (as in the last mission in the campaign for Freya). To ensure that the heroes are always with the player, you can link them using MakeHeroReturnToTavernAfterDeath(script name of the hero, 0/1 (ban/allow)). It is unlikely that you will be able to force ordinary random heroes into a hero restriction (and campaign heroes in general), because you will hardly be able to create a script that will remove the least useful heroes, for example, those hired only after the ban is activated. Although, I might be wrong about this.
Where can I find your maps? I really want to play them.
На дальней станции сойду...
Трава по пояс,
Зайду в траву, как в море босиком...

Statistics

Welcome our newest member: dylanyamaha