Missions won't complete

Missions won't complete

« posted: Mar 17, 2018, 07:04 PM »
I found some different missions that I wanted to add. However, the missions will run fine and when all AI are killed the crates/money will spawn like it should but the mission will not complete. It will still show on the map and won't finish after all AI are dead. Any input?

Code: [Select]

// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
// @file Name: mission_altisPatrol.sqf
// @file Author: JoSchaap, AgentRev, LouD

if (!isServer) exitwith {};
#include "patrolMissionDefines.sqf";

private ["_convoyVeh","_veh1","_veh2","_veh3","_veh4","_veh5","_createVehicle","_pos","_rad","_vehiclePosArray","_vPos1","_vPos2","_vPos3","_vehiclePos1","_vehiclePos2","_vehiclePos3","_vehiclePos4","_cash","_cashamount","_cashpile","_vehicles","_leader","_speedMode","_waypoint","_vehicleName","_numWaypoints","_box1","_box2","_randomBox1","_randomBox2"];

_setupVars =
{
_missionType = "Altis Patrol";
_locationsArray = nil;
};

_setupObjects =
{
_town = (call cityList) call BIS_fnc_selectRandom;
_missionPos = markerPos (_town select 0);

_convoyVeh = ["I_MRAP_03_hmg_F","I_MBT_03_cannon_F","O_APC_Tracked_02_AA_F","I_MBT_03_cannon_F","I_MRAP_03_gmg_F"];

_veh1 = _convoyVeh select 0;
_veh2 = _convoyVeh select 1;
_veh3 = _convoyVeh select 2;
_veh4 = _convoyVeh select 3;
_veh5 = _convoyVeh select 4;

_createVehicle = {
private ["_type","_position","_direction","_vehicle","_soldier"];

_type = _this select 0;
_position = _this select 1;
_direction = _this select 2;

_vehicle = createVehicle [_type, _position, [], 0, "None"];
_vehicle setVehicleReportRemoteTargets true;
_vehicle setVehicleReceiveRemoteTargets true;
_vehicle setVehicleRadar 1;
_vehicle confirmSensorTarget [west, true];
_vehicle confirmSensorTarget [east, true];
_vehicle confirmSensorTarget [resistance, true];
[_vehicle] call vehicleSetup;

_vehicle setDir _direction;
_aiGroup addVehicle _vehicle;

_soldier = [_aiGroup, _position] call createRandomSoldier;
_soldier moveInDriver _vehicle;
_soldier triggerDynamicSimulation true;
_soldier = [_aiGroup, _position] call createRandomSoldier;
_soldier moveInCommander _vehicle;
_soldier = [_aiGroup, _position] call createRandomSoldier;
_soldier moveInGunner _vehicle;

//_vehicle setVehicleLock "UNLOCKED";  // force vehicles to be unlocked
//_vehicle setVariable ["R3F_LOG_disabled", false, true]; // force vehicles to be unlocked
_vehicle setVariable ["R3F_LOG_disabled", true, true]; // force vehicles to be locked
[_vehicle, _aiGroup] spawn checkMissionVehicleLock; // force vehicles to be locked

_vehicle
};

_aiGroup = createGroup CIVILIAN;

//_pos = getMarkerPos (_town select 0);
_rad = _town select 1;
_vehiclePosArray = [_missionPos,_rad,_rad + 50,5,0,0,0] call findSafePos;
/*_vPos1 = _vehiclePosArray select 0;
_vPos2 = _vehiclePosArray select 1;
_vPos3 = _vehiclePosArray select 2;
_vehiclePos1 = [_vPos1 + 5, _vPos2 + 5, _vPos3];
_vehiclePos2 = [_vPos1 + 10, _vPos2 + 10, _vPos3];
_vehiclePos3 = [_vPos1 + 15, _vPos2 + 15, _vPos3];
 - _vehiclePos4 = [_vPos1 + 20, _vPos2 + 20, _vPos3];*/

_vehicles =
[
[_veh1, _vehiclePosArray, 0] call _createVehicle,
[_veh2, _vehiclePosArray, 0] call _createVehicle,
[_veh3, _vehiclePosArray, 0] call _createVehicle,
[_veh4, _vehiclePosArray, 0] call _createVehicle,
[_veh5, _vehiclePosArray, 0] call _createVehicle
];

_leader = effectiveCommander (_vehicles select 0);
_aiGroup selectLeader _leader;
_leader setRank "LIEUTENANT";

_aiGroup setCombatMode "GREEN"; // units will defend themselves
_aiGroup setBehaviour "SAFE"; // units feel safe until they spot an enemy or get into contact
_aiGroup setFormation "FILE";

_speedMode = if (missionDifficultyHard) then { "NORMAL" } else { "LIMITED" };
_aiGroup setSpeedMode _speedMode;

{
_waypoint = _aiGroup addWaypoint [markerPos (_x select 0), 0];
_waypoint setWaypointType "MOVE";
_waypoint setWaypointCompletionRadius 50;
_waypoint setWaypointCombatMode "GREEN";
_waypoint setWaypointBehaviour "SAFE"; // safe is the best behaviour to make AI follow roads, as soon as they spot an enemy or go into combat they WILL leave the road for cover though!
_waypoint setWaypointFormation "FILE";
_waypoint setWaypointSpeed _speedMode;
} forEach ((call cityList) call BIS_fnc_arrayShuffle);

_missionPos = getPosATL leader _aiGroup;

_missionPicture = getText (configFile >> "CfgVehicles" >> _veh2 >> "picture");
_vehicleName = getText (configFile >> "CfgVehicles" >> _veh2 >> "displayName");
_vehicleName2 = getText (configFile >> "CfgVehicles" >> _veh3 >> "displayName");
_vehicleName3 = getText (configFile >> "CfgVehicles" >> _veh4 >> "displayName");

_missionHintText = format ["A military patrol with a <t color='%4'>%1</t>, a <t color='%4'>%2</t> and a <t color='%4'>%3</t> are patrolling the island.Take them out!", _vehicleName, _vehicleName2, _vehicleName3, patrolMissionColor];

_numWaypoints = count waypoints _aiGroup;
};

