Feature #11417
Magazine-Weapon Interface config class
| Status: | Assigned | Start: | 2010-06-22 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assigned to: | - | % Done: | 0% |
|
| Category: | Config | |||
| Target version: | - | |||
| Operating system: | Mainboard chipset: | |||
| Graphics card: | System RAM size: | |||
| Graphics card driver version: | GPU VRAM size: | |||
| Affected ArmA II version: | Please select... | Audio card: | Please specify! | |
| Maxmem parameter: | Not set | Size of OS swap file: | Please specify! | |
| Difficulty: | Not set | I am using some Mods: | No | |
| Reproduced by another DH user: | No | I am using: | ||
| CPU: | Please specify! | Reproducible for you: | No | |
| Votes: | 16 |
Description
Currently, weapon-magazine compatability is determined by specific magazine classnames defined in the weapon. This means you must know when preparing a weapon config which magazines are available to use. If you add more magazines later you have to update the weapon. This makes addon compatability difficult/impossible.
This feature proposes a solution by introducing a new class: CfgMagazineInterfaces.
Each magazine would be defined to use a defined interface. Then, you define the weapons to use those same interfaces. Here's an example of what it might look like:
class CfgMagazineInterfaces {
class 556_STANAG_Interface {
};
};
class CfgWeapons {
class M16 {
magazineInterfaces[] = {"556_STANAG_Interface"};
};
};
class CfgMagazines {
class 30Rnd_556x45_STANAG {
magazineInterface = "556_STANAG_Interface";
};
};
So, if I create a new magazine that uses the 556_STANAG_Interface, then M16 will be able to load that magazine without modifying the config for the M16. Also, in my example, I allowed weapons to use multiple interfaces. That means that the weapon can load magazines from any of those interfaces. This would make the system more flexible (ex, weapons like the M249 which can load ammo belts in addition to M16 mags).
Related issues
| related to ArmA2 Community Issue Tracker - Feature #11418: Integrating magazine proxies into magazine interfaces | Assigned | 2010-06-22 |
History
Updated by pez2k about 1 month ago
- Reproducible for you set to No
This can be accomplished in part with #defines. For personal use, most of the weapon mods I use in singleplayer include a single standard file in /userconfig/ammotypes/ which has defines such as
#define STANAG_MAGS "30Rnd_556x45_STANAG", "20Rnd_556x45_STANAG"...
I can then use that name in every STANAG-using weapon, and if a new magazine turns up, just add it to the #define.
Drawbacks:
Not multiplayer safe (if an include from userconfig) / not easily updated or merged (if compiled into a .pbo)
Requires plaintext configs, since you're including external files that may change
Very far from perfect, but a basic implementation.
Updated by BigDawgKS about 1 month ago
pez2k wrote:
Very far from perfect, but a basic implementation.
Indeed, very far. An interface class is still needed IMO, especially if magazine proxies will also be implemented.