Hello, I'm struggling with a script that prevents me from completing a mission.
Here's the snippet:
function Complete_obj_start()
while 1 do
sleep( 10 );
if (GetObjectOwner("E1") == PLAYER_1) then
SetObjectiveState('obj2',OBJECTIVE_COMPLETED);
startThread( Objective );
sleep( 5 );
break;
end;
end;
end;
function Objective()
if GetObjectiveState("obj4") == OBJECTIVE_COMPLETED then
MessageBox("/Maps/SingleMissions/SecretIsle/MasengDruid.txt");
SetRegionBlocked( "blockregion", false, PLAYER_1 );
end;
end;
In a similar case (on Nival maps), it works, but in my case, it doesn't react at all. What's wrong with it?
Well, here's the situation: the first function, as I understand it, is simply copied from some map... Inside the function, there's a request to check the ownership of the object "E1"... Did you add this object? I doubt it, to be honest...
The second function checks the state of the task "obj4"; if it's completed, then it's okay. Is this task present on your map? Then, the function unlocks a separate region... Is it marked on your map? In general, try writing your own script instead of copying it from the standard ones... In my opinion, if you think it through, you'll come up with something even better than what the developers did... :smile42: