Jump to content
Sign in to follow this  
fer

F2 Mission Development Framework (BAS f for ArmA 2)

Recommended Posts

I am having trouble getting the revive to work in F2. Either won’t work and defaults to standard mode or says when spawning that the soldier is unconscious choose another playable slot. Is there a F2 mission that I can Dnload with Norrins active so I can see whats wrong? Or is there advise that can help with this?

SOT

Share this post


Link to post
Share on other sites

I also ran into this problem.

Solution: move the initial player spawn location away from the respawn marker.

Here is an example.

Share this post


Link to post
Share on other sites

Just to clarify, is the 'Folk' version (the only available version for OA shown on http://www.ferstaberinde.com/f2/en/index.php?title=Main_Page) the right one? I.e. for standard use in OA? Link:

http://www.ferstaberinde.com/f2/downloads/f2_v2-4-5_oa_folk.7z

Basically, do I -need- to use the 'Folk' components you talk about later?

A build optimised for making OA missions which follow use the Folk platoons and supporting features.

OA Folk Platoons

OA Folk Assign Gear Script

OA Folk Group IDs

OA Folk Group Markers

OA Folk JIP Reinforcement Options

OA Briefing Template (shared)

Gear Snippets (shared)

Or is this intended; i.e. is this actually beneficial to the mission maker? (I obviously don't understand the nature of such a build :p ). You said there were multiple builds for different uses, but there is only this one provided?

Thank you for your work!

Share this post


Link to post
Share on other sites
JYou said there were multiple builds for different uses, but there is only this one provided?

I'm afraid that, at the moment, the Folk build is the only one available for OA. There are plans to add one (maybe two) alternative builds for OA, but I'm sorry I can't give you a date for that. In the meantime, I hope you'll find the Folk components useful.

Share this post


Link to post
Share on other sites

@SOT, when you are using revive all units and markers need to be at least 100m apart.

Intial unit placement to respawn marker 1 > 100m

respawn marker 1 to respawn marker 2 > 100m

The same goes for boot_hill

That should stop you getting any issues

Share this post


Link to post
Share on other sites
I'm afraid that, at the moment, the Folk build is the only one available for OA. There are plans to add one (maybe two) alternative builds for OA, but I'm sorry I can't give you a date for that. In the meantime, I hope you'll find the Folk components useful.

So, would you consider making a 'vanilla' version? Just so we can actually use this, as everyone plays OA these days, that's all :)

Either way, nice work.

Share this post


Link to post
Share on other sites
So, would you consider making a 'vanilla' version? Just so we can actually use this, as everyone plays OA these days, that's all :).

The Folk build is vanilla - no addons are required. Apologies if this isn't clear on the F2 site (I'll add something to that effect).

Share this post


Link to post
Share on other sites
The Folk build is vanilla - no addons are required. Apologies if this isn't clear on the F2 site (I'll add something to that effect).

Okay thank you.

Also, does that version necessitate that we use Folk stuff with it? Or can we slot in whatever we would with a 'normal' F2 version (like the old ArmA2 F2).

That was more my question :p

Share this post


Link to post
Share on other sites
Also, does that version necessitate that we use Folk stuff with it? Or can we slot in whatever we would with a 'normal' F2 version (like the old ArmA2 F2).

No, you can use anything you like. The 'normal' builds of F2 for ArmA2 all used the standard ShackTactical platoon, weapons etc. The Folk build for OA just comes with the Folk platoon, weapons etc. instead - but they're quite similar. Naturally, you can always delete all the pre-placed units and use your own formations instead. Does that clear things up?

Share this post


Link to post
Share on other sites
No, you can use anything you like. The 'normal' builds of F2 for ArmA2 all used the standard ShackTactical platoon, weapons etc. The Folk build for OA just comes with the Folk platoon, weapons etc. instead - but they're quite similar. Naturally, you can always delete all the pre-placed units and use your own formations instead. Does that clear things up?

Ah, yes, much clearer!

It would probably avoid this in future if the site explained all of this a little better - especially for those of us who had never heard of 'Folk', or didn't who didn't know that we didn't have to use their stuff :)

Again, thank you very much!

- HateDread.

Share this post


Link to post
Share on other sites
especially for those of us who had never heard of 'Folk'

That's because folk is a very mysterious organisation - or is it an organisation?

Share this post


Link to post
Share on other sites

Stupid Newbie question about body removal.

I have a script that calls the following block for wave attacks. The units spawn and obey the attack orders, but do not disappear when I have FIFO enabled in the init sqf. Other features (e.g. COIN, markers) work as expected. I suspect I'm doing something silly with locality, _x and _this.

 
_grp = [getMarkerPos "opforspawn", east, 5,[],[],[f_skillOPF-0.1,f_skillOPF]] call BIS_fnc_spawnGroup;
{_x addEventHandler ["killed", {if (isServer) then {f_abrFIFO = f_abrFIFO + [_x select 0];} else {_x execVM "f\common\f_abrAddToFIFO.sqf"};}];} forEach units _grp;
nul = [_grp,(getMarkerPos "infdestination")] call BIS_fnc_taskAttack; 
_grp allowFleeing 0;

Could we get an example of correct usage on the F2 wiki? The tip baffles me as I have no idea how to assign and run inits post creation.

Thanks a bunch.

Share this post


Link to post
Share on other sites

Hi guys,

I am trying to implement a random tasks into F2 I have placed the code in the init but I get nothing no tasks appear, it works if I create a new mission without F2 and pop it

into the init any idea why it would not work ?

Code

//taskCount = paramsarray select 0;

taskCount = 6;

fncAddTask = {

switch _this do {

case 0: {

tskobj_1 = player createsimpletask ["task1"];

tskobj_1 setsimpletaskdescription ["1","1","1"];

player setcurrenttask tskobj_1;

};

case 1: {

tskobj_2 = player createsimpletask ["task2"];

tskobj_2 setsimpletaskdescription ["2","2","2"];

player setcurrenttask tskobj_2;

};

case 2: {

tskobj_3 = player createsimpletask ["task3"];

tskobj_3 setsimpletaskdescription ["3","3","3"];

player setcurrenttask tskobj_3;

};

case 3: {

tskobj_4 = player createsimpletask ["task4"];

tskobj_4 setsimpletaskdescription ["4","4","4"];

player setcurrenttask tskobj_4;

};

case 4: {

tskobj_5 = player createsimpletask ["task5"];

tskobj_5 setsimpletaskdescription ["5","5","5"];

player setcurrenttask tskobj_5;

};

case 5: {

tskobj_6 = player createsimpletask ["task6"];

tskobj_6 setsimpletaskdescription ["6","6","6"];

player setcurrenttask tskobj_6;

};

};

};

