Skip to content
#254
Auto-translated
Winner
A question arose. Is there a trigger that activates if a player has no towns and heroes, meaning the player has lost? And there's a problem. When the 'obj1' task is completed, the mission immediately ends with the player winning. What could be causing this?
It's not exactly a trigger, but you can do it this way:
function lost_PL4()
if GetPlayerState(PLAYER_4)~=1 then
.....................
end;
end;
and we attach a trigger to the 'lost_PL4' function when the player loses a hero
Trigger (PLAYER_REMOVE_HERO_TRIGGER,PLAYER_4,'lost_PL4');

either the 'Ignore' parameter in 'obj1' is set to 'false', or your task is recorded not in 'objectives', but in 'scenario informations'.