_waitUntilMarkerPos = {getPosATL _leader};
_waitUntilExec = nil;
_waitUntilCondition = {currentWaypoint _aiGroup >= _numWaypoints};

_failedExec = nil;

// _vehicles are automatically deleted or unlocked in missionProcessor depending on the outcome
_drop_item =
{
private["_item", "_pos"];
_item = _this select 0;
_pos = _this select 1;

if (isNil "_item" || {typeName _item != typeName [] || {count(_item) != 2}}) exitWith {};
if (isNil "_pos" || {typeName _pos != typeName [] || {count(_pos) != 3}}) exitWith {};

private["_id", "_class"];
_id = _item select 0;
_class = _item select 1;

private["_obj"];
_obj = createVehicle [_class, _pos, [], 5, "None"];
_obj setPos ([_pos, [[2 + random 3,0,0], random 360] call BIS_fnc_rotateVector2D] call BIS_fnc_vectorAdd);
_obj setVariable ["mf_item_id", _id, true];
};

_successExec =
{
// Mission completed

//Money Drops
_cashamount = floor(random 15000);
_cashpile = selectRandom [2,3,4];

for "_i" from 1 to _cashpile do
{
_cash = createVehicle ["Land_Money_F",[(_lastPos select 0), (_lastPos select 1) - 5,0],[], 0, "NONE"];
_cash setPos ([_lastPos, [[2 + random 3,0,0], random 360] call BIS_fnc_rotateVector2D] call BIS_fnc_vectorAdd);
_cash setDir random 360;
_cash setVariable ["cmoney", _cashamount, true];
_cash setVariable ["owner", "world", true];
};

//Crates
_randomBox1 = selectRandom ["mission_USLaunchers","mission_Main_A3snipers","mission_Uniform","mission_DLCLMGs","mission_ApexRifles"];
_randomBox2 = selectRandom ["mission_USSpecial","mission_HVSniper","mission_DLCRifles","mission_HVLaunchers"];

_box1 = createVehicle ["Box_NATO_Wps_F", _lastPos, [], 2, "None"];
_box1 setVariable ["moveable", true, true];
_box1 setDir random 360;
[_box1, _randomBox1] call fn_refillbox;

_box2 = createVehicle ["Box_NATO_Wps_F", _lastPos, [], 2, "None"];
_box2 setVariable ["moveable", true, true];
_box2 setDir random 360;
[_box2, _randomBox2] call fn_refillbox;

_successHintMessage = "The Patrol has been taken out! Go get the crates!";
};

