Auto-translated
How do I set a hero limit for a computer-controlled opponent, so that it can't recruit more than 3 heroes? Thanks in advance for the answer!
New here? I'm Roha — want a quick tour?
How can I set a hero limit for the AI, so that it can't hire more than 3 heroes? Thanks in advance for the answer!
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.
Will there be any? There are not many good maps right now, and you could fix that.
Let's see) For now, I'm working on a dynamic multiplayer map where the action will take place in a very large city. Until recently, I was preparing a spin-off map for Unicorn Empire, but unfortunately, due to technical issues, I lost most of my personal data, including everything related to games. Therefore, for now, I'm doing a little bit of everything: building a map, restoring mods, and re-populating the Lua file to bring back convenient and interesting functions. That's it... If anything comes out of me, you'll definitely know)