ShackTactical Assign Gear Script

From F2 EN

Jump to: navigation, search

Contents

Description

Changing the gear for different unit types within a ShackTac platoon can become very time consuming if using commands entered directly into the INIT field of each unit (in the editor). The ShackTactical Assign Gear Script provides an easy way to quickly and easily assign the correct gear for all the standard roles in a ShackTac platoon (and attachments), from platoon commander to rifleman.


Required files

All the code associated with this component is found in:

  • f\common\@ShackTac_assignGear.sqf

How to use

Calling the script

To call the script for a unit you must edit its INIT line in the editor to include the following code:

nul = ["pltco",this] execVM "f\common\@ShackTac_assignGear.sqf";

Note that the precise code will change depending on the type of role you want the unit to play; so in the example above the unit has been defined as a platoon commander, but if you wanted the unit to be a rifleman the code would be:

nul = ["r",this] execVM "f\common\@ShackTac_assignGear.sqf";

For a full set of available roles and corresponding code please see the table below.

Available unit types

By default, the following unit types are available:

Unit TypeCode
Platoon Commandernul = ["pltco",this] execVM "f\common\@ShackTac_assignGear.sqf";
Platoon Sgt.nul = ["pltsgt",this] execVM "f\common\@ShackTac_assignGear.sqf";
Platoon Medicnul = ["pltm",this] execVM "f\common\@ShackTac_assignGear.sqf";
Platoon HQ Riflemannul = ["pltr",this] execVM "f\common\@ShackTac_assignGear.sqf";
Squad Leadernul = ["sl",this] execVM "f\common\@ShackTac_assignGear.sqf";
Medic/Corpsmannul = ["m",this] execVM "f\common\@ShackTac_assignGear.sqf";
Fireteam Leadernul = ["ftl",this] execVM "f\common\@ShackTac_assignGear.sqf";
Automatic Riflemannul = ["ar",this] execVM "f\common\@ShackTac_assignGear.sqf";
Assistant Automatic Riflemannul = ["aar",this] execVM "f\common\@ShackTac_assignGear.sqf";
Rifleman (AT)nul = ["rat",this] execVM "f\common\@ShackTac_assignGear.sqf";
Riflemannul = ["r",this] execVM "f\common\@ShackTac_assignGear.sqf";
Medium MG Gunnernul = ["mmgg",this] execVM "f\common\@ShackTac_assignGear.sqf";
Medium MG Assistant Gunnernul = ["mmgag",this] execVM "f\common\@ShackTac_assignGear.sqf";
Medium MG Ammo Mannul = ["mmgam",this] execVM "f\common\@ShackTac_assignGear.sqf";
Medium AT Gunnernul = ["matg",this] execVM "f\common\@ShackTac_assignGear.sqf";
Medium AT Assistant Gunnernul = ["matag",this] execVM "f\common\@ShackTac_assignGear.sqf";
Medium AT Ammo Mannul = ["matam",this] execVM "f\common\@ShackTac_assignGear.sqf";
Heavy AT Gunnernul = ["hatg",this] execVM "f\common\@ShackTac_assignGear.sqf";
Heavy AT Assistant Gunnernul = ["hatag",this] execVM "f\common\@ShackTac_assignGear.sqf";
Heavy AT Ammo Mannul = ["hatam",this] execVM "f\common\@ShackTac_assignGear.sqf";
Snipernul = ["sn",this] execVM "f\common\@ShackTac_assignGear.sqf";
Spotternul = ["sp",this] execVM "f\common\@ShackTac_assignGear.sqf";

Changing faction equipment

The equipment and weapons for each faction are defined in a series of variables contained near the start of the file f\common\@ShackTac_assignGear.sqf. For example, to change the equipment and weapons for USMC units open the file and look for the line:

// EQUIPMENT: USMC

In the block of code beneath simply change the values of variable such as _rifle or _rifleGL. For example, to change the standard rifle from an M16A4 to an AK74, edit the following line:

_rifle = "M16A4";

Change it to:

_rifle = "AK_74";

Changing a unit type loadout

The equipment and weapons for each faction are defined using blocks of code in the file f\common\@ShackTac_assignGear.sqf. For example, to change the equipment and weapons for a sniper open the file and look for the line:

// LOADOUT: SNIPER

In the block of code beneath simply change the variable used with the addweapon and addmagazine commands. For example, to replace a sniper's rifle with the standard rifle for that faction, edit the following lines:

{_unit addmagazine _snmag} foreach [1,2,3,4,5];
_unit addweapon _snrifle;

Change them to:

{_unit addmagazine _riflemag} foreach [1,2,3,4,5,6,7];
_unit addweapon _rifle;

Tips

  • All the standard ShackTac platoons (and attachments) pre-placed in the mission.sqm file included in F2 already have the appropriate calls in the INIT lines of every unit.
  • By default the script has been edited to provide Western weapons and equipment to USMC units, and Soviet Bloc weapons and equipment to all remaining factions.

How to disable

In the editor, edit each unit's INIT to remove the following code:

nul = ["pltco",this] execVM "f\common\@ShackTac_assignGear.sqf";

Note: The string "pltco" in the example above will change (see table above).

Credits

  • kevb0
  • Wolf
  • Dslyecxi
  • Fer
Personal tools