_this call patrolMissionsProcessor;
  • Offline ShineDwarf
  • First Blood
  • ***
  • Posts: 79
  • Co-Owner, Fractured Gaming

Re: Missions won't complete

« Reply #1 posted: Mar 17, 2018, 09:49 PM »
Do you have a patrol mission prosessor setup? As well as the patrol mission defines?

As theyre seperate from side, main, money missions. They need their own processor and defines to work. Or to be changed over to one of the original selections

Re: Missions won't complete

« Reply #2 posted: Mar 17, 2018, 10:51 PM »
Yes I do. I have them set right in the mission file as well. It will run/load up fine. But once all AI are killed it drops the crates but it won't complete.

Code: [Select]
#include "patrolMissionDefines.sqf";
Code: [Select]
patrolMissionColor];
Code: [Select]
_this call patrolMissionsProcessor;

Re: Missions won't complete

« Reply #3 posted: Mar 18, 2018, 12:04 AM »
check you server logs for errors. It looks like something in your _successexec is causing the mission to error out and crash the mission processor. Is the loot in the crates correct? Or are they empty? Or are they default loot for that crate?

Re: Missions won't complete

« Reply #4 posted: Mar 18, 2018, 01:29 AM »
check you server logs for errors. It looks like something in your _successexec is causing the mission to error out and crash the mission processor. Is the loot in the crates correct? Or are they empty? Or are they default loot for that crate?

The logs show no errors for them. They just never complete and eventually will Fail. The crates do have the correct stuff in them. I think your deff right about it being within the _successexec . It maybe something with how I have the crates like maybe their being read as part of the mission but since they can't be destroyed the mission never completes? If that makes any sense.

Re: Missions won't complete

« Reply #5 posted: Mar 18, 2018, 05:40 AM »
have you done anything to your missionprocessor.sqf?

Re: Missions won't complete

« Reply #6 posted: Mar 18, 2018, 03:03 PM »
Nope, I have not changed/added anything into missionprocessor.sqf.

Re: Missions won't complete

« Reply #7 posted: Mar 18, 2018, 04:33 PM »
masterController.sqf
Code: [Select]
// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
// @file Name: masterController.sqf
// @file Author: AgentRev

_ctrlTypes =
[
"mainMission",
"moneyMission",
"sideMission",
"HostileAirMissions",
"aquaticMissions",
//"patrolMissions",
"extraMissions"
];

_ctrlQuantity = (["A3W_missionsQuantity", 6] call getPublicVar) max 0 min 6;
// WARNING: Pushing the value higher than 6 is not recommended unless you add more mission types (especially money missions) and convoy routes.
// Currently, all missions on the map must be of a different types, so if you have 3 money missions controllers, one of them is going to stay
// idle, because there are only 2 money missions to choose from. Same with convoy paths, if you have 3 active convoys and a 4th one is started,
// it will not be able to find a free route and will stall.

// It is possible to change it so you can have multiple missions of the same type running along, the line to change is commented in missionController.sqf

if (count _ctrlTypes < _ctrlQuantity) then
{
_ctrlTypes deleteRange [_ctrlQuantity, count _ctrlTypes];
};

// Permanent controllers
{
// Compile mission processors
missionNamespace setVariable [format ["%1Processor", _x], (format ["server\missions\%1Processor.sqf", _x]) call mf_compile];

// Start controller
[] execVM format ["server\missions\%1Controller.sqf", _x];
uiSleep 5;
} forEach _ctrlTypes;

_nbTypes = count _ctrlTypes;

