Skip to content

Commit

Permalink
add more mission validation checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Seb105 authored Apr 29, 2021
1 parent a466df9 commit 662ed8e
Showing 1 changed file with 83 additions and 1 deletion.
84 changes: 83 additions & 1 deletion addons/validate_mission/fn_run.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,85 @@ private _check_cba_settings = {
["Changed CBA settings", true, [], _strings];
};

private _check_playable_units = {
private _msg = [];
private _pass = true;
if (count playableUnits < 35) then {
_msg pushBack "Not enough playable units: 35 required";
_pass = false;
};
if ((group player get3DENAttribute "a3aa_ee_persistent_callsign" select 0) isEqualTo "") then {
_msg append [
"Possible AI unit marked as player.",
"Did you place some AI before any playable units?"
];
_pass = false;
};

["Playable unit checks", _pass, [], _msg]
};

private _check_default_modules = {
private _msg = [];
private _pass = true;
private _emptyModules = [];
if ((all3DENEntities#7) apply {(_x get3DENAttribute "name")#0} find "CNTO" isEqualTo -1) then {
_msg append [
"Default CNTO modules not detected.",
"Place down the default CNTO Co-op or PvP modules."
];
_pass = false;

} else {

private _briefingModules = all3DENEntities#3 select {typeOf _x isEqualTo "a3aa_ee_briefing"};
if (count _briefingModules > 0) then {

{
private _module = _x;
private _moduleIndex = _forEachIndex + 1;
{
private _fieldText = (_module get3DENAttribute _x)#0;
if (count _fieldText < 5) then {
_msg pushBack format ["Field '%1' of the OPORD briefing module %2 is incomplete.", _x select [17], _moduleIndex];
_pass = false;
_emptyModules pushBackUnique _module;
}
} forEach ["a3aa_ee_briefing_situation", "a3aa_ee_briefing_mission", "a3aa_ee_briefing_execution", "a3aa_ee_briefing_admin_logistics"];
} forEach _briefingModules;

} else {
_msg append [
"No OPORD briefing modules found",
"The default CNTO modules seem to have been placed, yet no briefing module has been found.",
"Delete the whole CNTO Module set and re-place it."
];
_pass = false;
}

};

["CNTO module checks", _pass, _emptyModules, _msg];
};

private _check_binarization = {
private _msg = [];
if ("Scenario" get3DENMissionAttribute "SaveBinarized") then {
_msg = [
"Your mission file is binarized",
"This makes debugging and mission corruption harder to solve",
"It also makes the job of reviewing your mission harder.",
"To fix this, go to 'Attributes -> General -> Misc'",
"And uncheck the 'Binarize the Scenario file' checkbox",
"",
"You can also disable binarization by default:",
"Settings -> Preferences -> Saving -> Binarize New Scenario Files"
];
["Binarized scenario file", false, [], _msg];
} else {
["Binarized scenario file", true, [], _msg];
}
};

[
[] call _check_game_type,
Expand All @@ -164,5 +243,8 @@ private _check_cba_settings = {
[] call _check_respawn_marker_proximity,
[] call _check_respawn_marker_count,
[] call _check_mission_info,
[] call _check_cba_settings
[] call _check_cba_settings,
[] call _check_playable_units,
[] call _check_default_modules,
[] call _check_binarization
];

0 comments on commit 662ed8e

Please sign in to comment.