Skip to content

Current questions and answers regarding the map editor.

User Avatar
#5108
Auto-translated
Good evening. Could you please help me? I've been struggling with this... I created a multiplayer map for 2 players, and there are additional castles for these 2 players (at least, they were of the same Faction... until I put heroes in to guard them, and I had to add a third player as a computer opponent.
I would like this third player (the computer) to:
1) Stay and guard the castles inside and use spells!
2) Not leave the castles.
3) Not buy an army.
4) Have the castles be of the same Faction as the ones assigned to players 1 and 2.
5) The AI shouldn't waste time on its turn.
6) And not buy heroes.
I recorded everything I could find in mapscript at the beginning and checked them (using print for each)... and the last 2 turned out to be completely non-functional...
* EnableHeroAI("Freyda", nil); works
* SetHeroLootable('Freyda', nil); works
* EnableAIHeroHiring(3, 'Castle1', nil); works, although it raises doubts since there were no errors
* BlockTownGarrisonForAI( 'Castle1', isBlocked ); - gives an error: value was NIL when getting global with name 'isBlocked'
* DoNotGiveTurnToPlayerAIIfNoTownsandactiveheroes (3, true); - gives an error: value was NIL when getting global with name 'DoNotGiveTurnToPlayerAIIfNoTownsandactiveheroes'
7) So that when the map starts, everything is blocked for the third player (slot, race, hero, starting bonus).
8) I also want to mention that heroes from the scenario were chosen to guard the castles (I had to work hard to get them into the garrison). Does this affect anything?