// Extra controllers
if (_ctrlQuantity > _nbTypes) then
{
_extraControllers = [];
_extraQuantity = _ctrlQuantity - _nbTypes;
_extraNumber = 2;
_iType = 0;

for "_i" from 1 to ((ceil (_extraQuantity / _nbTypes)) * _nbTypes) do
{
_extraControllers pushBack [_ctrlTypes select _iType, _extraNumber, false];

_iType = _iType + 1;
if (_iType >= _nbTypes) then
{
_iType = 0;
_extraNumber = _extraNumber + 1;
};
};

_extraNumber = 2;

// Spawn extra controllers
for "_i" from 1 to _extraQuantity do
{
[_extraControllers, _extraNumber, _extraControllers select (_i - 1)] spawn
{
_extraControllers = _this select 0;
_extraNumber = _this select 1;
_current = _this select 2;

while {true} do
{
while {isNil "_current"} do
{
_availables = [_extraControllers, {_x select 1 == _extraNumber && !(_x select 2)}] call BIS_fnc_conditionalSelect;

if (count _availables > 0) then
{
_current = _availables call BIS_fnc_selectRandom;

if !(_current select 2) then
{
_current set [2, true];
}
else
{
_current = nil;
sleep 0.5;
};
}
else
{
sleep 5;
};
};

//diag_log format ["_extraControllers = %1", _extraControllers];
//diag_log format ["_extraNumber = %1", _extraNumber];
//diag_log format ["_current = %1", _current];

[_extraNumber, true] call compile preProcessFileLineNumbers format ["server\missions\%1Controller.sqf", _current select 0];

_current set [2, false];
_current = nil;
uiSleep 5;
};
};

if (_i % _nbTypes == 0) then
{
_extraNumber = _extraNumber + 1;
};

uiSleep 5;
};
};


setupMissionArrays.sqf
Code: [Select]
// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
// @file Name: setupMissionArrays.sqf
// @file Author: AgentRev

if (!isServer) exitWith {};

MainMissions =
[
// Mission filename, weight
["mission_APC", 0.5],
["mission_MBT", 0.5],
["mission_Occupation", 0.5],
["mission_LightArmVeh", 0.5],
["mission_ArmedHeli", 0.5],
["mission_CivHeli", 0.5]
];

SideMissions =
[
["mission_MiniConvoy", 0.5],
["mission_TownInvasion", 0.5],
["mission_Outpost", 0.5],
["mission_Truck", 0.5],
["mission_Sniper", 0.5],
["mission_WepCache", 0.5],
["mission_geoCache", 0.5]
];

MoneyMissions =
[
["mission_MoneyShipment", 0.5],
["mission_drugsRunners", 0.5],
["mission_Roadblock", 0.5]

];

/*PatrolMissions =
[
["mission_altispatrol", 0.5]
["mission_artyPatrol", 0.5]
];*/

extraMissions =
[
["mission_Convoy", 0.5],
    ["mission_MiniConvoy", 0.5]
];

HostileAirMissions =
[
//["mission_HostileHelicopter", 0.5],
//["mission_HostileVTOL", 0.5],
["mission_skysmuggler", 0.5]
//["mission_HostileJet", 0.5]
];

aquaticMissions =
[
["mission_SunkenTreasure", 0.5],
["mission_SunkenSupplies", 0.5],
["mission_ArmedDiversquad", 0.5],
["mission_Coastal_Convoy", 0.5]
];

MissionSpawnMarkers = (allMapMarkers select {["Mission_", _x] call fn_startsWith}) apply {[_x, false]};
//ForestMissionMarkers = (allMapMarkers select {["ForestMission_", _x] call fn_startsWith}) apply {[_x, false]};
SunkenMissionMarkers = (allMapMarkers select {["SunkenMission_", _x] call fn_startsWith}) apply {[_x, false]};
RoadblockMissionMarkers = (allMapMarkers select {["Roadblock_", _x] call fn_startsWith}) apply {[_x, false]};
SniperMissionMarkers = (allMapMarkers select {["Sniper_", _x] call fn_startsWith}) apply {[_x, false]};
OccupationMissionMarkers = (allMapMarkers select {["Occupation_", _x] call fn_startsWith}) apply {[_x, false]};

/*if !(ForestMissionMarkers isEqualTo []) then
{
SideMissions append
[
["mission_AirWreck", 3],
["mission_WepCache", 3]
];
};*/

LandConvoyPaths = (call compile preprocessFileLineNumbers "mapConfig\convoys\landConvoysList.sqf") apply {[_x, false]};
CoastalConvoyPaths = (call compile preprocessFileLineNumbers "mapConfig\convoys\coastalConvoysList.sqf") apply {[_x, false]};
//PatrolConvoyPaths = (call compile preprocessFileLineNumbers "mapConfig\convoys\patrolConvoysList.sqf") apply {[_x, false]};
artyConvoyPaths = (call compile preprocessFileLineNumbers "mapConfig\convoys\artyConvoysList.sqf") apply {[_x, false]};