fncPickTask = {

if isserver then {

if (count tasks == 0) then {

theEnd = true;

publicvariable "theEnd";

} else {

addTask = tasks select (floor random count tasks);

tasks = tasks - [addTask];

publicvariable "addTask";

if !isdedicated then { addTask call fncAddTask };

};

};

};

theEnd = false;

if isserver then {

tasks = [];

for "_i" from 0 to (taskCount - 1) do {

tasks set [_i,_i];

};

} else {

[] spawn {

waituntil {!isnil "addTask"};

addTask call fncAddTask;

"addTask" addpublicvariableeventhandler {(_this select 1) call fncAddTask};

};

};

call fncPickTask; // add first task for briefing

Many thanks

Share this post


Link to post
Share on other sites

I would like to use Monsada's UPSMON with F2, but I can't seem to integrate it correctly...

On the UPSMON manual it says to install

//Init UPSMON scritp
call compile preprocessFileLineNumbers "scripts\Init_UPSMON.sqf";

in the init.sqf. I added this at the top of the F2 init.sqf but I keep getting errors...

Can anyone help me put this line in the right place?

Edited by Antigoon

Share this post


Link to post
Share on other sites

What errors? There shouldn't be any problem as far as I know. Did you remove this line to see if you are still getting errors? If you do then you have another problem unrelated to UPSMON because removing this line should basically disable UPSMON completely and all UPSMON instances you start form other places such as units' init lines should never start.

Share this post


Link to post
Share on other sites
I would like to use Monsada's UPSMON with F2, but I can't seem to integrate it correctly...

On the UPSMON manual it says to install

//Init UPSMON scritp
call compile preprocessFileLineNumbers "scripts\Init_UPSMON.sqf";

in the init.sqf. I added this at the top of the F2 init.sqf but I keep getting errors...

Can anyone help me put this line in the right place?

I just call this command serverside and it works fine for me:

if (isServer) then

{

call compile preprocessFileLineNumbers "scripts\Init_UPSMON.sqf";

};

But posting your error messages would be very helpful :)

Share this post


Link to post
Share on other sites

custom sound in f2

ok so i made an intro to a mission and then merged it with the f2 mission, for some reason i cant hear the music in game unless i have the DB+ option in the descritpion turned up so i added the cfg music to the f2 description and it doesnt seem to work even though it worked fine w/o the f2 mission kit..heres what i added to the description

// ============================================================================================
// Music Settings

class CfgMusic
{
tracks[]={};

class music1
{
 name = "";
 sound[] = {"\sound\music1.ogg", db+10, 1.0};
};
};

is there something I am missing?

EDIT!!!!!:

NM i forgot to save the mission in OA so that the description updated :S lol

Edited by Charles Darwin

Share this post


Link to post
Share on other sites
NM i forgot to save the mission in OA so that the description updated :S lol

The number of time I have discovered that the mission 'isn't working' because the files I have been editing with TextPad are not the same files as the ones being read by the OA Editor ... is too many to count. This kind of thing happens to everyone, don't worry!

:)

Share this post


Link to post
Share on other sites

For testing (and actually for playing, too), always exit back to the mission selection list and then restart the mission from there. Anything else and you may find yourself bashing your head against the wall.

Share this post


Link to post
Share on other sites

Hi Fer,

First just like to say much kudos to you and the team for F2. I have a little prob in taht I am using Stalker GBs MPT units and cant get them to re_arm with the weapns loadout i would like. They come under _Faction UK_Armed_Forces in the editor but for some reason the assigngear script doesnt seem to do anything. The classnames have all been edited to use UKF Weps but they still spawn with their original loadout. Any suggestions. Thks

Share this post


Link to post
Share on other sites
Hi Fer,

First just like to say much kudos to you and the team for F2. I have a little prob in taht I am using Stalker GBs MPT units and cant get them to re_arm with the weapns loadout i would like. They come under _Faction UK_Armed_Forces in the editor but for some reason the assigngear script doesnt seem to do anything. The classnames have all been edited to use UKF Weps but they still spawn with their original loadout. Any suggestions. Thks

Droogs, two things to check/change:

1. Line #39 probably looks like this right now:

if (!(_faction == "bis_us") and !(_faction == "bis_baf") and !(_faction == "bis_tk") and !(_faction == "bis_tk_ins") and !(_faction == "bis_tk_gue") and !(_faction == "bis_un") and !(_faction == "bis_cz") and !(_faction == "bis_ger") and !(_faction == "bis_tk_civ") and !(_faction == "bis_civ_special")) exitwith {player globalchat format ["DEBUG (f\common\folk_assignGear.sqf): Unit %1 faction %2 is not correct. Make sure the script is initialized correctly.",_unit,_faction];};

If the faction for your desired units isn't listed in that line, the script won't do anything (in DEBUG mode, which you can set at mission run time via parameters, you'll get an error message telling you that a faction is 'not correct'). Let's say your faction is called myFaction, then change the line to read:

if (!(_faction == "myFaction") and !(_faction == "bis_us") and !(_faction == "bis_baf") and !(_faction == "bis_tk") and !(_faction == "bis_tk_ins") and !(_faction == "bis_tk_gue") and !(_faction == "bis_un") and !(_faction == "bis_cz") and !(_faction == "bis_ger") and !(_faction == "bis_tk_civ") and !(_faction == "bis_civ_special")) exitwith {player globalchat format ["DEBUG (f\common\folk_assignGear.sqf): Unit %1 faction %2 is not correct. Make sure the script is initialized correctly.",_unit,_faction];};

2. Ensure that in the script's first switch statement (where it checks the faction name), at least one of your cases looks for the faction name. Be careful to ensure the case looks for the faction name as written entirely in lower case. For example:

case "myfaction":

If neither of those pointers help, let me know and I'll see what I can do. Good luck!

:)

Share this post


Link to post
Share on other sites

Hi Fer,

Thks for your reply. It was a case of Capitals in the Case "UK_armed_forces". All now seems to be OK except for my M249 gunner. Can't get him to spawn with the SAW unless I change _MG from a local variable to a global one and use addweapon "M249"; rather than addweapon _MG. If I use the local variable he has all the magazines etc I want but no primary weapon

Share this post


Link to post
Share on other sites
All now seems to be OK except for my M249 gunner. Can't get him to spawn with the SAW unless I change _MG from a local variable to a global one and use addweapon "M249"; rather than addweapon _MG. If I use the local variable he has all the magazines etc I want but no primary weapon

Sounds like an odd issue - how about you post your file here (using the spoiler tag)?

Share this post


Link to post
Share on other sites

Here is the file:

// F2A2 - ShackTactical Assign Gear Script
// Credits: Please see the F2 online manual ([url]http://www.ferstaberinde.com/f2/en/[/url])
// ====================================================================================

