A3W_missionsQuantity

A3W_missionsQuantity

« posted: Jan 02, 2017, 06:56 PM »
Short Question can i also set the    A3W_missionsQuantity = 6;          // Number of missions running at the same time (0 to 6)   to an higher Value than 6 ?   So maybee 8 or 9 ?
  • Offline Matt76
  • Mercenary
  • *****
  • Posts: 418
  • co founder of customcombatgaming.com

Re: A3W_missionsQuantity

« Reply #1 posted: Jan 02, 2017, 08:20 PM »
you can but i would advise against it unless you have added a hell of a lot more missions in or you are just playing with a few mates as it would kill server performance when busy.

Re: A3W_missionsQuantity

« Reply #2 posted: Jan 07, 2017, 01:58 PM »
Does anyone have any idea? Instead of money, side and main missions, we have 10 different categories.
We did not change the missions quantity, but there appears as many missions as categories exist - actually 10.

Do we have to edit sth else somewhere?

Re: A3W_missionsQuantity

« Reply #3 posted: Jan 09, 2017, 01:35 PM »
this will depend on how you added the additional mission categories in your code.

from what it sounds like there are 10 mission controllers started at the same time for your code - so with the default code this is not intended and you will have to rewrite/tweak the mission control structures under server\missions\

Re: A3W_missionsQuantity

« Reply #4 posted: Jan 09, 2017, 03:35 PM »
Thx 4 answer - although I didn't get it finally.  :-\

This is for example our 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 {};


WaterMissions =
[
// Mission filename, weight
["mission_ArmedDiversquad", 1],
["mission_SunkenTreasure", 1],
["mission_Coastal_Jetski", 1],
["mission_SunkenSupplies", 1],
["mission_Coastal_Convoy", 1],
["mission_Pirates", 1]

];

BaseMissions =
[
// Mission filename, weight
["mission_Banditpost"],
["mission_Outpost", 1],
["mission_BaseHeli", 1],
["mission_BaseConvoy", 1],
["mission_TrenchHuron", 1]


];


TransportMissions =
[
// Mission filename, weight
["mission_Convoy", 1],
["mission_HellDrugs", 1],
["mission_MiniConvoy", 1],
["mission_WalterWhite", 1],
["mission_IS", 1]


];


OccupationMissions =
[
// Mission filename, weight
["mission_Roadblock", 1],
["mission_Industryannexation", 1],
["mission_Conqueror", 1],
["mission_Gasstation", 1],
["mission_Airpost", 1],
["mission_CommunicationInterruption", 1],
["mission_Harborinvasion", 1]


];


AirMissions =
[
// Mission filename, weight
["mission_GhostSwarm", 1],
["mission_TanoaPatrol", 1],
["mission_HostileJetFormation", 1],
["mission_HostileHeliFormation", 0.5],
["mission_HostileHelicopter", 0.5],
["mission_HostileJet", 1],
["mission_PawneeSquadron", 1],
["mission_BlackfootTwins", 1],
["mission_DeadSky", 1],
["mission_JetFormation", 1]


];

SpecialMissions =
[
// Mission filename, weight
["mission_Roulette", 1],
["mission_falsecops", 1],
["mission_Falcon", 1],
["mission_StomperSOS", 1],
["mission_HostageRescue", 1],
["mission_TombRaider", 1],
["mission_UAV", 1],
["mission_Explosives", 1],
["mission_Gravedigger", 1],
["mission_Train", 1]


];

TownMissions =
[
// Mission filename, weight
["mission_TownInvasion", 1],
["mission_TownInvasion2", 1],
["mission_TownInvasion3", 1],
["mission_TownInvasion4", 1],
["mission_Riot", 1],
["mission_SuicideSquad", 1]


];

MainMissions =
[
// Mission filename, weight
["mission_APC", 1],
["mission_MBT", 1],
["mission_HeavyMetal", 1],
["mission_LightArmVeh", 1],
["mission_ArmedHeli", 1],
["mission_CivHeli", 1],
["mission_Payday", 1]

];