MainMissions = [MainMissions, [["A3W_heliPatrolMissions", ["mission_Coastal_Convoy", "mission_HostileHeliFormation"]], ["A3W_underWaterMissions", ["mission_ArmedDiversquad"]]]] call removeDisabledMissions;
SideMissions = [SideMissions, [["A3W_heliPatrolMissions", ["mission_HostileHelicopter"]], ["A3W_underWaterMissions", ["mission_SunkenSupplies"]]]] call removeDisabledMissions;
MoneyMissions = [MoneyMissions, [["A3W_underWaterMissions", ["mission_SunkenTreasure"]]]] call removeDisabledMissions;

{ _x set [2, false] } forEach MainMissions;
{ _x set [2, false] } forEach SideMissions;
{ _x set [2, false] } forEach MoneyMissions;
{ _x set [2, false] } forEach HostileAirMissions;
{ _x set [2, false] } forEach aquaticMissions;
//{ _x set [2, false] } forEach PatrolMissions;
{ _x set [2, false] } forEach extraMissions;

missionProcessor.sqf
Code: [Select]
// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
// @file Name: missionProcessor.sqf
// @file Author: AgentRev

if (!isServer) exitwith {};

#define MISSION_LOCATION_COOLDOWN (10*60)
#define MISSION_TIMER_EXTENSION (15*60)

private ["_controllerSuffix", "_missionTimeout", "_availableLocations", "_missionLocation", "_leader", "_marker", "_failed", "_complete", "_startTime", "_oldAiCount", "_leaderTemp", "_newAiCount", "_adjustTime", "_lastPos", "_floorHeight"];

// Variables that can be defined in the mission script :
private ["_missionType", "_locationsArray", "_aiGroup", "_missionPos", "_missionPicture", "_missionHintText", "_successHintMessage", "_failedHintMessage"];

_controllerSuffix = param [0, "", [""]];
_aiGroup = grpNull;

if (!isNil "_setupVars") then { call _setupVars };

diag_log format ["WASTELAND SERVER - %1 Mission%2 started: %3", MISSION_PROC_TYPE_NAME, _controllerSuffix, _missionType];

_missionTimeout = MISSION_PROC_TIMEOUT;

if (!isNil "_locationsArray") then
{
while {true} do
{
_availableLocations = [_locationsArray, { !(_x select 1) && diag_tickTime - (_x param [2, -1e11]) >= MISSION_LOCATION_COOLDOWN}] call BIS_fnc_conditionalSelect;

if (count _availableLocations > 0) exitWith {};
uiSleep 60;
};

_missionLocation = (_availableLocations call BIS_fnc_selectRandom) select 0;
[_locationsArray, _missionLocation, true] call setLocationState;
[_locationsArray, _missionLocation, markerPos _missionLocation] call cleanLocationObjects; // doesn't matter if _missionLocation is not a marker, the function will know
};

if (!isNil "_setupObjects") then { call _setupObjects };

_leader = leader _aiGroup;
_marker = [_missionType, _missionPos] call createMissionMarker;
_aiGroup setVariable ["A3W_missionMarkerName", _marker, true];

if (isNil "_missionPicture") then { _missionPicture = "" };

[
format ["%1 Objective", MISSION_PROC_TYPE_NAME],
_missionType,
_missionPicture,
_missionHintText,
MISSION_PROC_COLOR_DEFINE
]
call missionHint;

diag_log format ["WASTELAND SERVER - %1 Mission%2 waiting to be finished: %3", MISSION_PROC_TYPE_NAME, _controllerSuffix, _missionType];

_failed = false;
_complete = false;
_startTime = diag_tickTime;
_oldAiCount = 0;

if (isNil "_ignoreAiDeaths") then { _ignoreAiDeaths = false };

waitUntil
{
uiSleep 1;

_leaderTemp = leader _aiGroup;

// Force immediate leader change if current one is dead
if (!alive _leaderTemp) then
{
{
if (alive _x) exitWith
{
_aiGroup selectLeader _x;
_leaderTemp = _x;
};
} forEach units _aiGroup;
};

_newAiCount = count units _aiGroup;

if (_newAiCount < _oldAiCount) then
{
// some units were killed, mission expiry will be reset to 15 mins if it's currently lower than that
_adjustTime = if (_missionTimeout < MISSION_TIMER_EXTENSION) then { MISSION_TIMER_EXTENSION - _missionTimeout } else { 0 };
_startTime = _startTime max (diag_tickTime - ((MISSION_TIMER_EXTENSION - _adjustTime) max 0));
};

_oldAiCount = _newAiCount;

if (!isNull _leaderTemp) then { _leader = _leaderTemp }; // Update current leader

if (!isNil "_waitUntilMarkerPos") then { _marker setMarkerPos (call _waitUntilMarkerPos) };
if (!isNil "_waitUntilExec") then { call _waitUntilExec };

_failed = ((!isNil "_waitUntilCondition" && {call _waitUntilCondition}) || diag_tickTime - _startTime >= _missionTimeout);

if (!isNil "_waitUntilSuccessCondition" && {call _waitUntilSuccessCondition}) then
{
_failed = false;
_complete = true;
};

(_failed || _complete || (!_ignoreAiDeaths && {alive _x} count units _aiGroup == 0))
};