// DECLARE VARIABLES AND FUNCTIONS

private [
"_faction","_rifle","_rifleGL","_crewrifle","_acrifle","_rifleACOG""_LMG","_riflemag",
"_GLMag","_MGmag","_grenade","_at","_atmag",
"_smokewhite","_smokegreen","_smokered","_smokegrenade","_smokerescue",
"_pistol","_pistolmag",
"_medicmag","_snrifle","_snmag","_sprifle","_spmag","_mediumMG","_mediumMGmag", "_heavyMG", "_heavyMGtripod", "_heavyMGmag",
"_mediumAT","_mediumATmag1","_mediumATmag2","_heavyAT","_heavyATmag1","_heavyATmag2","_rucksack","_medicrucksack",
"_bandage", "_morphine", "_epinephrine", "_btty", "_ldes",
"_oldrifle","_oldmag",
"_ruckmags","_ruckweapons",
"_bandage","_morphine","_epinephrine"];

// ====================================================================================

// ERROR CHECKING
// If the script has been called without both required paramaters being passed, it 
// exits immediately.

sleep .1;

if (isNull (_this select 1)) exitwith {};
if (!local (_this select 1)) exitwith {};

// ====================================================================================

// GET UNIT FACTION
// The second variable passed to the script identifies the unit, from which we can
// then get the faction. More error checking is included here.

_typeofUnit = toLower (_this select 0);
_unit = _this select 1;
_faction = toLower (faction _unit);

if (isnil ("_faction")) then {call compile format ["_faction = '%1'",(faction _unit)];};
_faction =  tolower _faction;
if (!(_faction == "ru") and !(_faction == "usmc") and !(_faction == "uk_armed_forces") and !(_faction == "gue") and !(_faction == "ins") and !(_faction == "cdf")) exitwith {player globalchat format ["DEBUG (f\common\@ShackTac_assignGear.sqf): Unit %1 faction %2 is not correct. Make sure the script is initialized correctly.",_unit,_faction];};

// ====================================================================================

// DEFINE GLOBAL EQUIPMENT
// The following blocks of code define equipment that is universal (medical equipment)

_bandage = "ACE_Bandage";
_morphine = "ACE_Morphine";
_epinephrine = "ACE_Epinephrine";

// ====================================================================================

// DEFINE FACTION EQUIPMENT
// The following blocks of code define the equipment for each faction.

