Skip to content
User Avatar
#3007
Auto-translated
A million-dollar question! The scripts aren't working. Can you tell me where the error is? The console isn't showing any errors.
First: if player 2 captures the elf city, you should lose, but the game continues.
function CheckAnpossal()
if GetObjectOwner ('houseElf') == 2 then
sleep(10)
SetObjectiveState('q4', OBJECTIVE_FAILED, 1);
sleep(10)
Loose()
end
end

startThread (CheckAnpossal)

Second: during the game, it checks if a unit in the hero's army has died. If the hero doesn't have it, you lose. This works. But after a certain point in the plot, this unit should be removed from the army, and the game should continue. It doesn't continue – you lose. The console doesn't seem to be showing any errors either.

Tracking the unit in the hero's army (works):
function lostDragon() ---- Checking for the loss of the dragon
while 1 do
sleep ( 10 );
if GetHeroCreatures("Ohtarig", 83) == 0 and dragon == 1 then
if SetRegionBlocked('CheckAstrid', false) then
SetObjectiveState("q5", OBJECTIVE_FAILED, 1);
sleep ( 10 );
Loose();
break
end;
end;
end;
end
startThread (lostDragon)

Key plot point (doesn't work as intended):
function PokaAstrida()
SetRegionBlocked ('CheckAstrid', false, 1)
dragon = 0
RemoveHeroCreatures('Ohtarig', 83, 1)
StartDialogScene("/Maps/SingleMissions/ChoiseOTW1/Test/DialogScene.xdb#xpointer(/DialogScene)")
sleep(5)
StartCombat('Ohtarig', nil, 1, 41, 1, nil, nil, nil, nil)
sleep(5)
MessageBox("/Maps/SingleMissions/ChoiseOTW1/MagiPoka.txt");
sleep(5)
SetObjectiveState("q5", OBJECTIVE_FAILED);
Trigger(REGION_ENTER_AND_STOP_TRIGGER , "Corrupted", nil);
sleep(5)
RemoveObject('lich1')
RemoveObject('lich2')
RemoveObject('lich3')
end

Trigger(REGION_ENTER_AND_STOP_TRIGGER , "Corrupted", 'PokaAstrida');

Please tell me where I might have gone wrong
Автор карт:
Долина расхитителей
Выбор мира

Statistics

Welcome our newest member: wayal