Well, the idea is that you wouldn't need to worry about remember which element a certain parameter is in the paramsarray. Example:
class Params
{
class Hour {
title = "Hour";
values[] = {0,2,4,6,8,10,12,14,16,18,20,22};
texts[] = {"0000","0200","0400","0600","0800","1000","1200","1400","1600","1800","2000","2200"};
default = 6;
};
class Rain {
title = "Rain";
values[] = {0,1,2,3};
texts[] = {"None","Light","Moderate","Heavy"};
default = 0;
};
class Fog {
title = "Fog";
values[] = {0,1,2,3};
texts[] = {"None","Light","Moderate","Heavy"};
default = 0;
};
class Viewdistance {
title = "Viewdistance";
values[] = {0,1,1000,1500,2000,2500,3000,3500,4000,5000,6000};
texts[] = {"Dynamic","User defined","1000", "1500", "2000", "2500", "3000","3500","4000","5000","6000"};
default = 0;
};
class Targets {
title = "Targets";
values[] = {4,6,8,10,0};
texts[] = {"4","6","8","10","Random 4-10"};
default = 6;
};
class AISkill {
title = "Difficulty: AI Skill";
values[] = {1,3,5,7};
texts[] = {"Easy","Normal","Moderate","Hard"};
default = 3;
};
class AIAmount {
title = "Difficulty: Amount of AI";
values[] = {1,2,3,4};
texts[] = {"Few","Normal","Moderate","Many"};
default = 2;
};
class AA {
title = "Difficulty: AA (ZU-23)";
values[] = {0,1,2,3};
texts[] = {"None","Few","Moderate","Many"};
default = 1;
};
class Planes {
title = "Planes available";
values[] = {0,1,2};
texts[] = {"F35B","AV-8B Harrier","Both"};
default = 2;
};
class ObjectiveDistance {
title = "Objective distance";
values[] = {0,1,2};
texts[] = {"Close","Medium","Any"};
default = 2;
};
};
Instead of having to edit the processParams.sqf for each mission, you would automatically get the vars created for each parameter (in this example elements 3-9) by going through all the class names in desc.ext.
skiptime (((paramsArray select 0) - daytime + 24) % 24);
switch (paramsArray select 1) do {
case 0: { 0 setOvercast 0; 0 setRain 0; };
case 1: { 0 setOvercast 0.8; 0 setRain 0.3; };
case 2: { 0 setOvercast 0.9; 0 setRain 0.6; };
case 3: { 0 setOvercast 1; 0 setRain 1; };
};
switch (paramsArray select 2) do {
case 0: { 0 setFog 0; };
case 1: { 0 setFog 0.3; };
case 2: { 0 setFog 0.6; };
case 3: { 0 setFog 1; };
};
SHK_PARAMS_ViewDistance = paramsArray select 3;
SHK_PARAMS_Targets = paramsArray select 4;
SHK_PARAMS_AISkill = paramsArray select 5;
SHK_PARAMS_AIAmount = paramsArray select 6;
SHK_PARAMS_AA = paramsArray select 7;
SHK_PARAMS_Planes = paramsArray select 8;
SHK_PARAMS_ObjectiveDistance = paramsArray select 9;
Called from init.sqf:
execvm "processParams.sqf" spawn {
waituntil {scriptdone _this};
if (isserver) then {
} else {
};
};