Auto-translated
After this line:
Trigger(OBJECT_CAPTURE_TRIGGER, "gorodSvyat", nil)
Does it work?
It doesn't work.
New here? I'm Roha — want a quick tour?
After this line:
Trigger(OBJECT_CAPTURE_TRIGGER, "gorodSvyat", nil)
Does it work?
It doesn't work.
Does the console display any error?
None, everything is clean. But through trial and error, I found out that the faulty function was 3. I didn't write the trigger correctly there. Seems like everything is okay now.
Here are the conditions that set the coefficients:
```
function QochComplete ()
while (1) do
sleep(2);
if (Exists('white') == nil) then
SetObjectiveState("Qo-ch", OBJECTIVE_COMPLETED);
w = 1
break
end
end
end
startThread(QochComplete)
function QobComplete ()
while (1) do
sleep (2)
if (Exists('black') == nil) then
SetObjectiveState("Qo-b", OBJECTIVE_COMPLETED);
b = 1
break
end
end
end
startThread(QobComplete)
function Turma () while (1) do if b == 0 and w == 0 then MessageBox("/Maps/SingleMissions/rework (4)/turmaLOCK.txt"); end if b == 1 and w == 1 and var == 1 then MessageBox("/Maps/SingleMissions/rework (4)/turmaUNLOCK.txt"); SetObjectiveState("suppDruid", OBJECTIVE_COMPLETE); RemoveObject("druid"); RemoveObject("elf1"); RemoveObject("elf2"); RemoveObject("elf3"); RemoveObject("elf4"); RemoveObject("elf5"); RemoveObject("elf6"); RemoveObject("elf7"); RemoveObject("elf8"); MessageBox("/Maps/SingleMissions/rework (4)/unicorn.txt"); OpenCircleFog(198, 64, 0, 2, PLAYER_1) MoveCamera(198, 64, 0, 30, 1.3, 1, 1, 1, 1); sleep(5) PlayObjectAnimation("unicorn", "happy", ONESHOT_STILL); sleep(15) RemoveObject("unicorn"); end if b == 1 and w == 1 and a == 1 then MessageBox("/Maps/SingleMissions/rework (4)/turmaDEAD.txt") end Trigger(OBJECT_TOUCH_TRIGGER, "turma"); break end end; Trigger(OBJECT_TOUCH_TRIGGER, "turma", "Turma" );
The question is about complexity. There is an object called "Turma". When touched, a specific message should appear, depending on the conditions specified in the script. My problem is that when touched for the first time, everything is okay (the first condition, when b and w == 0), but when b == 1, w == 1, var == 1, it gives an error. Also, when b == 1, w == 1, a == 1.
Here is the error
The conditions that set the coefficients:function QochComplete () while (1) do sleep(2); if (Exists('white') == nil) then SetObjectiveState("Qo-ch", OBJECTIVE_COMPLETED); w = 1 break end end end startThread(QochComplete) function QobComplete () while (1) do sleep (2) if (Exists('black') == nil) then SetObjectiveState("Qo-b", OBJECTIVE_COMPLETED); b = 1 break end end end startThread(QobComplete)
GetHeroName - this function caused an error in the combat script, so the error should be looked for in the combat script.
Regarding the script itself: it's unclear why there's a loop; the trigger is written incorrectly - it's missing a function name or is nil.

Hmm. Which player has him in reserve? The game can sometimes lag due to the number of heroes reserved by a single player.
if GetDate(DAY) == DayErlingAttack and ErlingAttack == 1 then
DeployReserveHero(Erling,RegionToPoint("Erling_deploy"))
sleep(5)
local x, y = 15, 9
if CanMoveHero(Erling,x,y,0) then
MoveHero(Erling, x, y,0)
elseif CanMoveHero(Erling,121,22) then
MoveHero(Erling, 121, 22,0)
end
startThread(ErlingUpgrade)
end
end
First, you should disable the AI for the hero. Second, it's better to create a separate function that will check if the turn of the desired player has arrived and then start moving the hero, because the trigger for a new day is not quite suitable for this.
function ErlingMove()
local x, y = 15, 9
if CanMoveHero(Erling, x, y, 0) then
MoveHero(Erling, x, y, 0)
end
end
function ErlingMove()
while 1 do
if(GetCurrentPlayer() == 'player number to which Erling belongs') then
if CanMoveHero(Erling, 15 , 9, 0) then
MoveHero(Erling, 15, 9, 0)
elseif CanMoveHero(Erling, 121, 22, 0) then
MoveHero(Erling, 121, 22,0)
end
end
sleep(2)
end
end
hinders progress = is the required cell inaccessible? Then it's logical that it doesn't move, right?
try something like this:function ErlingMove()
while 1 do
if(GetCurrentPlayer() == 'player number to which Erling belongs') then
if CanMoveHero(Erling, 15 , 9, 0) then
MoveHero(Erling, 15, 9, 0)
elseif CanMoveHero(Erling, 121, 22, 0) then
MoveHero(Erling, 121, 22,0)
end
end
sleep(2)
end
end