Skip to content

Current questions and answers regarding the map editor.

User Avatar
#5517
Auto-translated
Alinksolo
function CreatureShouldSurvive(hero, id)
  while 1 do
  sleep(10);
    if GetHeroCreatures(hero, id)==0 then
      SetObjectiveState("zadanie4", OBJECTIVE_FAILED)
      sleep(10);
      Loose();
      break
    end;
  end;
end;

function StartScene()
StartDialogScene('/MyScene/StartScene/DialogScene1/DialogScene.xdb#xpointer(/DialogScene)')
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "reg12", nil);
for i=1,4 do
  SetObjectiveState("zadanie"..i, OBJECTIVE_ACTIVE) 
end
startThread(CreatureShouldSurvive, 'Mardigo', CREATURE_CLERIC)
AddHeroCreatures("Mardigo", 1, 40);
AddHeroCreatures("Mardigo", 5, 10);
AddHeroCreatures("Mardigo", 10, 1);
for i=500,508 do 
  RemoveObject(i)
end
end

Trigger(REGION_ENTER_AND_STOP_TRIGGER, "reg12", "StartScene");
Here
The error seems to be in the startThread function. It should only require the function name.