Company RTO Setup Script
Code: Select all
/*! @file examples\mission_setupCompanySignals.sqf
*
* \brief Sample of setting up RTO's for a company signals setup.
*
* Called by: [this, "platoon_rto"] call compile "mission_setupCompanySignals.sqf";
*
* This setup assumes that each RTO has a single PRC-152 and a single PRC-117F.
* Each platoon command and the company commander has not been configured in this config, but canFire
* easily be added to the switch statement below.
*
* The order of operations is documented in the script below.
*
*/
private["_unit", "_localUnitType", "_localRadioList"];
_unit = _this select 0;
_localUnitType = _this select 1;
if(player != _unit) exitWith { false };
// First we copy the presets. This is not required, but for this example a seperate preset called example1 is being
// used just for this example.
//
// !! Keep in mind, each radio has its own set of presets. So when we operate on a radios preset, they can have the
// same names but they are different presets due to the fact its a different radio.
["ACRE_PRC148", "default", "example1"] call acre_api_fnc_copyPreset;
["ACRE_PRC152", "default", "example1"] call acre_api_fnc_copyPreset;
["ACRE_PRC117F", "default", "example1"] call acre_api_fnc_copyPreset;
// Below, we simply name all the channels for each radio, to matching names. This will make the radios
// in game (and in the popup hint) show the NAME of the channel they are speaking on.
// Next, we rename the first 6 channels on each radios preset. The field names are different for each
// radio type because they are dependent of the radio's programming and configuration. This was done
// in ACRE because the actual field names match the technical specifications of how these radios
// internally handle their data.
//
// Although the names are different, they serve the same purpose. "name", "description" and "label" are
// the 3 different ways the 148, 152 and 117 reference their internal channel naming schemes.
["ACRE_PRC152", "example1", 1, "description", "PLTNET 1"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC152", "example1", 2, "description", "PLTNET 2"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC152", "example1", 3, "description", "PLTNET 3"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC152", "example1", 4, "description", "COY"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC152", "example1", 5, "description", "CAS"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC152", "example1", 6, "description", "FIRES"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC148", "example1", 1, "label", "PLTNET 1"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC148", "example1", 2, "label", "PLTNET 2"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC148", "example1", 3, "label", "PLTNET 3"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC148", "example1", 4, "label", "COY"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC148", "example1", 5, "label", "CAS"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC148", "example1", 6, "label", "FIRES"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC117F", "example1", 1, "name", "PLTNET 1"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC117F", "example1", 2, "name", "PLTNET 2"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC117F", "example1", 3, "name", "PLTNET 3"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC117F", "example1", 4, "name", "COY"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC117F", "example1", 5, "name", "CAS"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC117F", "example1", 6, "name", "FIRES"] call acre_api_fnc_setPresetChannelField;
// Finally, we save the preset information. This command basically "selects" the preset to be used for the radio.
// Remmember, each radio has its own presets; so we have to save each preset for each radio.
["ACRE_PRC152", "example1"] call acre_api_fnc_setPreset;
["ACRE_PRC148", "example1"] call acre_api_fnc_setPreset;
["ACRE_PRC117F", "example1"] call acre_api_fnc_setPreset;
_this spawn {
_unit = _this select 0;
_localUnitType = _this select 1;
waitUntil { ([] call acre_api_fnc_isInitialized ) };
switch _localUnitType do {
case 'platoon_rto': {
[ (["ACRE_PRC117F"] call acre_api_fnc_getRadioByType), 4] call acre_api_fnc_setRadioChannel;
[ (["ACRE_PRC152"] call acre_api_fnc_getRadioByType), 1] call acre_api_fnc_setRadioChannel;
};
case 'company_rto': {
[ (["ACRE_PRC117F"] call acre_api_fnc_getRadioByType), 4] call acre_api_fnc_setRadioChannel;
[ (["ACRE_PRC152"] call acre_api_fnc_getRadioByType), 1] call acre_api_fnc_setRadioChannel;
};
case 'forward_observer': {
[ (["ACRE_PRC117F"] call acre_api_fnc_getRadioByType), 6] call acre_api_fnc_setRadioChannel;
[ (["ACRE_PRC152"] call acre_api_fnc_getRadioByType), 4] call acre_api_fnc_setRadioChannel;
};
case 'JTAC': {
[ (["ACRE_PRC117F"] call acre_api_fnc_getRadioByType), 5] call acre_api_fnc_setRadioChannel;
[ (["ACRE_PRC152"] call acre_api_fnc_getRadioByType), 4] call acre_api_fnc_setRadioChannel;
};
};
};
Code: Select all
if(isDedicated) exitWith {};
private["_unit", "_localUnitType"];
_unit = _this select 0;
_localUnitType = _this select 1;
if(_unit != player) exitWith { false };
["ACRE_PRC152", "default", "example1"] call acre_api_fnc_copyPreset;
["ACRE_PRC117F", "default", "example1"] call acre_api_fnc_copyPreset;
["ACRE_PRC152", "example1", 1, "description", "PLTNET 1"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC152", "example1", 2, "description", "PLTNET 2"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC152", "example1", 3, "description", "PLTNET 3"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC152", "example1", 4, "description", "COY"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC152", "example1", 5, "description", "CAS"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC152", "example1", 6, "description", "FIRES"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC117F", "example1", 1, "name", "PLTNET 1"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC117F", "example1", 2, "name", "PLTNET 2"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC117F", "example1", 3, "name", "PLTNET 3"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC117F", "example1", 4, "name", "COY"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC117F", "example1", 5, "name", "CAS"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC117F", "example1", 6, "name", "FIRES"] call acre_api_fnc_setPresetChannelField;
["ACRE_PRC152", "example1"] call acre_api_fnc_setPreset;
["ACRE_PRC117F", "example1"] call acre_api_fnc_setPreset;
_this spawn {
_unit = _this select 0;
_localUnitType = _this select 1;
waitUntil { ([] call acre_api_fnc_isInitialized) };
switch _localUnitType do {
case 'ftl_leader_1': { [ (["ACRE_PRC343"] call getRadioByType), 1] call acre_api_fnc_setRadioChannel; };
case 'ftl_leader_2': { [ (["ACRE_PRC343"] call getRadioByType), 2] call acre_api_fnc_setRadioChannel; };
case 'ftl_leader_3': { [ (["ACRE_PRC343"] call getRadioByType), 3] call acre_api_fnc_setRadioChannel; };
case 'ftl_leader_4': { [ (["ACRE_PRC343"] call getRadioByType), 4] call acre_api_fnc_setRadioChannel; };
case 'ftl_leader_5': { [ (["ACRE_PRC343"] call getRadioByType), 5] call acre_api_fnc_setRadioChannel; };
case 'ftl_leader_6': { [ (["ACRE_PRC343"] call getRadioByType), 6] call acre_api_fnc_setRadioChannel; };
case 'squad_leader_1': {
[ (["ACRE_PRC343"] call getRadioByType), 1] call acre_api_fnc_setRadioChannel;
[ (["ACRE_PRC152"] call getRadioByType), 1] call acre_api_fnc_setRadioChannel;
};
case 'squad_leader_2': {
[ (["ACRE_PRC343"] call getRadioByType), 2] call acre_api_fnc_setRadioChannel;
[ (["ACRE_PRC152"] call getRadioByType), 1] call acre_api_fnc_setRadioChannel;
};
case 'squad_leader_3': {
[ (["ACRE_PRC343"] call getRadioByType), 3] call acre_api_fnc_setRadioChannel;
[ (["ACRE_PRC152"] call getRadioByType), 1] call acre_api_fnc_setRadioChannel;
};
case 'squad_leader_4': {
[ (["ACRE_PRC343"] call getRadioByType), 4] call acre_api_fnc_setRadioChannel;
[ (["ACRE_PRC152"] call getRadioByType), 2] call acre_api_fnc_setRadioChannel;
};
case 'squad_leader_5': {
[ (["ACRE_PRC343"] call getRadioByType), 5] call acre_api_fnc_setRadioChannel;
[ (["ACRE_PRC152"] call getRadioByType), 2] call acre_api_fnc_setRadioChannel;
};
case 'squad_leader_6': {
[ (["ACRE_PRC343"] call getRadioByType), 6] call acre_api_fnc_setRadioChannel;
[ (["ACRE_PRC152"] call getRadioByType), 2] call acre_api_fnc_setRadioChannel;
};
case 'platoon_hq_1': { [ (["ACRE_PRC343"] call getRadioByType), 7] call acre_api_fnc_setRadioChannel; };
case 'platoon_hq_2': { [ (["ACRE_PRC343"] call getRadioByType), 8] call acre_api_fnc_setRadioChannel; };
case 'company_hq': { [ (["ACRE_PRC343"] call getRadioByType), 9] call acre_api_fnc_setRadioChannel; };
case 'company_rto': {
[ (["ACRE_PRC343"] call getRadioByType), 9] call acre_api_fnc_setRadioChannel;
[ (["ACRE_PRC117F"] call getRadioByType), 4] call acre_api_fnc_setRadioChannel;
[ (["ACRE_PRC152"] call getRadioByType), 1] call acre_api_fnc_setRadioChannel;
};
case 'company_commander': {
[ (["ACRE_PRC343"] call getRadioByType), 9] call acre_api_fnc_setRadioChannel;
[ (["ACRE_PRC152"] call getRadioByType), 4] call acre_api_fnc_setRadioChannel;
};
case 'platoon_leader_1': {
[ (["ACRE_PRC343"] call getRadioByType), 7] call acre_api_fnc_setRadioChannel;
[ (["ACRE_PRC152"] call getRadioByType), 1] call acre_api_fnc_setRadioChannel;
};
case 'platoon_leader_2': {
[ (["ACRE_PRC343"] call getRadioByType), 8] call acre_api_fnc_setRadioChannel;
[ (["ACRE_PRC152"] call getRadioByType), 2] call acre_api_fnc_setRadioChannel;
};
case 'platoon_rto_1': {
[ (["ACRE_PRC343"] call getRadioByType), 7] call acre_api_fnc_setRadioChannel;
[ (["ACRE_PRC117F"] call getRadioByType), 4] call acre_api_fnc_setRadioChannel;
[ (["ACRE_PRC152"] call getRadioByType), 1] call acre_api_fnc_setRadioChannel;
};
case 'platoon_rto_2': {
[ (["ACRE_PRC343"] call getRadioByType), 8] call acre_api_fnc_setRadioChannel;
[ (["ACRE_PRC117F"] call getRadioByType), 4] call acre_api_fnc_setRadioChannel;
[ (["ACRE_PRC152"] call getRadioByType), 2] call acre_api_fnc_setRadioChannel;
};
};
};