Skip to content

DEV Faction Creators Guide

Saveliy Tronza edited this page Aug 21, 2020 · 2 revisions

Look at existing factions in Templates\Factions for examples, it should be fairly clear.
The basic premise is that there are a number of categories and subcategories (cat and subcat) of items, some of which are required, some of which are optional (depending on the faction type, police/military/civilian).
Making a new faction involves specifying what actual items (either class names or custom load outs) should be used for each cat/subcat. e.g. In the AAF 2035 faction, for the T_INF category, T_INF_rifleman subcategory, I_soldier_F is the class name to use.

Loadouts for infantry

When the existing classnames don't satisfy your needs you can instead specify a loadout. This is just a file containing sqf that will setup a unit as you want. The simplest way to do this is to export it from the Virtual or ACE Arsenal.

Loadouts for vehicles

This feature is available since version 0.51. Vehicle loadouts are added same way as infantry loadouts.

Vehicle loadout file has following format:

[
    // Initial vehicle class name
    "ClassName",

    // This code will be called upon vehicle construction
    {
        params ["_veh"];
        // You can do customization of _veh here
    }
]

Example of a vehicle loadout file:

[
    "I_G_Offroad_01_F",
    {
        params ["_veh"];
        [
            _veh,
            ["Green",1], 
            ["HideDoor1",0,"HideDoor2",0,"HideDoor3",0,"HideBackpacks",0,"HideBumper1",0,"HideBumper2",1,"HideConstruction",0,"hidePolice",1,"HideServices",1,"BeaconsStart",0,"BeaconsServicesStart",0]
        ] call BIS_fnc_initVehicle;
    }
]

Useful links

Please study parameters of BIS_fnc_initVehicle. You can implement randomizations with it as well.

Exporting customization from Virtual Garage

Don't copy whole exported code from Virtual Garage into the vehicle loadout file! By default it also exports a line such as _veh = createVehicle ["C_Offroad_01_F",position player,[],0,"NONE"];. You don't need it! You must remove it manually. You should also remove the comments exported by Virtual Garage.

Requirements

  • A workshop collection of the required mods for your faction, including dependencies -- players should be able to use your faction with just the contents of the collection, Vindicta, CBA and ACE.
  • Correct and complete add-on list, including dependencies.

Don't

  • Don't change the T_NAME after your faction is accepted -- this will break existing saves
  • Don't remove or re-name load outs -- this will break existing saves
  • Don't randomize anything except quantities in loadouts for police or military factions (this will cause some items to not spawn)
  • Don't include different implementations of the same exact real world item -- e.g. the same rifle from two different mods

Do

  • Do prefer inbuilt class over load out, all other things being equal -- this means less code to maintain
  • Do minimize the number of mods required, all other things being equal