Mission

Mission

« posted: Mar 20, 2019, 07:22 PM »
Mission reward pays out and crates appear but the mission does not end leaving the mission marker on map. Hence the next mission does not spawn.

I can eliminate this mission but it is such a good mission, it would be a shame to take it out.

Any ideas, Thanks

Re: Mission

« Reply #1 posted: Mar 23, 2019, 05:51 PM »
We're going to need you to post the mission code.

Re: Mission

« Reply #2 posted: Mar 23, 2019, 08:12 PM »
We're going to need you to post the mission code.


Here is the mission.
I have added the name to the setupMissionArray.sqf
I have added the createsquadAssault.sqf to factoryMethods and set it to compile in serverCompile.sqf
Changed the relevant processor, defines etc. in the mission file itself

The mission runs and gives the money and crate but it does not end, and the mission marker remains on the map.

// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2019 A3Wasteland.com *
// ******************************************************************************************
//   @file Name: mission_SquadAssault.sqf
//   @file Author: [509th] Coyote Rogue
//   @file Created: 20/02/2019 21:27

#define GHOSTHOTEL ["Land_GH_MainBuilding_left_F", "Land_GH_MainBuilding_middle_F","Land_GH_MainBuilding_right_F"]
#define HOSPITAL ["Land_Hospital_main_F", "Land_Hospital_side1_F", "Land_Hospital_side2_F"]
#define OFFICES ["Land_Offices_01_V1_F"]
#define AIRPORT ["Land_Airport_left_F", "Land_Airport_center_F", "Land_Airport_right_F"]      
#define BARRACKS ["Land_i_Barracks_V2_F", "Land_u_Barracks_V2_F", "Land_i_Barracks_V1_F"]



if (!isServer) exitwith {};



#include "specialMissionDefines.sqf";

private ["_aiGroup", "_buildings", "_buildingnames", "_center", "_reward", "_nbUnit","_nbUnits", "_moneyAmount", "_boxes1", "_boxes2", "_box1", "_box2", "_moneyText", "_missionPos", "_missionType", "_cash"];

_setupVars = {

   _missionType = "Squad Assault";
   _buildingnames = selectRandom [GHOSTHOTEL, HOSPITAL, OFFICES, AIRPORT, BARRACKS];

   //Find the center of the world, find the first occurence of the first building in the named set
   _center =  getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition");
   _missionPos = getPos ((nearestObjects [_center, [(_buildingnames select 0)], 25000]) select 0);
   
   _moneyAmount = 500000; //Reward amount for completing mission   

};

_setupObjects = {

   //Find local buildings
   _buildings = nearestObjects [_missionPos, _buildingnames, 100];

   //Create AI Group
   _nbUnit = 10;
   _aiGroup = createGroup CIVILIAN;
   _aiGroup setCombatMode "RED";
   _aiGroup setBehaviour "COMBAT";

   //Keep a count of how many were spawned
   private _count = 0;
   private _units = 0;

   //Determine the number of position in each building, and randomize them
   _nbUnits = _nbUnit + round(random ((_nbUnit)*0.5));
   [_aiGroup, _missionPos, _nbUnits, 5] call createsquadAssault;   

   // move them into buildings
   [_aiGroup, _missionPos, 25, true, true] call moveIntoBuildings;
   
   [_aiGroup, _missionPos] call defendArea;

   _missionPicture = "media\soldier.paa";   
   _missionHintText = format ["An elite special forces squad is staged in a building preparing for a raid.<br/>Conduct a counter assault before they can deploy!", specialMissionColor];
};

_waitUntilMarkerPos = nil;
_waitUntilExec = nil;
_waitUntilCondition = nil;

_failedExec =
{
   // Mission failed

   
   //{ deleteVehicle _x } forEach [_barGate, _obj1, _obj2];
   
};
_successExec =
{
   // Mission completed
   


   //Money
      
      for "_i" from 1 to 10 do
      {
         _cash = createVehicle ["Land_Money_F", _lastPos, [], 5, "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", _moneyAmount / 10, true];
         _cash setVariable ["owner", "world", true];
      };

      //Crates
               
      _boxes1 = selectRandom ["Box_NATO_Wps_F","Box_East_Wps_F","Box_IND_Wps_F", "Box_IND_Ammo_F","Box_IND_AmmoOrd_F","Box_IND_Grenades_F","Box_IND_Support_F","Box_IND_WpsLaunch_F","Box_IND_WpsSpecial_F"];
      _box1 = createVehicle [_boxes1, _lastPos, [], 5, "NONE"];
      _box1 setDir random 360;
      _box1 call randomCrateLoadOut; // Randomly fills box with equipment
      _box1 allowDamage false;

      //Crate Behavior   
      
      { _x setVariable ["R3F_LOG_disabled", false, true] } forEach [_box1]; //Allows crates to be picked up and carried
   
      _successHintMessage = format ["Well executed C.Q.B. The spoils are yours to take!"];
      
};

_this call specialMissionProcessor;

Re: Mission

« Reply #3 posted: Mar 24, 2019, 04:31 PM »
Do you get the success message?

If not you may be crashing at
Code: [Select]
_successHintMessage = format ["Well executed C.Q.B. The spoils are yours to take!"];
I think Format expects at least 2 arguments, a string and a variable to convert into the string. try changing it to
Code: [Select]
_successHintMessage = "Well executed C.Q.B. The spoils are yours to take!";

Re: Mission

« Reply #4 posted: Mar 24, 2019, 05:02 PM »
Thanks, I will give that a go.

Re: Mission

« Reply #5 posted: Mar 24, 2019, 08:40 PM »
Also check your logs. There is probably something there.

Re: Mission

« Reply #6 posted: Mar 25, 2019, 10:42 AM »
Made the changes but it is still hanging. Will there be logs as I am testing it on my own PC. If not I will push it up onto the server and look into the logs. cheers

Re: Mission

« Reply #7 posted: Mar 26, 2019, 04:38 AM »
I don't know what your setup is on you home computer, but if you have wasteland running it should produce logs.

I wouldn't put it on a live server, but you can easily set up a dev server on the same machine you run you live on.