-
Notifications
You must be signed in to change notification settings - Fork 23
Configuring loadouts
The "main" loadout file to look at is the "CfgLoadouts.hpp" In this file you can:
- Turn on magnified optics:
allowMagnifiedOptics = 1; // 0 is off
- Turn on vehicle inventories:
setVehicleLoadouts = -1; // 0 is vanilla, 1 is using the vehicle loadout script
- Turn off the "fallback" class
useFallback = 0; // 1 is on
- Most importantly, see which loadouts are active.
#include "Loadouts\blu_us_m4_ucp.hpp" // (Active) US: M4 - Gray/Green
// #include "Loadouts\blu_us_m4_ocp.hpp" // (Inactive) US: M4 - Tan
IF THE ACTIVE FILES DON'T EXIST, THE MISSION WILL CRASH THE SERVER ON MISSION LOAD
Note: the "common" loadout file has a bunch of common defines/helper macros that allow us to reduce duplication in each of the sub loadout files. Here you can change medical supplies, change leader tools, and change the base soldier level tools.
The "sub" loadout files are in the "Loadouts" folder. Each file has the following naming convention: faction_country_mainWeapon_camoPattern.hpp. These files start with the faction as the opening class name, inside this class you can define vehicle inventories, and then each sub class name is the name of the unit. Each unit class name can have the following attributes:
-
uniform[] = {"uniform_class_name"};
Randomly selects a uniform from the array to apply to the unit -
vest[] = {"vest_class_name"};
Randomly selects a vest from the array to apply to the unit -
headgear[] = {"helmet_class_name"};
Randomly selects a helmet/hat from the array to apply to the unit -
backpack[] = {"backpack_class_name"};
Randomly selects a backpack from the array to apply to the unit -
backpackItems[] = {"item_class_name:number_of_items"};
Add all the items in this array to the backpack, if there's no space left, it will try to add it to the unit's general inventory -
weapons[] = {"rifle_class_name"};
Randomly selects a rifle from the array to apply to the unit -
magazines[] = {"magazing_class_name:number_of_mags","grenade_class_name:number_of_grenades"};
Adds magazines/grenades to a unit -
items[] = {"item_class_name:number_of_items"};
Adds all the items from the array to the unit -
linkedItems[] = {"linked_item_class_name"};
Adds all the linked items in the array to the unit (nvgs, gps, compass, etc) -
attachments[] = {"weapon_attachment_class_name"};
Tries to add all the attachments to the main weapon/pistol. Not random, if there's two scopes, it will only add the last scope. -
launchers[] = {"launcher_class_name"};
Randomly selects a launcher from the array to add to the unit -
secondaryAttachments[] = {"launcher_attachment_class_name"};
Tries to add all the attachments to the launcher. Not random, if there's two scopes, it will only add the last scope.
"But AACO" you say, "Most of these sub classes don't have the above attributes". Well there's two reasons for that. One, the class may not have/need the attribute (your rifleman doesn't need a launcher). Second:
Class inheritance is the main way we try to keep things DRY. If you look at some classes you'll see they'll have a colon after the class name, followed by a different class name. For example: B_Soldier_TL_F: B_Soldier_F
this means, the "B_Soldier_TL_F" class (FTL) inherits all the attributes from the "B_Soldier_F" class (Rifleman). To override an inherited attribute, just redefine it. For example: vest[] = {"ftl_vest_class_name"};
. To just add an item to an attribute, use the "+=" operator. For example: items[] += {"ftl_item_class_name"};
.
The other way we try to reduce repetition is by using #define
for weapons, so changing it one place will change it in the rest of the file. At the top of the loadout file, as well as in the "common" file you will see a decently large list of #define
s. Just replace the class names with what you want, and boom, you have a custom loadout.
At the end of the unit sub-classes, you'll see a "fallback" class. If useFallback
in CfgLoadouts.hpp is enabled, this is the loadout applied to any units not defined in the loadout file.
Above we got the technical setup, this second will go over the steps to customize a loadout.
- Open up a loadout file in any text editor, and open up a new blank file in any text editor.
- Loadup A3 and go to the arsenal.
- Setup a rifleman for the loadout you want
- Add whatever uniform you want
- Add whatever vest you want
- Add whatever helmet/hat you want
- Add whatever backpack you want (and that can hold all your gear)
- Add and configure whatever base rifle you want
- Add at least one "normal" magazine
- Add at least one "tracer" magazine
- Export the loadout to your clipboard
- Paste the loadout into the blank text document
- Pull the rifle/magazines from the arsenal export and insert them into the appropriate defines.
- Get the uniform/vest/head gear/backpack and put them into the correct attributes in the rifleman class.
- Rinse/repeat for the base carbine man, the AR and any specialist units you want configured.
- Test and make sure the loadouts are correct and configured how you wanted.