switch (_faction) do
{

// ====================================================================================

// EQUIPMENT: RUSSIAN
// The block of code below identifies equipment for the Russian faction.

  case "ru":
  {
  _rifle = "AK_107_kobra";
  _rifleGL = "AK_107_GL_kobra";
  _medicrifle = "AKS_74_U";
  _medicmag = "30Rnd_545x39_AK";
  _MG = "RPK_74";
  _riflemag = "30Rnd_545x39_AK";
  _GLmag = "1Rnd_HE_GP25";
  _MGmag = "75Rnd_545x39_RPK";
  _grenade = "HandGrenade_East";
  _at = "ACE_RPG22";
  _atmag = "ACE_RPG22";

  _snrifle = "SVD_CAMO";
  _snmag = "10Rnd_762x54_SVD";
  _sprifle = "AKS_74_U";
  _spmag = "30Rnd_545x39_AK";

  _mediumMG = "PK";
  _mediumMGmag = "100Rnd_762x54_PK";

  _heavyMG = "ACE_KORDProxy";
  _heavyMGtripod = "ACE_6T7TripodProxy";
  _heavyMGmag = "ACE_KORD_CSWDM";

  _mediumAT = "ACE_RPG29";
  _mediumATmag1 = "ACE_RPG29_PG29";
  _mediumATmag2 = "ACE_RPG29_TBG29";

  _heavyAT = "MetisLauncher";
  _heavyATmag1 = "AT13";
  _heavyATmag2 = "AT13";

  _smokewhite = "1Rnd_SMOKE_GP25";
  _smokegreen = "1Rnd_SMOKEGREEN_GP25";
  _smokered = "1Rnd_SMOKERED_GP25";
  _smokegrenade = "SmokeShell";

  _pistol = "Makarov";
  _pistolmag = "8Rnd_9x18_Makarov";

  _rucksack = "ACE_Rucksack_MOLLE_Wood";
  _medicrucksack = "ACE_Rucksack_MOLLE_Wood";

  _oldrifle = "AK_47_M";
  _oldmag = "30Rnd_762x39_AK47";
  };

// ====================================================================================

// EQUIPMENT: UKF
// The block of code below identifies equipment for the UKF faction.

  case "uk_armed_forces":
  {
  _rifle = "ukf_L85A2_susat";
  _rifleGL = "ukf_L85A2AG36_susat";
  _crewrifle = "ukf_L85A2K_susat";
  _acrifle = "ukf_L85A2";
  _rifleACOG = "ukf_L85A2_acog";
  _medicmag = "30Rnd_556x45_Stanag";
  _LMG = "M249";
  _riflemag = "30Rnd_556x45_Stanag";
  _GLmag = "1Rnd_HE_M203";
  _MGmag = "200Rnd_556x45_M249";
  _grenade = "HandGrenade_West";
  _at = "M136"; 
  _atmag = "M136";

  _snrifle = "ukf_l96a1_cam";
  _snmag = "ukf_10Rnd_762x51_mag";
  _sprifle = "ukf_L85A2_acog";
  _spmag = "30Rnd_556x45_Stanag";

  _mediumMG = "ukf_gpmg";
  _mediumMGmag = "100Rnd_762x51_M240";

  _heavyMG = "ACE_M2HBProxy";
  _heavyMGtripod = "ACE_M3TripodProxy";
  _heavyMGmag = "ACE_M2_CSWDM";

  _mediumAT = "SMAW";
  _mediumATmag1 = "SMAW_HEAA";
  _mediumATmag2 = "SMAW_HEDP";

  _heavyAT = "Javelin";
  _heavyATmag1 = "Javelin";
  _heavyATmag2 = "Javelin";

  _smokewhite = "1Rnd_Smoke_M203";
  _smokegreen = "1Rnd_SmokeGreen_M203";
  _smokered = "1Rnd_SmokeRed_M203";
  _smokegrenade = "SmokeShell";
  _smokerescue = "SmokeShellPurple";

  _btty = "Laserbatteries";
  _ldes = "Laserdesignator";

  _pistol = "M9";
  _pistolmag = "15Rnd_9x19_M9";

  _rucksack = "ACE_Rucksack_MOLLE_WMARPAT";
  _medicrucksack = "ACE_Rucksack_MOLLE_WMARPAT_Medic"; 
  };

// ====================================================================================

// EQUIPMENT: USMC
// The block of code below identifies equipment for the USMC faction.

  case "usmc":
  {
  _rifle = "ACE_SOC_M4A1_Aim";
  _rifleGL = "ACE_SOC_M4A1_GL_AIMPOINT";
  _crewrifle = "ukf_L85A2K_susat";
  _acrifle = "ukf_L85A2";
//   _rifleGL = "ACE_SOC_M4A1_GL_Aim";
  _medicrifle = "ACE_SOC_M4A1_Aim";
  _medicmag = "30Rnd_556x45_Stanag";
  _LMG = "M249";
  _riflemag = "30Rnd_556x45_Stanag";
  _GLmag = "1Rnd_HE_M203";
  _MGmag = "200Rnd_556x45_M249";
  _grenade = "HandGrenade_West";
  _at = "M136";
  _atmag = "M136";

  _snrifle = "M40A3";
  _snmag = "5Rnd_762x51_M24";
  _sprifle = "M4A1_Aim_camo";
  _spmag = "30Rnd_556x45_Stanag";

  _mediumMG = "M240";
  _mediumMGmag = "100Rnd_762x51_M240";

  _heavyMG = "ACE_M2HBProxy";
  _heavyMGtripod = "ACE_M3TripodProxy";
  _heavyMGmag = "ACE_M2_CSWDM";

  _mediumAT = "SMAW";
  _mediumATmag1 = "SMAW_HEAA";
  _mediumATmag2 = "SMAW_HEDP";

  _heavyAT = "Javelin";
  _heavyATmag1 = "Javelin";
  _heavyATmag2 = "Javelin";

  _smokewhite = "1Rnd_Smoke_M203";
  _smokegreen = "1Rnd_SmokeGreen_M203";
  _smokered = "1Rnd_SmokeRed_M203";
  _smokegrenade = "SmokeShell";
  _smokerescue = "SmokeShellRed";

  _pistol = "M9";
  _pistolmag = "15Rnd_9x19_M9";

  _rucksack = "ACE_Rucksack_MOLLE_WMARPAT";
  _medicrucksack = "ACE_Rucksack_MOLLE_WMARPAT_Medic";

  _oldrifle = "ACE_M16A4_Iron";
  _oldmag = "20Rnd_556x45_Stanag";
  };

// ====================================================================================

// EQUIPMENT: NAPA
// The block of code below identifies equipment for the NAPA faction.

  case "gue":
  {
  _rifle = "AK_74";
  _rifleGL = "AK_74_GL";
  _medicrifle = "AKS_74_U";
  _medicmag = "30Rnd_545x39_AK";
  _MG = "RPK_74";
  _riflemag = "30Rnd_545x39_AK";
  _GLmag = "1Rnd_HE_GP25";
  _MGmag = "75Rnd_545x39_RPK";
  _grenade = "HandGrenade_East";
  _at = "RPG18";
  _atmag = "RPG18";

  _snrifle = "Huntingrifle";
  _snmag = "5x_22_LR_17_HMR";
  _sprifle = "AKS_74_U";
  _spmag = "30Rnd_545x39_AK";

  _mediumMG = "PK";
  _mediumMGmag = "100Rnd_762x54_PK";

  _heavyMG = "ACE_DSHKMProxy";
  _heavyMGtripod = "ACE_DSHKMTripodProxy";
  _heavyMGmag = "ACE_DSHKM_CSWDM";

  _mediumAT = "RPG7V";
  _mediumATmag1 = "PG7V";
  _mediumATmag2 = "PG7VR";

  _heavyAT = "ACE_RPG29";
  _heavyATmag1 = "ACE_RPG29_PG29";
  _heavyATmag2 = "ACE_RPG29_TBG29";

  _smokewhite = "1Rnd_SMOKE_GP25";
  _smokegreen = "1Rnd_SMOKEGREEN_GP25";
  _smokered = "1Rnd_SMOKERED_GP25";
  _smokegrenade = "SmokeShell";

  _pistol = "Makarov";
  _pistolmag = "8Rnd_9x18_Makarov";

  _rucksack = "ACE_BackPack";
  _medicrucksack = "ACE_BackPack";

  _oldrifle = "ACE_SKS";
  _oldmag = "ACE_10Rnd_762x39_B_SKS";
  };

// ====================================================================================

// EQUIPMENT: CDF
// The block of code below identifies equipment for the CDF faction.

  case "cdf":
  {
  _rifle = "AK_74";
  _rifleGL = "AK_74_GL";
  _medicrifle = "AKS_74_U";
  _medicmag = "30Rnd_545x39_AK";
  _MG = "RPK_74";
  _riflemag = "30Rnd_545x39_AK";
  _GLmag = "1Rnd_HE_GP25";
  _MGmag = "75Rnd_545x39_RPK";
  _grenade = "HandGrenade_East";
  _at = "RPG18";
  _atmag = "RPG18";

  _snrifle = "SVD";
  _snmag = "10Rnd_762x54_SVD";
  _sprifle = "AKS_74_U";
  _spmag = "30Rnd_545x39_AK";

  _mediumMG = "PK";
  _mediumMGmag = "100Rnd_762x54_PK";

  _heavyMG = "ACE_DSHKMProxy";
  _heavyMGtripod = "ACE_DSHKMTripodProxy";
  _heavyMGmag = "ACE_DSHKM_CSWDM";

  _mediumAT = "RPG7V";
  _mediumATmag1 = "PG7V";
  _mediumATmag2 = "PG7VR";

  _heavyAT = "ACE_RPG29";
  _heavyATmag1 = "ACE_RPG29_PG29";
  _heavyATmag2 = "ACE_RPG29_TBG29";

  _smokewhite = "1Rnd_SMOKE_GP25";
  _smokegreen = "1Rnd_SMOKEGREEN_GP25";
  _smokered = "1Rnd_SMOKERED_GP25";
  _smokegrenade = "SmokeShell";

  _pistol = "ACE_TT";
  _pistolmag = "ACE_8Rnd_762x25_B_Tokarev";

  _rucksack = "ACE_Rucksack_MOLLE_Green";
  _medicrucksack = "ACE_Rucksack_MOLLE_Green_Medic";

  _oldrifle = "AK_47_M";
  _oldmag = "30Rnd_762x39_AK47";
  };

// ====================================================================================

// EQUIPMENT: CHDKZ
// The block of code below identifies equipment for the ChDKZ faction.

  case "ins":
  {
  _rifle = "AK_74";
  _rifleGL = "AK_74_GL";
  _medicrifle = "AKS_74_U";
  _medicmag = "30Rnd_545x39_AK";
  _MG = "RPK_74";
  _riflemag = "30Rnd_545x39_AK";
  _GLmag = "1Rnd_HE_GP25";
  _MGmag = "75Rnd_545x39_RPK";
  _grenade = "HandGrenade_East";
  _at = "RPG18";
  _atmag = "RPG18";

  _snrifle = "SVD";
  _snmag = "10Rnd_762x54_SVD";
  _sprifle = "AKS_74_U";
  _spmag = "30Rnd_545x39_AK";

  _mediumMG = "PK";
  _mediumMGmag = "100Rnd_762x54_PK";

  _heavyMG = "ACE_DSHKMProxy";
  _heavyMGtripod = "ACE_DSHKMTripodProxy";
  _heavyMGmag = "ACE_DSHKM_CSWDM";

  _mediumAT = "RPG7V";
  _mediumATmag1 = "PG7V";
  _mediumATmag2 = "PG7VR";

  _heavyAT = "ACE_RPG29";
  _heavyATmag1 = "ACE_RPG29_PG29";
  _heavyATmag2 = "ACE_RPG29_TBG29";

  _smokewhite = "1Rnd_SMOKE_GP25";
  _smokegreen = "1Rnd_SMOKEGREEN_GP25";
  _smokered = "1Rnd_SMOKERED_GP25";
  _smokegrenade = "SmokeShell";

  _pistol = "ACE_TT";
  _pistolmag = "ACE_8Rnd_762x25_B_Tokarev";

  _rucksack = "ACE_BackPack";
  _medicrucksack = "ACE_BackPack";

  _oldrifle = "ACE_SKS";
  _oldmag = "ACE_10Rnd_762x39_B_SKS";
  };

};

