Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added equipment tag to allow specialization of equipment #1152

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

AndreasBrostrom
Copy link
Member

@AndreasBrostrom AndreasBrostrom commented Mar 29, 2024

When merged this pull request will:

  • Added a equipment tag system
    • System allow specialized equipment per classname
    • The system have auto category system as well
      globaly (common), side (common<side>), company (common<side>Company<company>) and platoon (Common<side>Company<company><platoon>).
    • The system allow for tags refereing tags allow for item collections t o be referenced.
  • Moved arsenal under its own function folder for easier handling

Note

This contians changes to the `description.ext´
It contains a addition of a include:

#include "cScripts\CfgEquipmentTags.hpp

@AndreasBrostrom AndreasBrostrom added this to the 4.5.16 milestone Apr 1, 2024
@AndreasBrostrom AndreasBrostrom added the T-Enhancement Type: General enhancement, improvments, change or addition to scripts label Apr 1, 2024
Copy link
Collaborator

@pool011 pool011 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have to straighten out the first few roles we have added. Then we can work on adding the "sidearm" tag for people who are authorized to carry a sidearm but don't have one equipped by default.

cScripts/Loadouts/CfgLoadouts_Common.hpp Outdated Show resolved Hide resolved
cScripts/Loadouts/CfgLoadouts_Bravo_Atlas.hpp Outdated Show resolved Hide resolved
cScripts/Loadouts/CfgLoadouts_Bravo_Viking.hpp Outdated Show resolved Hide resolved
cScripts/Loadouts/CfgLoadouts_Bravo_Viking.hpp Outdated Show resolved Hide resolved
cScripts/Loadouts/CfgLoadouts_Charlie_Squad.hpp Outdated Show resolved Hide resolved
pool011

This comment was marked as resolved.

@AndreasBrostrom AndreasBrostrom force-pushed the EquipmentTag branch 2 times, most recently from 1990a11 to 8324264 Compare April 7, 2024 08:17
@pool011 pool011 modified the milestones: 4.5.15, 4.5.16 Apr 7, 2024
@AndreasBrostrom
Copy link
Member Author

AndreasBrostrom commented Apr 7, 2024

Wiki Article: Gear.md

cScripts Gear are our loadout script strongly inspired and taken from Poppy, our old loadout script. The gear system is rewritten and is greatly tailored to our community needs and have a extra simplification added to it. The loadout utilized a loadout array obtained from ace export loadout or the bis getUnitLoadout script command. The config also for customizing and can handle abilities and unit cosmetics such as rank and insignia.

Loadouts

Loadouts are automatically applied to units on spawn based on the variable, variableName, classname or side. Loadouts are also saved when altered (See below). Loadouts using Public scope (See below) in the config will also be present in loadout selectors such as ACE Arsenal default loadouts and [[staging]] and [[starter crate]] selectors.

Loadout Saving

When you alter your loadout it automatically get saved and reapplied on respawn. The save event is run when you alter the loadout in arsenal or when you close your inventory and only happens when your inside of a defined [[Staging Zone|staging zone]]. All gear related functions will honer the saved loadout. Permissions are also kept based on the core loadout used before the save was committed.

How to gear up

The gear system is quite simple it utilized config values to obtain and apply your loadout.
Loadouts are defined in the CfgLoadouts.hpp. The system allow loadout application for any side and unit and are inherited from parent classnames.
In order to make loadout for a side can setup a Common<Blufor|Opfor|Independant|Civilian> baseclass an example for Bluefor side can be found below.

class CommonBlufor {};
class My_Loadout: CommonBlufor {
    regiment = "";
    company = "";
    platoon = -1;
    squad = -1;
    team = "";

    displayName = "";
    scope = 0;
    category[] = {};
    loadout = [[],[],[],[],[],[],"","",[],["","","","","",""]];
    equipmentTags[] = {};

    icon = "";
    insignia = "";

    abilityMedic = 0;
    abilityEngineer = 0;
    abilityEOD = 0;

    preLoadout = "";
    postLoadout = "";
};

Config Properties

class CommonBlufor {};
class My_Loadout: CommonBlufor {
    regiment = "";          // Style value
    company = "";           // Used for arsenal whitelist based on side as well as gives your company callsign
    platoon = -1;           // Used for arsenal whitelist based on side as well as gives your platoon callsign
    squad = -1;             // Used for arsenal whitelist based on side as well as gives your squad callsign
    team = "";              // Used for auto assign unit to a fire team color.

    displayName = "";       // Used to make the selection label
    scope = 0;              // 0 private: not obtainable. 1 protected: can be used but not selected. 2 public: can be selected and used
    category[] = {};        // Hardcoded category paths found in ".\cScripts\CavFnc\functions\systems\fn_setupLoadoutCategories.sqf"
    loadout = [[],[],[],[],[],[],"","",[],["","","","","",""]]; // loadout array none quoted warped
    equipmentTags[] = {};   // Equipment tags

    icon = "";              // Style value (use classname of a unit icon)
    insignia = "";          // Style value (use classname of a insignia)

    abilityMedic = 0;       // 0 Nothing, 1 Medic, 2 Doctor
    abilityEngineer = 0;    // 0 Nothing, 1 Repair Specialists, 2 Engineer
    abilityEOD = 0;         // 0 Nothing, 1 EOD Specialist

    preLoadout = "";        // code that gets applied before loadout and abilities are applied
    postLoadout = "";       // code that gets applied after loadout and abilities are applied
};

Simple loadout exsample

class CommonBlufor {};
class My_Rifleman_Local: CommonBlufor {
    displayName = "Rifleman";
    scope = 2;
    loadout = [[],[],[],[],[],[],"","",[],["","","","","",""]];
    equipmentTags[] = {"BasicSoldierEquipment"};
};
class My_TeamLeader_Local: My_Rifleman_Local {
    displayName = "Team Leader";
    loadout = [[],[],[],[],[],[],"","",[],["","","","","",""]];
    equipmentTags[] += {"TeamLeaderEquipment"};
};
class My_SquadLeader_Local: My_TeamLeader_Local {
    displayName = "Squad Leader";
    loadout = [[],[],[],[],[],[],"","",[],["","","","","",""]];
    equipmentTags[] += {"SquadLeaderEquipment"};
};
class My_SpecialSoldier_Local: CommonBlufor {
    displayName = "Engineer";
    scope = 2;
    abilityEngineer = 2;
    loadout = [[],[],[],[],[],[],"","",[],["","","","","",""]];
    equipmentTags[] = {"BasicSoldierEquipment", "EngineerEquipment"};
};

Loadout applications

Loadouts can be applied in several ways. The main system used is the classname based system but it can also apply to units using variableName, setVariable or side. The loadout also need to be public or protected scope to be automatically applied, public to be select it via a selector.

this setVariable ["cScripts_Gear_LoadoutClass", "Cav_B_C_Rifleman_F"];

Keep spawn Loadout

You can keep the EDEN selected loadout by adding the following variable to a player unit:

this setVariable ["cScripts_Gear_LoadoutClass", "default"];

In our current setup of our loadouts default is not defined. This means it will not be applied. A warning of this will be shown in Eden SP and Eden MP.

Arsenal

The arsenal is built automatically when opening the staging variant of the arsenal and utilizes side, company, weapon system and equipmentTags to construct the whitelist.

Equipment Tags

Equipment tags are defined in CfgEquipmentTags.hpp and called from a loadout using the equipmentTags[] array in a CfgLoadouts.hpp.
The system have some magic collections starting with common. There are 3 difrent variants side, company, and platoon. The global tag collection common is always applied to all soldiers. The side based tags are declared by adding the corresponding side; common<Blufor|Opfor|Independant|Civilian>. Companies are defined as common<Side>Company<CompanyName>. While platoons have the given platoon number common<Side>Company<CompanyName><PlatoonNumber>.
It is also possible to make your own equipmentTags by adding a new config entrys (Example: my_custom_equipment_tag[] = {};).

The system can also auto detect weapons (primary, pistols and launchers) to this in order to automatically provide you with variants and basic items the system uses a prefix followed by the top baseclass of weapon variant. class_<allowed_weapon_baseclass_variant>.

class CfgEquipmentTags {
    common[] = {"G_Aviator"};
    commonBlufor[] = {
        "rhs_weap_mk18_KAC_bk",
        "rhs_weap_mk18_KAC",
        "rhs_mag_30Rnd_556x45_M855A1_PMAG_Tracer_Red"
    };
    commonBluforCompanyCharlie[] = {"ace_banana"};

    class_rhs_weap_m4a1[] = {
        "rhs_weap_m4a1",
        "rhs_weap_m4a1_carryhandle"
    };
};

The tag system allow you to make collection and groups of items and you can also reference this collections from other tags by adding their name to the tag.

class CfgEquipmentTags {
    collection_all_rifles[] = {
        "class_rhs_weap_m4a1",
        "class_rhs_weap_m16a4",
        "collection_rifle_magazines"
    };
    class_rhs_weap_m4a1[] = {
        "rhs_weap_m4a1",
        "rhs_weap_m4a1_carryhandle"
    };
    class_rhs_weap_m16a4[] = {
        "rhs_weap_m16a4",
        "rhs_weap_m16a4_carryhandle"
    };
    collection_rifle_magazines[] = {
        "rhs_mag_30Rnd_556x45_M855A1_PMAG",
        "rhs_mag_30Rnd_556x45_M855A1_PMAG_Tracer_Red"
    };
};

See Also

  • [[Staging Zone]]
  • [[Starter Crate]]

@pool011 pool011 modified the milestones: 4.5.16, 4.5.17 Apr 8, 2024
@AndreasBrostrom AndreasBrostrom force-pushed the EquipmentTag branch 5 times, most recently from 70cfd27 to af7f9ee Compare April 9, 2024 12:58
@AndreasBrostrom AndreasBrostrom modified the milestones: 4.5.17, 4.5.18 Apr 18, 2024
@AndreasBrostrom AndreasBrostrom force-pushed the EquipmentTag branch 3 times, most recently from 272fc6d to 3d1cf12 Compare April 24, 2024 09:54
@AndreasBrostrom AndreasBrostrom modified the milestones: 4.5.18, 4.5.19 Apr 29, 2024
@AndreasBrostrom AndreasBrostrom added this to the 4.5.20 milestone Apr 30, 2024
@AndreasBrostrom AndreasBrostrom modified the milestones: 4.5.20, 4.5.21 Jul 20, 2024
@AndreasBrostrom AndreasBrostrom modified the milestones: 4.5.21, 4.5.22 Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Enhancement Type: General enhancement, improvments, change or addition to scripts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants