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

Casings - Improve Ace Casings to include 40mm casings #9716

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions addons/casings/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,13 @@ class CfgPatches {
VERSION_CONFIG;
};
};
class CfgAmmo {
class GrenadeBase; // Reference the base class

class G_40mm_HE: GrenadeBase {
// Override the specific parameters here
cartridge = "FxCartridge_40mm";
Copy link
Contributor

Choose a reason for hiding this comment

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

This class doesn't exist. This will cause issues at some point.

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we add a new config
QGVAR(modelPath) = x.p3d

_modelPath = getText (configFile >> "CfgAmmo" >> _ammo >> QGVAR(modelPath));

if (_modelPath == "") then {
    private _cartridge = getText (configFile >> "CfgAmmo" >> _ammo >> "cartridge");
// use cartridge lookup switch...

also, we could move the cartridge->modelPath to be config based instead of the switch?

I'm happy to do the work if this sounds ok

Copy link
Contributor

Choose a reason for hiding this comment

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

I was doing that exact thing but got ADHD'd.

Also we'd need handling for firing UBGLs in this specific case, as most of those shouldn't drop casings until reload.

Copy link
Contributor

Choose a reason for hiding this comment

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

could handle shells on reload

["CAManBase", "Reloaded", {
    params ["_unit", "_weapon", "_muzzle", "_newMagazine", "_oldMagazine"];
    if (_unit != ACE_player) exitWith {};
    if (isNil "_oldMagazine") exitWith {};
    // if (!_muzzle isKindOf GL) exitWith {};
    _oldMagazine params ["_mag", "_ammo"];
    if (_ammo != 0) exitWith {};

    systemChat "making shell"; 
    //global event?

}] call CBA_fnc_addClassEventHandler;

Copy link
Contributor

Choose a reason for hiding this comment

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

At that point, might as well have a mag drop component for spent reloads (this is why dropped work on this)

Copy link
Author

Choose a reason for hiding this comment

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

This seems like a good idea, casings make sense and it would be ideal on the point of reload.

Magazines are not typically dropped unless things are really dire so I personally don't think you need to worry about them

Copy link
Contributor

Choose a reason for hiding this comment

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

Magazines are not typically dropped unless things are really dire so I personally don't think you need to worry about them

Very true, but in Arma they vanish into thin air once you reload your gun and the magazine loaded in the gun is empty (unless you are running the Green Ammo mod). If we were to take grenade casings after reload into account, why not empty magazines? Empty magazines would either need to be returned into the player's inventory or dropped onto the ground.


Going down this route is going to open a can of worms imo. I'm with @LinkIsGrim - this needs to be thought out better and done properly.

// Other parameters can also be modified if needed
};
};
#include "CfgEventHandlers.hpp"
1 change: 1 addition & 0 deletions addons/casings/functions/fnc_createCasing.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ if (isNil "_modelPath") then {
case "FxCartridge_12Gauge_Slug_lxWS": { "lxWS\weapons_1_f_lxws\Ammo\cartridge_slug_lxws.p3d" };
case "FxCartridge_12Gauge_Smoke_lxWS": { "lxWS\weapons_1_f_lxws\Ammo\cartridge_smoke_lxws.p3d" };
case "FxCartridge_12Gauge_Pellet_lxWS": { "lxWS\weapons_1_f_lxws\Ammo\cartridge_pellet_lxws.p3d" };
case "FxCartridge_40mm": { "A3\Weapons_F\MagazineProxies\mag_40x36_HE_1rnd.p3d" };
case "": { "" };
default { "A3\Weapons_f\ammo\cartridge.p3d" };
};
Expand Down