Skip to content

Current questions and answers regarding the map editor.

User Avatar
#5113
Auto-translated
[/U]
Ment
Instead of isBlocked, use true.
{0TT@6bI4
In the second-to-last script function.
Thank you, I will try it.

Added after 50 minutes
{0TT@6bI4

1. Simply immobilize the computer's heroes in the Castle using the EnableHeroAI function and prevent them from hiring other heroes using the EnableAIHeroHiring function. Attach a trigger to touching the Castle, and within the function called by this trigger, include EnableHeroAI(nHeroName, true); and then disable the trigger. This workaround is necessary because I am not sure if an inactive computer hero can participate in defending against a Castle siege. Whether or not the computer will use spells depends on Elrath, not scripts. But you can download the mega AI mod.
Regardless, the hero fights (without the above), and also uses spells.
You can read about and download the mega AI mod here (/topic/7746/).

Added after 4 minutes
{0TT@6bI4
function NewDayCheck()
...
end;

Trigger(NEW_DAY_TRIGGER, "NewDayCheck");
Do I need to fill out the body of the function at all? And another question:
Is Trigger(NEW_DAY_TRIGGER) used only once in the script's body? I already have this trigger created, and I simply copied the line SetPlayerResource(1,6,0); into it.

Added after 7 minutes
{0TT@6bI4

4. I haven't seen a function that returns the race of a Castle. For now, I don't have any ideas.
What if we use workarounds?
1) We change the Castle settings in properties town -> the preferred city is specified as the nearest player's city. The Castle has no garrison.
2) Using a script, the Castle is captured by Player 3 and they sit there doing nothing; how can this be implemented?