Added 7 minutes later
Unfortunately, it didn't help. I tried creating a new camera in the same position/slightly shifted, both now and yesterday, but the result is the same. Maybe I should delete all the cameras and create them again?
New here? I'm Roha — want a quick tour?
Another question arose. Is it possible to create a hero so that he can be used on other maps? Simply put, a shared hero is only visible on the map where he was created.
function CreatureShouldSurvive(hero, id)
while 1 do
if GetHeroCreatures(hero, id) < 1 then
SetObjectiveState("zadanie4", OBJECTIVE_FAILED)
sleep(20)
Loose()
end
sleep(1)
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) --All quests are strictly numbered from 1 to 4, so we iterate through them in a loop
end
startThread(CreatureShouldSurvive, 'Mardigo', CREATURE_CLERIC)
AddHeroCreatures("Mardigo", 1, 40);
AddHeroCreatures("Mardigo", 5, 10);
AddHeroCreatures("Mardigo", 10, 1);
for i=500,508 do --Since all objects to be removed have a strict numbering from 500 to 508, I iterate through them in a loop
RemoveObject(i)
end
end
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "reg12", "StartScene");
Everything worked well, but when the dialogue ends, the other player's turn begins, and the mission fails.
Try replacing the function that checks for clerics in the hero's army with this one:
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;P.s. This is the skeleton of the function that checks for the presence of a dragon with Ilia in Lords of the Realm.
And as another option: move AddHeroCreatures("Mardigo", 10, 1); above startThread, i.e.:
AddHeroCreatures("Mardigo", 10, 1);
startThread(CreatureShouldSurvive, 'Mardigo', CREATURE_CLERIC)
AddHeroCreatures("Mardigo", 1, 40);
AddHeroCreatures("Mardigo", 5, 10);