Skip to content
User Avatar
#128
Auto-translated
Gilraen
Okay, out of the first batch, everything worked except for the AI attractor. They run wherever they want.
This was predictable. If possible, it should be replaced with MoveHero(hero,x,y);
Gilraen
And, before the battle starts, a message should pop up?
I would set a "town" region so that it needs to be crossed before attacking the town. Then:
function show_mes(hero)
if hero=="EnemyHero" then
MessageBox(GetMapDataPath().."mes.txt");
end;
end;
Trigger(REGION_ENTER_WITHOUT_STOP_TRIGGER,"town","show_mes");
Gilraen
I also need this: you approach a unit, a message pops up, the unit disappears from the map, and troops are added to your army. + collect groups of creatures from the map.
function Add(hero)
if hero=="YourHero" then
MessageBox(GetMapDataPath().."mes2.txt");
AddHeroCreatures("YourHero",CR_ID,QUANTITY);
k=k+1;
if k==n then --number of creatures to collect
SetObjectiveState("Obj",OBJECTIVE_COMPLETED);
end;
end;
end;
SetObjectEnabled("monster",nil);
Trigger(OBJECT_TOUCH_TRIGGER,"monster","Add");
Gilraen
Second: you defeat a monster and a message pops up.
You can simply write a script in the monster's properties, in the script tab. Write MessageBox there, and that's it.
Gilraen
Just so that it appears and is marked as completed after the trigger with the video in the previous part.
SetObjectiveState("PrimObj0",OBJECTIVE_COMPLETED);--completion
SetObjectiveState("PrimObj0",OBJECTIVE_ACTIVE);--appearance
Gilraen
kill an enemy hero
There is a standard task for that -- Defeat Hero.
 

К А
Стикеры GBF в Telegram

Statistics

Welcome our newest member: leyu