broma-arma / BromA-Framework-A3-Addon

The addon version of the BromA Framework for ArmA 3.
5 stars 9 forks source link

Loadout System Discussion #165

Closed Coryf88 closed 1 week ago

Coryf88 commented 3 years ago

I've been working on the loadout system, with current focus on cleaning up the functions and adding support for weapon attachments.

Attachment System

History

There are bits of the attachment system that Nife was working on: https://github.com/Neefay/BromA-Framework-A3-Addon/blob/07926ec988c0fed2a0161be26d4615d32b256d9f/loadouts/includes/private-variables.sqf#L101 https://github.com/Neefay/BromA-Framework-A3-Addon/blob/07926ec988c0fed2a0161be26d4615d32b256d9f/loadouts/includes/private-variables.sqf#L110-L113

BRM_FMK_fnc_addWeaponAttachments example:

_commonRifleAttachments = [["ccoAttachment"], ["rcoAttachment"], ["railAttachment"], ["", "bipodAttachment"]];
[_unit, "primary", _commonRifleAttachments, [CCO, BIPOD]] call BRM_FMK_fnc_addWeaponAttachments;

Issues

Would rely on the structure to determine what attachments are applied, which kind of defeats the purpose of it.

Plans

So, after way too long of contemplating about it, I've came up with a better option...

https://github.com/Neefay/BromA-Framework-A3-Addon/blob/07926ec988c0fed2a0161be26d4615d32b256d9f/loadouts/factions/nato.sqf#L33-L42 would be changed to something like:

_commonPrimary = _rr;
_grenadierPrimary = _rg;
_commonPistol = _P07;
_autoriflemanPrimary = _rm;
_mmgPrimary = _SPMGBlack;
_marksmanPrimary = _rk;
_sniperPrimary = _M200;
_commonLauncher = _PCML;
_riflemanatLauncher = _PCML;
_crewPrimary = _rc;

This would allow loadouts to specify a weapon for a role. Default being the _common*, depending on the structure. E.g. If Officer should get a primary weapon other than _commonPrimary, one could add: _officerPrimary = _specialOfficerWeapon;

With attachments using a similar setup:

_commonPrimaryAttachments = ["", "", "rail", ""];
_grenadierPrimaryAttachments = ["", "", "rail", ""];
_autoriflemanPrimaryAttachments = ["", "muzzle", "", "bipod"];
_mmgPrimaryAttachments = ["optic", "muzzle", "", "bipod"];
_marksmanPrimaryAttachments = ["optic", "muzzle", "", "bipod"];
_sniperPrimaryAttachments = ["optic", "muzzle", "rail", "bipod"];

_squadleaderPrimaryAttachments = ["optic", "", "", ""]; // Squad leader gets an "optic" on their _commonPrimary weapon, but no "rail".

RFC

Thoughts, concerns, etc.?

Royallle commented 3 years ago

that would pretty good, that way we could the determine the attachments for each class, instead of just relying on _commonCCO _commonRCO, for example in the Chedaki loadout the SVD has to use the same RCO scope as the other classes but the gun doesn't support it, so that would fix that issue.

Coryf88 commented 3 years ago

Structures

Structures could potentially be replaced entirely with a similar setup.

Helmets, uniforms, and vests are already defined similarly and could be converted to this new system. https://github.com/Neefay/BromA-Framework-A3-Addon/blob/07926ec988c0fed2a0161be26d4615d32b256d9f/loadouts/factions/nato.sqf#L94-L127

Everything else could be modified to it.

_commonRadio = "TFAR_rf7800str";
_officerRadio = "TFAR_anprc152";
_squadleaderRadio = _officerRadio;
_teamleaderRadio = _officerRadio;
_reconleaderRadio = _officerRadio;
HeroesMaker commented 3 years ago

crewman, heli and jet pilot could use a vest. if their vehicles are shot down they just become combat innefective and can barely defend themselves, that way if they have a vest they could carry enough medical supplies and ammo to hold a position waiting for infantry to save them

Coryf88 commented 3 years ago

crewman, heli and jet pilot could use a vest.

That would be a loadout issue, which would better fit in issue #35. This issue is for discussing the loadout system itself.

Structures could potentially be replaced entirely with a similar setup.

NATO structureless example

HeroesMaker commented 3 years ago

fuck i'm dumb

Structures could potentially be replaced entirely with a similar setup.

NATO structureless example

that's sounds like a great way to allow for more customization without having to make a different structure for each factions. wouldn't it be better to actually use the current structure system rather than the one you are proposing ? if we have to create a specific line for each role that would be a mess compared to just using brackets imo.

Coryf88 commented 3 years ago

What do you mean? Like a Unit Loadout Array for each unit type?

HeroesMaker commented 3 years ago

Exactly, i've forgot what it was called. But if the system you are creating is actually easier to use and especially to maintain when it need an update then i guess we can forget about the Loadout Array.

Coryf88 commented 3 years ago

wouldn't it be better to actually use the current structure system

Well, the purpose of it is... "to allow for more customization without having to make a different structure for each factions.". 😕

if we have to create a specific line for each role

Only the changes from the _common* variables need to be specified.

Unit Loadout Array

Would allow easily editing of them in-game with the arsenal. Though, directly supporting the arsenal would mean the loadouts would have to be hardcoded, so couldn't use variables or functions in them. The loadouts would also need the full array for each unit type.

easier to use and especially to maintain

Ease of use would vary per person and situation. Maintainability wouldn't really change much for any variation, since can easily find and replace the class names of what's changed in them.

HeroesMaker commented 3 years ago

ok i see, i was just a bit puzzled by it at first but after thinking about it some more i don't mind it much.

Coryf88 commented 1 week ago

Moving to discussions #207.