Skip to content

Current questions and answers regarding the map editor.

User Avatar
#713
Auto-translated
Ah, it’s easier to do it with a region. You create it right next to the garrison. Then you write a script like this:

EnableHeroAI('Duncan',false);
function garrison(hero)
if hero=='Giovanni' then
SetObjectOwner('Duncan',PLAYER_1);
end;
Trigger(REGION_ENTER_AND_STOP_TRIGGER, 'reg', nil);
end;
Trigger(REGION_ENTER_AND_STOP_TRIGGER, 'reg', 'garrison', nil);
Here, Giovanni is the script name of your hero, and Duncan is the hero who should join. I recommend naming the region 'reg' so you don't get confused later. The script has been tested and works (see screenshots).
Attachments 3
3 files attached • Total size: 413.6 KB
Карты для Heroes of Might and Magic V
Цикл "Закадычные враги": "Особенное гостеприимство, "Супероружие", "Меж молотом и наковальней"
"Падение Шантири"

Кампания для "Кодекса Войны"
"Выбор Сагиттеля"