// ====================================================================================

// DEFINE UNIT TYPE LOADOUTS
// The following blocks of code define loadouts for each type of unit (the unit type
// is passed to the script in the first variable).

switch (_typeofUnit) do
{

// ====================================================================================

// LOADOUT: PLATOON COMMANDER

  case "pltco":
  {
     removeallweapons _unit;
     {_unit addmagazine _riflemag} foreach [1,2,3,4,5,6,7,8];
     {_unit addmagazine _bandage} foreach [1,2];
     {_unit addmagazine _grenade} foreach [1,2];
     {_unit addmagazine _smokegrenade} foreach [1,2];      
     _unit addweapon _rifle;
     _unit addweapon "NVGoggles";   
     _unit addweapon "Binocular";

     _unit addweapon _rucksack;

     [_unit,_riflemag,6] spawn f_addMagToRuck;;
     [_unit,_smokegrenade,2] spawn f_addMagToRuck;
     [_unit,_grenade,2] spawn f_addMagToRuck;  

     _unit selectweapon primaryweapon _unit;
  };

// ====================================================================================

// LOADOUT: PLATOON RadOp.

  case "radop":
  {
     removeallweapons _unit;
     {_unit addmagazine _riflemag} foreach [1,2,3,4,5,6];
     {_unit addmagazine _bandage} foreach [1,2];
     {_unit addmagazine _grenade} foreach [1,2];
     {_unit addmagazine _smokegrenade} foreach [1,2];
     {_unit addmagazine _btty} foreach [1,2];
     _unit addweapon _rifle;
     _unit addweapon "NVGoggles"; 
     _unit addweapon _ldes; 

     _unit addweapon _rucksack;

     [_unit,_riflemag,8] spawn f_addMagToRuck;
     [_unit,_smokegrenade,2] spawn f_addMagToRuck;
     [_unit,_grenade,4] spawn f_addMagToRuck;       

     _unit selectweapon primaryweapon _unit;
  };

// ====================================================================================

// LOADOUT: PLATOON HQ SECTION ENGINEER

  case "eng":
  {
     removeallweapons _unit;
     {_unit addmagazine _riflemag} foreach [1,2,3,4,5,6];
     _unit addweapon _rifle;
     {_unit addmagazine _grenade} foreach [1,2];
     {_unit addmagazine _smokegrenade} foreach [1,2];
     {_unit addmagazine _bandage} foreach [1,2];
     _unit addweapon "NVGoggles";

     _unit addweapon _rucksack;

     [_unit,_riflemag,8] spawn f_addMagToRuck;
     [_unit,_grenade,2] spawn f_addMagToRuck; 

     _unit selectweapon primaryweapon _unit;
  };

// ====================================================================================

// LOADOUT: PLATOON MEDIC

  case "pltm":
  {
     removeallweapons _unit;
     {_unit addmagazine _medicmag} foreach [1,2,3,4,5];
     _unit addweapon _rifle;
     _unit addweapon "NVGoggles";   
     {_unit addmagazine _smokegrenade;} foreach [1,2];
     {_unit addmagazine _bandage;} foreach [1,2];
     {_unit addmagazine _morphine;} foreach [1];
     {_unit addmagazine _epinephrine;} foreach [1];

     _unit addweapon _medicrucksack;

     [_unit,_medicmag,5] spawn f_addMagToRuck;
     [_unit,_smokegrenade,2] spawn f_addMagToRuck; 
     [_unit,_bandage,10] spawn f_addMagToRuck; 
     [_unit,_morphine,11] spawn f_addMagToRuck; 
     [_unit,_epinephrine,9] spawn f_addMagToRuck; 

     _unit selectweapon primaryweapon _unit;
  };

// ====================================================================================

// LOADOUT: GRENADIER

  case "gdr":
  {
     removeallweapons _unit;
     {_unit addmagazine _riflemag} foreach [1,2,3,4,5,6,7,8];
     {_unit addmagazine _grenade} foreach [1,2];
     {_unit addmagazine _smokegrenade;} foreach [1,2];
     {_unit addmagazine _GLmag} foreach [1,2,3,4];
     {_unit addmagazine _bandage} foreach [1,2];
     {_unit addmagazine _smokewhite} foreach [1,2];
     _unit addweapon _rifleGL;
     _unit addweapon "NVGoggles";  

     _unit addweapon _rucksack;

     [_unit,_riflemag,5] spawn f_addMagToRuck;
     [_unit,_smokewhite,3] spawn f_addMagToRuck;
     [_unit,_GLmag,6] spawn f_addMagToRuck;
     [_unit,_smokerescue,1] spawn f_addMagToRuck;
     [_unit,_smokegrenade,1] spawn f_addMagToRuck;
     [_unit,_grenade,1] spawn f_addMagToRuck; 

     _unit selectweapon primaryweapon _unit;
  };

// ====================================================================================

// LOADOUT: MEDIC

  case "m":
  {
     removeallweapons _unit;
     {_unit addmagazine _medicmag} foreach [1,2,3,4,5];
     _unit addweapon _rifle;
     _unit addweapon "NVGoggles";   
     {_unit addmagazine _smokegrenade;} foreach [1,2];
     {_unit addmagazine _bandage;} foreach [1,2];
     {_unit addmagazine _morphine;} foreach [1];
     {_unit addmagazine _epinephrine;} foreach [1];

     _unit addweapon _medicrucksack;

     [_unit,_medicmag,5] spawn f_addMagToRuck;
     [_unit,_smokegrenade,2] spawn f_addMagToRuck;
     [_unit,_bandage,10] spawn f_addMagToRuck; 
     [_unit,_morphine,11] spawn f_addMagToRuck; 
     [_unit,_epinephrine,9] spawn f_addMagToRuck; 

     _unit selectweapon primaryweapon _unit;
  };

// ====================================================================================

// LOADOUT: SECTION IC/2IC

  case "ic":
  {
     removeallweapons _unit;
     {_unit addmagazine _riflemag} foreach [1,2,3,4,5,6,7,8];
     {_unit addmagazine _grenade} foreach [1,2];
     {_unit addmagazine _smokegrenade;} foreach [1,2];
     {_unit addmagazine _bandage} foreach [1,2];
     _unit addweapon _rifle;
     _unit addweapon "NVGoggles";   
     _unit addweapon "Binocular";

     _unit addweapon _rucksack;

     [_unit,_riflemag,8] spawn f_addMagToRuck;
     [_unit,_smokerescue,1] spawn f_addMagToRuck;
     [_unit,_smokegrenade,2] spawn f_addMagToRuck;
     [_unit,_grenade,4] spawn f_addMagToRuck; 

     _unit selectweapon primaryweapon _unit;
  };

// ====================================================================================

// LOADOUT: LMG
// The loadouts differ slightly for each faction.

  case "ar":
  {
     switch (_faction) do
     {
  	case "ru":
  	{
      removeallweapons _unit;
      {_unit addmagazine _MGmag;} foreach [1,2,3,4,5];
      _unit addweapon _MG;
      {_unit addmagazine _pistolmag;} foreach [1,2];
      {_unit addmagazine _bandage} foreach [1,2];
      _unit addweapon _pistol;
      _unit addweapon "NVGoggles";

      _unit addweapon _rucksack;

      [_unit,_MGmag,3] spawn f_addMagToRuck;	      

      _unit selectweapon primaryweapon _unit;
};
case "uk_armed_forces":
{
      removeallweapons _unit;
      {_unit addmagazine _MGmag;} foreach [1,2,3,4];
      {_unit addmagazine _bandage} foreach [1,2];
      _unit addweapon "M249";
      _unit addweapon "NVGoggles";

      _unit addweapon _rucksack;

      [_unit,_MGmag,2] spawn f_addMagToRuck;	      

      _unit selectweapon primaryweapon _unit;
};
case "usmc":
{
      removeallweapons _unit;
      {_unit addmagazine _MGmag;} foreach [1,2];
      _unit addweapon _LMG;
      {_unit addmagazine _pistolmag;} foreach [1,2];
      {_unit addmagazine _bandage} foreach [1,2];
      _unit addweapon _pistol;
      _unit addweapon "NVGoggles";

      _unit addweapon _rucksack;

      [_unit,_MGmag,1] spawn f_addMagToRuck;	      

      _unit selectweapon primaryweapon _unit;
};
case "gue":
{
      removeallweapons _unit;
      {_unit addmagazine _MGmag;} foreach [1,2,3,4,5];
      _unit addweapon _MG;
      {_unit addmagazine _pistolmag;} foreach [1,2];
      {_unit addmagazine _bandage} foreach [1,2];
      _unit addweapon _pistol;
      _unit addweapon "NVGoggles";

      _unit addweapon _rucksack;

      [_unit,_MGmag,3] spawn f_addMagToRuck;

      _unit selectweapon primaryweapon _unit;
};
case "ins":
{
      removeallweapons _unit;
      {_unit addmagazine _MGmag;} foreach [1,2,3,4,5];
      _unit addweapon _MG;
      {_unit addmagazine _pistolmag;} foreach [1,2];
      {_unit addmagazine _bandage} foreach [1,2];
      _unit addweapon _pistol;
      _unit addweapon "NVGoggles";

      _unit addweapon _rucksack;

      [_unit,_MGmag,3] spawn f_addMagToRuck;

      _unit selectweapon primaryweapon _unit;
};
case "cdf":
{
      removeallweapons _unit;
      {_unit addmagazine _MGmag;} foreach [1,2,3,4,5];
      _unit addweapon _MG;
      {_unit addmagazine _pistolmag;} foreach [1,2];
      {_unit addmagazine _bandage} foreach [1,2];
      _unit addweapon _pistol;
      _unit addweapon "NVGoggles";

      _unit addweapon _rucksack;

      [_unit,_MGmag,3] spawn f_addMagToRuck;

      _unit selectweapon primaryweapon _unit;
};
     };
  };

// ====================================================================================

// LOADOUT: LMG No2
// The loadouts differ slightly for each faction.

  case "aar":
  {
     switch (_faction) do
     {
     	case "ru":
{
      removeallweapons _unit;
      {_unit addmagazine _riflemag} foreach [1,2,3,4,5];
      {_unit addmagazine _MGmag;} foreach [1,2];
      {_unit addmagazine _Grenade} foreach [1,2];
      {_unit addmagazine _bandage} foreach [1,2];
      _unit addweapon _rifle;
      _unit addweapon "NVGoggles";

      _unit addweapon _rucksack;

      [_unit,_riflemag,5] spawn f_addMagToRuck;
      [_unit,_MGmag,8] spawn f_addMagToRuck;

      _unit selectweapon primaryweapon _unit;
     	};

     	case "uk_armed_forces":
  	{
      removeallweapons _unit;
      {_unit addmagazine _riflemag} foreach [1,2,3,4];
      {_unit addmagazine _grenade} foreach [1,2];
      {_unit addmagazine _smokegrenade;} foreach [1,2];
      {_unit addmagazine _bandage} foreach [1,2];
      _unit addweapon _rifle;
      _unit addweapon "NVGoggles";
      {_unit addmagazine _MGmag;} foreach [1,2,3,4];


      _unit addweapon _rucksack;

      [_unit,_riflemag,4] spawn f_addMagToRuck;
      [_unit,_MGmag,3] spawn f_addMagToRuck;

      _unit selectweapon primaryweapon _unit;
     	};
     	case "usmc":
  	{
      removeallweapons _unit;
      {_unit addmagazine _riflemag} foreach [1,2,3,4];
      {_unit addmagazine _grenade} foreach [1,2];
      {_unit addmagazine _smokegrenade;} foreach [1,2];
      {_unit addmagazine _MGmag;} foreach [1,2];
      {_unit addmagazine _bandage} foreach [1,2];
      _unit addweapon _rifleACOG;
      _unit addweapon "NVGoggles";

      _unit addweapon _rucksack;

      [_unit,_riflemag,4] spawn f_addMagToRuck;
      [_unit,_MGmag,3] spawn f_addMagToRuck;

      _unit selectweapon primaryweapon _unit;
     	};
     	case "gue":
{
      removeallweapons _unit;
      {_unit addmagazine _riflemag} foreach [1,2,3,4,5];
      {_unit addmagazine _MGmag;} foreach [1,2];
      {_unit addmagazine _Grenade} foreach [1,2];
      {_unit addmagazine _bandage} foreach [1,2];
      _unit addweapon _rifle;
      _unit addweapon "NVGoggles";

      _unit addweapon _rucksack;

      [_unit,_riflemag,5] spawn f_addMagToRuck;
      [_unit,_MGmag,8] spawn f_addMagToRuck;

      _unit selectweapon primaryweapon _unit;
     	};
case "ins":
{
      removeallweapons _unit;
      {_unit addmagazine _riflemag} foreach [1,2,3,4,5];
      {_unit addmagazine _MGmag;} foreach [1,2];
      {_unit addmagazine _Grenade} foreach [1,2];
      {_unit addmagazine _bandage} foreach [1,2];
      _unit addweapon _rifle;
      _unit addweapon "NVGoggles";

      _unit addweapon _rucksack;

      [_unit,_riflemag,5] spawn f_addMagToRuck;
      [_unit,_MGmag,8] spawn f_addMagToRuck;

      _unit selectweapon primaryweapon _unit;
     	};
case "cdf":
{
      removeallweapons _unit;
      {_unit addmagazine _riflemag} foreach [1,2,3,4,5];
      {_unit addmagazine _MGmag;} foreach [1,2];
      {_unit addmagazine _Grenade} foreach [1,2];
      {_unit addmagazine _bandage} foreach [1,2];
      _unit addweapon _rifle;
      _unit addweapon "NVGoggles";

      _unit addweapon _rucksack;

      [_unit,_riflemag,5] spawn f_addMagToRuck;
      [_unit,_MGmag,8] spawn f_addMagToRuck;

      _unit selectweapon primaryweapon _unit;
     	};
     };
  };

// ====================================================================================

// LOADOUT: RIFLEMAN

  case "r":
  {
     removeallweapons _unit;
     {_unit addmagazine _riflemag} foreach [1,2,3,4,5,6,7,8];
     {_unit addmagazine _grenade} foreach [1,2];
     {_unit addmagazine _smokegrenade;} foreach [1,2];
     {_unit addmagazine _bandage} foreach [1,2];
     _unit addweapon _rifle;
     _unit addweapon "NVGoggles";

     _unit addweapon _rucksack;

     [_unit,_riflemag,8] spawn f_addMagToRuck;
     [_unit,_grenade,4] spawn f_addMagToRuck; 
     [_unit,_smokegrenade,2] spawn f_addMagToRuck; 

     _unit selectweapon primaryweapon _unit;
  };

// ====================================================================================

// LOADOUT: RIFLEMAN LAW

  case "rat":
  {
     removeallweapons _unit;
     {_unit addmagazine _riflemag} foreach [1,2,3,4,5,6,7,8];
     {_unit addmagazine _atmag} foreach [1];
     {_unit addmagazine _grenade} foreach [1,2];
     {_unit addmagazine _smokegrenade;} foreach [1,2];
     {_unit addmagazine _bandage} foreach [1,2];
     _unit addweapon _at;
     _unit addweapon _rifle;
     _unit addweapon "NVGoggles";

//      _unit addweapon _rucksack;

     _unit selectweapon primaryweapon _unit;
  };

// ====================================================================================

// LOADOUT: GPMG GUNNER

  case "gpmg":
  {
     removeallweapons _unit;
     {_unit addmagazine _mediumMGmag} foreach [1,2,3,4];
     _unit addweapon _mediumMG;
     {_unit addmagazine _bandage} foreach [1,2];
     _unit addweapon "NVGoggles";

     _unit selectweapon primaryweapon _unit;
  };

// ====================================================================================

// LOADOUT: GPMG GUNNER No2

  case "gpmg2":
  {
     removeallweapons _unit;
     {_unit addmagazine _riflemag} foreach [1,2,3,4];
     {_unit addmagazine _bandage} foreach [1,2];
     {_unit addmagazine _grenade} foreach [1,2];
     {_unit addmagazine _smokegrenade;} foreach [1,2];
     {_unit addmagazine _mediumMGmag;} foreach [1,2,3];
     _unit addweapon _rifle;
     _unit addweapon "NVGoggles";

     _unit addweapon _rucksack;

     [_unit,_riflemag,4] spawn f_addMagToRuck;
     [_unit,_mediumMGmag,4] spawn f_addMagToRuck; 

     _unit selectweapon primaryweapon _unit;
  };

// ====================================================================================

// LOADOUT: ARMOUR CREWMAN

  case "crew":
  {
     removeallweapons _unit;
     {_unit addmagazine _riflemag} foreach [1,2,3,4];
     {_unit addmagazine _bandage} foreach [1,2];
     _unit addweapon _crewrifle;  
     _unit addmagazine _smokerescue;
     _unit addweapon "NVGoggles"; 

     _unit selectweapon primaryweapon _unit;
  };

// ====================================================================================

// LOADOUT: HEAVY MG GUNNER

  case "hmgg":
  {
     removeallweapons _unit;
     {_unit addmagazine _riflemag} foreach [1,2,3];
     {_unit addmagazine _bandage} foreach [1,2];
     _unit addweapon _rifle;
     _unit addweapon _heavyMG;
     _unit addweapon "NVGoggles";

     // We add this special case for a more even weight distribution in KORD-based
     // HMG teams.
     if (_faction == "ru") then
     {
       _unit addMagazine _heavyMGmag;
     };

     _unit selectweapon primaryweapon _unit;
  };

// ====================================================================================

// LOADOUT: HEAVY MG GUNNER No2

  case "hmgag":
  {
     removeallweapons _unit;
     {_unit addmagazine _riflemag} foreach [1,2,3,4];
     {_unit addmagazine _bandage} foreach [1,2];
     _unit addweapon _rifle;
     _unit addWeapon _heavyMGtripod;
     _unit addweapon "NVGoggles";

     // M2 boxes are 200rnds and  KORD/DSHKM boxes are 100rnds
     // but the KORD tripod is much heavier than the DSHKM tripod
     // so we have to spread-load ammo in the KORD teams.
     switch (_faction) do
     {
       case "ru": 
       {
           {_unit addMagazine _heavyMGmag} forEach [1,2];
       };
       case "uk_armed_forces": 
       {
           {_unit addMagazine _heavyMGmag} forEach [1,2];
       };

       case "usmc": 
       {
           {_unit addMagazine _heavyMGmag} forEach [1,2];
       };
       default
       {
           {_unit addMagazine _heavyMGmag} forEach [1,2,3];
       };
     };

     _unit selectweapon primaryweapon _unit;
  };

// ====================================================================================

// LOADOUT: AIRCREW

  case "air":
  {
     removeallweapons _unit;
     {_unit addmagazine _riflemag} foreach [1,2,3,4];
     {_unit addmagazine _bandage} foreach [1,2];
     _unit addweapon _acrifle;  
     _unit addmagazine _smokerescue;
     _unit addweapon "NVGoggles"; 

     _unit selectweapon primaryweapon _unit;
  };

// ====================================================================================

// LOADOUT: CARL GUSTAV GUNNER

  case "matg":
  {
     removeallweapons _unit;
     {_unit addmagazine _mediumATmag1;} foreach [1,2,3];

     if (_faction == "uk_armed_forces") then
     {
       {_unit addMagazine "ACE_SMAW_Spotting"} forEach [1,2];
     };

     if (_faction == "usmc") then
     {
       {_unit addMagazine "ACE_SMAW_Spotting"} forEach [1,2];
     };

     _unit addweapon _mediumAT;
     {_unit addmagazine _riflemag} foreach [1,2,3];
     {_unit addmagazine _bandage} foreach [1,2];
     _unit addweapon _rifle;
     _unit addweapon "NVGoggles";
  };

// ====================================================================================

// LOADOUT: CARL GUSTAV GUNNER No2

  case "matag":
  {
     removeallweapons _unit;
     {_unit addmagazine _riflemag} foreach [1,2,3,4];
     {_unit addmagazine _mediumATmag1;} foreach [1,2];

     {_unit addmagazine _bandage} foreach [1,2];
     _unit addmagazine _btty;
     _unit addweapon _rifle;
     _unit addweapon _ldes;
     _unit addweapon "NVGoggles";

     _unit addweapon _rucksack;

     [_unit,_riflemag,4] spawn f_addMagToRuck;
     [_unit,_mediumATmag1,1] spawn f_addMagToRuck; 
     [_unit,_mediumATmag2,1] spawn f_addMagToRuck; 

     _unit selectweapon primaryweapon _unit; 
  };

// ====================================================================================

// LOADOUT: MEDIUM AT AMMO MAN

  case "matam":
  {
     removeallweapons _unit;
     {_unit addmagazine _riflemag} foreach [1,2,3,4,5];
     {_unit addmagazine _bandage} foreach [1,2];
     _unit addweapon _rifle;
     _unit addweapon "NVGoggles";

     _unit addweapon _rucksack;

     [_unit,_riflemag,5] spawn f_addMagToRuck;
     [_unit,_mediumATmag1,1] spawn f_addMagToRuck; 
     [_unit,_mediumATmag2,1] spawn f_addMagToRuck; 

     _unit selectweapon primaryweapon _unit;
  };

// ====================================================================================

// LOADOUT: JAVELIN GUNNER

  case "hatg":
  {
     removeallweapons _unit;
     {_unit addmagazine _riflemag} foreach [1,2,3,4];
     {_unit addmagazine _heavyATmag1;} foreach [1];
     {_unit addmagazine _bandage} foreach [1,2];
     _unit addweapon _heavyAT;
     _unit addweapon _rifle;
     _unit addweapon "NVGoggles";
  };

// ====================================================================================

// LOADOUT: JAVELIN GUNNER No2

  case "hatag":
  {
     removeallweapons _unit;
     {_unit addmagazine _riflemag} foreach [1,2,3,4];
     {_unit addmagazine _heavyATmag1;} foreach [1];
     {_unit addmagazine _bandage} foreach [1,2];
     _unit addweapon _rifle;
     _unit addweapon "NVGoggles";

     _unit addweapon _rucksack;

     [_unit,_riflemag,4] spawn f_addMagToRuck;
     [_unit,_heavyATmag1,2] spawn f_addMagToRuck;

     _unit selectweapon primaryweapon _unit; 
  };

// ====================================================================================

// LOADOUT: HEAVY AT AMMO MAN

  case "hatam":
  {
     removeallweapons _unit;
     {_unit addmagazine _riflemag} foreach [1,2,3,4,5];
     {_unit addmagazine _heavyATmag2;} foreach [1];
     {_unit addmagazine _bandage} foreach [1,2];
     _unit addweapon _rifle;
     _unit addweapon "NVGoggles";

     _unit addweapon _rucksack;

     [_unit,_riflemag,5] spawn f_addMagToRuck; 

     _unit selectweapon primaryweapon _unit;
  };

// ====================================================================================

// LOADOUT: SNIPER

  case "sn":
  {
     removeallweapons _unit;
     {_unit addmagazine _snmag} foreach [1,2,3,4,5,6,7,8];
     {_unit addmagazine _bandage} foreach [1,2];
     _unit addweapon _snrifle;
     _unit addweapon "Binocular";
     _unit addweapon "NVGoggles";

//      _unit addweapon _rucksack;

     _unit selectweapon primaryweapon _unit; 
  };

// ====================================================================================

// LOADOUT: SPOTTER

  case "sp":
  {
     removeallweapons _unit;
     {_unit addmagazine _spmag} foreach [1,2,3,4,5,6];
     {_unit addmagazine _snmag} foreach [1,2,3,4,5];
     {_unit addmagazine _bandage} foreach [1,2];
     _unit addweapon _sprifle;
     _unit addmagazine "Laserbatteries";
     _unit addweapon "Laserdesignator";
     _unit addweapon "NVGoggles";
     if (!(_unit hasWeapon "ACE_Kestrel4500")) then
     {
       _unit addweapon "ACE_Kestrel4500";
     };

     _unit selectweapon primaryweapon _unit; 
  };

// ====================================================================================

// LOADOUT: MILITIAMAN

  case "mil":
  {
     removeallweapons _unit;
     {_unit addmagazine _oldmag} foreach [1,2,3,4,5,6,7,8];
     {_unit addmagazine _bandage} foreach [1,2];
     _unit addweapon _oldrifle;

//      _unit addweapon _rucksack;

     _unit selectweapon primaryweapon _unit; 
  };

// ====================================================================================

// ERROR CHECKING
// If the unit type could not be successfully detected the script exits with an error.

  default
  {
  if (true) exitwith {player globalchat format ["DEBUG (f\common\@ShackTac_assignGear.sqf): Unit = %1. Gear template %2 does not exist.",_unit,_typeofunit]};
  };
};

Edited by Rellikki

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×