Skip to content

Current questions and answers regarding the map editor.

User Avatar
#5338
Auto-translated
dragon = 1

function lostDragon() ---- Checks if the dragon is lost
	while 1 do
		sleep ( 10 );
		if GetHeroCreatures("Ohtarig", 83) == 0 and dragon == 1 then
			SetObjectiveState("q5", OBJECTIVE_FAILED);
			sleep ( 10 );
			Loose();
			break
		elseif GetHeroCreatures("Ohtarig", 83) == 0 and dragon == 0 then
		   SetObjectiveState("q5", OBJECTIVE_FAILED);
     end;
	end;
end;

startThread (lostDragon)

--first video and boss fight--
function PokaAstrida()
         dragon = 0
         RemoveHeroCreatures('Ohtarig', 83, 1)
         print('Zdes byl multik')
         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);
end

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

It still doesn't work. There are no errors in the console. The game simply ends in defeat.

UPD: An interesting feature - during a normal playthrough, EVERYTHING IS FINE, but when I test it - I give myself max. level, upgrade the first units - the game ends in defeat without errors. I'm going gray soon.
UPD: It turns out that the dragon's position in the army slots matters... That's crazy. By the way, now at least the battle starts, and after the victory, I lose... The console says - an error, that the message is empty. I noticed that all my messages on the map, which are inside the map in .txt format, suddenly... became empty for the game. But in the map itself, they are there and with text, but the game says that they are empty. I created them using the script editor. It has the correct encoding right away, right..?
Автор карт:
Долина расхитителей
Выбор мира