Connection ErrorBad RequestThis page went staleSession ExpiredSign in requiredForbiddenNot FoundToo Many RequestsServer ErrorBad GatewayService UnavailableGateway TimeoutHTTP Version Not Supported
Session Expired
Your session has expired. Please log in to continue.
Sign in required
You need an account to do that. Sign in or create one — it only takes a minute.
This page went stale
Your security token was rejected, usually because the page sat open too long or you signed in elsewhere. Nothing was saved. Reload the page and try again.
Request Failed
We encountered an issue while processing your request.
Please check your internet connection and try again.
As an alternative, you can write the following in the Barracks_build_ok function:
```
function Barracks_build_ok()
MessageBox("/Maps/SingleMissions/Time of Troubles1/Barracks_building1.txt");
SetObjectiveState("zadanie1", OBJECTIVE_ACTIVE,1);
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "QuestSword", nil)
startThread( _Barracks_build_mob_monitor);
end
```
And here is the _Barracks_build_mob_monitor function itself:
```
function _Barracks_build_mob_monitor ()
while 1 do
sleep(2);
if not Exists("Neutral") then
Trigger(REGION_ENTER_AND_STOP_TRIGGER, "QuestSword", "Barracks_build_2");
break
end;
end;
end;
```
It checks in a separate thread whether the 'Neutral' unit exists (Exists("Neutral")). If it is defeated at some point, the trigger for the region changes to "Barracks_build_2" - a function with dialogue #2.
The completion of the quest depends on its type (kind). If it is OBJECTIVE_KIND_MANUAL, it can be completed with the following line:
```
SetObjectiveState('zadanie1', OBJECTIVE_COMPLETED);
```
Place it under the condition if not Exists("Neutral") then, before the trigger.
If it is not OBJECTIVE_KIND_MANUAL, but is set to destroy a unit, it should complete automatically.
I haven't encountered any issues with unlocking buildings, but SetTownBuildingLimitLevel will likely help in this case.