SideMissions =
[
// Mission filename, weight
["mission_AirWreck", 1],
["mission_drugsRunners", 1],
["mission_geoCache", 1],
["mission_Sniper", 1],
["mission_WepCache", 1],
["mission_Smugglers", 1],
["mission_Truck", 1]

];

MoneyMissions =
[
// Mission filename, weight
["mission_MoneyShipment", 1],
["mission_altisPatrol", 1],
//["mission_altisPatrol2", 1],
["mission_TroopsRelocation", 1],
["mission_TheHeist", 1]
];

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]};
GasstationMissionMarkers = (allMapMarkers select {["Gasstation_", _x] call fn_startsWith}) apply {[_x, false]};
AirpostMissionMarkers = (allMapMarkers select {["Airpost_", _x] call fn_startsWith}) apply {[_x, false]};
IndustryMissionMarkers = (allMapMarkers select {["Industry_", _x] call fn_startsWith}) apply {[_x, false]};
ConquerorMissionMarkers = (allMapMarkers select {["Conqueror_", _x] call fn_startsWith}) apply {[_x, false]};
RiotMissionMarkers = (allMapMarkers select {["Riot_", _x] call fn_startsWith}) apply {[_x, false]};
CommMissionMarkers = (allMapMarkers select {["Comm_", _x] call fn_startsWith}) apply {[_x, false]};
TrainMissionMarkers = (allMapMarkers select {["Train_", _x] call fn_startsWith}) apply {[_x, false]};
HarborMissionMarkers = (allMapMarkers select {["Harbor_", _x] call fn_startsWith}) apply {[_x, false]};
TheHeistMissionMarkers = (allMapMarkers select {["TheHeist_", _x] call fn_startsWith}) apply {[_x, false]};





if !(ForestMissionMarkers isEqualTo []) then
{
SideMissions append
[
["mission_AirWreck", 1.5],
["mission_WepCache", 1.5],
["mission_Sniper", 1]
];
};

LandConvoyPaths = (call compile preprocessFileLineNumbers "mapConfig\convoys\landConvoysList.sqf") apply {[_x, false]};
CoastalConvoyPaths = (call compile preprocessFileLineNumbers "mapConfig\convoys\coastalConvoysList.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;
AirMissions = [AirMissions, [["A3W_heliPatrolMissions", ["mission_SunkenTreasure", "mission_GhostSwarm","mission_TanoaPatrol", "mission_HostileJetFormation", "mission_HostileHeliFormation", "mission_HostileHelicopter", "mission_HostileJet", "mission_PawneeSquadron"]]]] 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 TownMissions;
{ _x set [2, false] } forEach SpecialMissions;
{ _x set [2, false] } forEach AirMissions;
{ _x set [2, false] } forEach OccupationMissions;
{ _x set [2, false] } forEach TransportMissions;
{ _x set [2, false] } forEach BaseMissions;
{ _x set [2, false] } forEach WaterMissions;

And this the mastercontroler.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",
"townMission",
"specialMission",
"airMission",
"occupationMission",
"transportMission",
"baseMission",
"waterMission"
];

_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;
};
};

At the missionController ..

Code: [Select]
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;
};
};

Would it be any effect, if i change as said from

Quote
_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

to

Quote
//_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

On the correct way?

Re: A3W_missionsQuantity

« Reply #5 posted: Jan 09, 2017, 05:02 PM »
if i read it correctly you have 10 mission types which spawn a permanent controller.

Code: [Select]
// 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;

so the limits in the code underneath never kick in. You would have to rewrite the structure . or revert the mission types to a lower number.

Re: A3W_missionsQuantity

« Reply #6 posted: Jan 09, 2017, 06:19 PM »
Hm. Ok. Thx m8.  8)