if (_failed) then
{
// Mission failed

{ moveOut _x; deleteVehicle _x } forEach units _aiGroup;

if (!isNil "_failedExec") then { call _failedExec };

if (!isNil "_vehicle" && {typeName _vehicle == "OBJECT"}) then
{
deleteVehicle _vehicle;
};

if (!isNil "_vehicles" && {typeName _vehicles == "ARRAY"}) then
{
{
if (!isNil "_x" && {typeName _x == "OBJECT"}) then
{
deleteVehicle _x;
};
} forEach _vehicles;
};

[
"Objective Failed",
_missionType,
_missionPicture,
if (!isNil "_failedHintMessage") then { _failedHintMessage } else { "Better luck next time!" },
failMissionColor
]
call missionHint;

diag_log format ["WASTELAND SERVER - %1 Mission%2 failed: %3", MISSION_PROC_TYPE_NAME, _controllerSuffix, _missionType];
}
else
{
// Mission completed

if (isNull _leader) then
{
_lastPos = markerPos _marker;
}
else
{
_lastPos = _leader call fn_getPos3D;
_floorHeight = (getPos _leader) select 2;
_lastPos set [2, (_lastPos select 2) - _floorHeight];
};

if (!isNil "_successExec") then { call _successExec };

if (!isNil "_vehicle" && {typeName _vehicle == "OBJECT"}) then
{
_vehicle setVariable ["R3F_LOG_disabled", false, true];
_vehicle setVariable ["A3W_missionVehicle", true, true];
_vehicle setVariable ["A3W_lockpickDisabled", nil, true];

if (!isNil "fn_manualVehicleSave" && !(_vehicle getVariable ["A3W_skipAutoSave", false])) then
{
_vehicle call fn_manualVehicleSave;
};
};

private _convoyAutoSave = ["A3W_missionVehicleSaving"] call isConfigOn;

if (!isNil "_vehicles" && {typeName _vehicles == "ARRAY"}) then
{
{
if (!isNil "_x" && {typeName _x == "OBJECT"}) then
{
if (!_convoyAutoSave) then
{
_x setVariable ["A3W_skipAutoSave", true, true];
};

_x setVariable ["R3F_LOG_disabled", false, true];
_x setVariable ["A3W_missionVehicle", true, true];
_x setVariable ["A3W_lockpickDisabled", nil, true];

if (!isNil "fn_manualVehicleSave" && !(_x getVariable ["A3W_skipAutoSave", false])) then
{
_x call fn_manualVehicleSave;
};
};
} forEach _vehicles;
};

[
"Objective Complete",
_missionType,
_missionPicture,
_successHintMessage,
successMissionColor
]
call missionHint;

diag_log format ["WASTELAND SERVER - %1 Mission%2 complete: %3", MISSION_PROC_TYPE_NAME, _controllerSuffix, _missionType];
};

deleteGroup _aiGroup;
deleteMarker _marker;

if (!isNil "_locationsArray") then
{
[_locationsArray, _missionLocation, false] call setLocationState;
};

missionController.sqf
Code: [Select]
// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
// @file Name: missionController.sqf
// @file Author: AgentRev

if (!isServer) exitWith {};

private ["_controllerNum", "_tempController", "_controllerSuffix", "_missionsFolder", "_missionDelay", "_availableMissions", "_missionsList", "_nextMission"];

_controllerNum = param [0, 1, [0]];
_tempController = param [1, false, [false]];
_controllerSuffix = "";

if (_controllerNum > 1) then
{
_controllerSuffix = format [" %1", _controllerNum];
};

