Folk Assign Gear Script
From F2 EN
Contents |
Description
Changing the gear for different unit types within a Folk platoon can become very time consuming if using commands entered directly into the INIT field of each unit (in the editor). The Folk Assign Gear Script provides an easy way to quickly and easily assign the correct gear for all the standard roles in a Folk platoon (and attachments), from commander to rifleman.
Required files
All the code associated with this component is found in:
- init.sqf.folk
- f\common\folk_assignGear.sqf
- f\common\f_addMagToRuck.sqf
- f\common\f_addWepToRuck.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 = ["co",this] execVM "f\common\folk_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 commander, but if you wanted the unit to be a fireteam leader the code would be:
nul = ["ftl",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 Type | Code |
|---|---|
| Commander | nul = ["co",this] execVM "f\common\folk_assignGear.sqf"; |
| Deputy Commander | nul = ["dc",this] execVM "f\common\folk_assignGear.sqf"; |
| Medic | nul = ["m",this] execVM "f\common\folk_assignGear.sqf"; |
| Fireteam Leader | nul = ["ftl",this] execVM "f\common\folk_assignGear.sqf"; |
| Automatic Rifleman | nul = ["ar",this] execVM "f\common\folk_assignGear.sqf"; |
| Assistant Automatic Rifleman | nul = ["aar",this] execVM "f\common\folk_assignGear.sqf"; |
| Rifleman (RPG) | nul = ["rrpg",this] execVM "f\common\folk_assignGear.sqf"; |
| Medium MG Gunner | nul = ["mmgg",this] execVM "f\common\folk_assignGear.sqf"; |
| Medium MG Assistant Gunner | nul = ["mmgag",this] execVM "f\common\folk_assignGear.sqf"; |
| Medium AT Gunner | nul = ["matg",this] execVM "f\common\folk_assignGear.sqf"; |
| Medium AT Assistant Gunner | nul = ["matag",this] execVM "f\common\folk_assignGear.sqf"; |
| Sniper | nul = ["sn",this] execVM "f\common\folk_assignGear.sqf"; |
| Spotter | nul = ["sp",this] execVM "f\common\folk_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\folk_assignGear.sqf. For example, to change the equipment and weapons for NAPA units open the file and look for the line:
// EQUIPMENT: NAPA
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 AK74 to an M16A4, edit the following line:
_rifle = "AK_74";
Change it to:
_rifle = "M16A4";
Changing a unit type loadout
The equipment and weapons for each faction are defined using blocks of code in the file f\common\folk_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 Folk platoons (and attachments) pre-placed in Folk Platoons already have the appropriate calls in the INIT lines of every unit.
How to disable
In the editor, edit each unit's INIT to remove the following code:
nul = ["co",this] execVM "f\common\folk_assignGear.sqf";
Note: The string "co" in the example above will change (see table above).
Credits
- (kungtotte)
- (Macolik)
- (Redkid)
- (Henk)
- (kevb0)
- (Wolf)
- (Dslyecxi)
- Fer