diag_log format ["WASTELAND SERVER - Started %1 Mission%2 Controller", MISSION_CTRL_TYPE_NAME, _controllerSuffix];

_missionsFolder = MISSION_CTRL_FOLDER;
[MISSION_CTRL_PVAR_LIST, MISSION_CTRL_FOLDER] call attemptCompileMissions;

_missionDelay = MISSION_CTRL_DELAY;

while {true} do
{
_nextMission = nil;

while {isNil "_nextMission"} do
{
_availableMissions = [MISSION_CTRL_PVAR_LIST, { !(_x select 2) }] call BIS_fnc_conditionalSelect;
// _availableMissions = MISSION_CTRL_PVAR_LIST; // If you want to allow multiple missions of the same type running along, uncomment this line and comment the one above

if (count _availableMissions > 0) then
{
_missionsList = _availableMissions call generateMissionWeights;
_nextMission = _missionsList call fn_selectRandomWeighted;
}
else
{
uiSleep 60;
};
};

[MISSION_CTRL_PVAR_LIST, _nextMission, true] call setMissionState;

diag_log format ["WASTELAND SERVER - %1 Mission%2 waiting to run: %3", MISSION_CTRL_TYPE_NAME, _controllerSuffix, _nextMission];

[
format
[
"<t color='%1' shadow='2' size='1.75'>%2 Objective%3</t><br/>" +
"<t color='%1'>------------------------------</t><br/>" +
"<t color='%4' size='1.0'>Starting in %5 minutes</t>",
MISSION_CTRL_COLOR_DEFINE,
MISSION_CTRL_TYPE_NAME,
_controllerSuffix,
subTextColor,
_missionDelay / 60
]
] call hintBroadcast;

uiSleep _missionDelay;

// these should be defined in the mission script
private ["_setupVars", "_setupObjects", "_waitUntilMarkerPos", "_waitUntilExec", "_waitUntilCondition", "_waitUntilSuccessCondition", "_ignoreAiDeaths", "_failedExec", "_successExec"];

[_controllerSuffix] call compile preprocessFileLineNumbers format ["server\missions\%1\%2.sqf", MISSION_CTRL_FOLDER, _nextMission];

[MISSION_CTRL_PVAR_LIST, _nextMission, false] call setMissionState;

if (_tempController) exitWith {};
uiSleep 5;
};


I am aware of some of the things commented out. Those are mostly for testing I'm doing or the mission itself is no working. Such as the PatrolMissions, which do not complete. Several missions I have will not coplete.

All Patrol Missions, Wep_Cache, Mini_Convoy in extra missions, Sky Smuggler, GeoCache and maybe 1 or 2 more i can't remember off the top of my head.

Re: Missions won't complete

« Reply #8 posted: Mar 18, 2018, 09:04 PM »
Okay, question did you start from a clean version of A3W? or did you start from someone's mission file?

Re: Missions won't complete

« Reply #9 posted: Mar 18, 2018, 09:53 PM »
Started from a clean version of the latest 1.4b. I know another guy on Steam that has a Wasteland and we try to help each other when we can. But he doesn't speak or understand English so it makes it tough trying to discuss problems with him. He had some other missions that I wanted to use in mine. He had he's crates configured a little differently from what I saw, something like A3W_SuperBox or some weird off ball stuff. So I just set them up like I have my other missions on here. So yes, I did use a fresh mission and added things to it myself. I have a few missions that seem to just have problems working with my server. They run fine on his but again, he has his configured differently then I do. So I'm assuming somewhere I'm missing something in trying to adapt them to my server.

Re: Missions won't complete

« Reply #10 posted: Mar 19, 2018, 10:52 AM »
I don't see anything obviously wrong with the files. if you're really not getting anything in the server log, you'll probably have make your own log entries at various points in the mission, and missionprocessor to see where things are going wrong.


  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2488

Re: Missions won't complete

« Reply #11 posted: Mar 19, 2018, 05:09 PM »
I agree with Monkey, I don't see anything wrong either. It's stalling somewhere between call _successExec and call missionHint.

Re: Missions won't complete

« Reply #12 posted: Mar 19, 2018, 08:09 PM »
Thank you guys for the input!

EDIT:

So I was wrong about all them working now. I have some of the other ones that weren't working fixed but I am still stuck on these Patrol Missions that I am trying to add. I will keep looking into it and hopefully figure out and I'll update what it was. Thanks again.