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

add disposable launcher framework #1116

Merged
merged 35 commits into from
Apr 27, 2019
Merged

add disposable launcher framework #1116

merged 35 commits into from
Apr 27, 2019

Conversation

commy2
Copy link
Contributor

@commy2 commy2 commented Apr 13, 2019

When merged this pull request will:

@commy2 commy2 added the Feature label Apr 13, 2019
@commy2 commy2 added this to the 3.11 milestone Apr 13, 2019
@commy2 commy2 added the WIP label Apr 13, 2019
@commy2
Copy link
Contributor Author

commy2 commented Apr 13, 2019

@PabstMirror
Copy link
Contributor

If we are starting over, I'd think we should require the fired event handler to be on the weapon

class nlaw 
class EventHandlers {
            fired = "call CBA_fnc_handleDisposable"

@commy2
Copy link
Contributor Author

commy2 commented Apr 13, 2019

@PabstMirror You can't see it, but that is what I am doing in BWA3. Here is the WIP doc which is also the state of the parallel branch on the BWA3 repository (where I test all this):

Click to expand

Disposable Launchers

Config examples

#define LAUNCHER_MASS 80
#define LAUNCHER_MAGAZINE_MASS 40

class CBA_DisposableLaunchers {
    BWA3_PzF3[] = {"BWA3_PzF3_Loaded","BWA3_PzF3_Used"};
};

class CfgMagazines {
    class CA_LauncherMagazine;
    class BWA3_PzF3_Tandem: CA_LauncherMagazine {
        author = "$STR_BWA3_Author";
        scope = 1;

        mass = LAUNCHER_MAGAZINE_MASS;
        allowedSlots[] = {};
    };
};

class CfgWeapons {
    class Launcher;
    class Launcher_Base_F: Launcher {
        class WeaponSlotsInfo;
    };

    class BWA3_PzF3: Launcher_Base_F {
        author = "$STR_BWA3_Author";
        scope = 1;
        scopeArsenal = 1;
        baseWeapon = "BWA3_PzF3";

        magazines[] = {"BWA3_PzF3_Tandem"};
        magazineReloadTime = 0.1;

        class EventHandlers {
            fired = "_this call CBA_fnc_firedDisposable"; // this weapon eventhandler is required!
        };

        class WeaponSlotsInfo: WeaponSlotsInfo {
            mass = LAUNCHER_MASS;
        };
    };

    class BWA3_PzF3_Loaded: BWA3_PzF3 {
        author = "$STR_BWA3_Author";
        scope = 2;
        scopeArsenal = 2;
        baseWeapon = "BWA3_PzF3_Loaded";

        magazines[] = {"CBA_FakeLauncherMagazine"};

        class WeaponSlotsInfo: WeaponSlotsInfo {
            mass = LAUNCHER_MASS + LAUNCHER_MAGAZINE_MASS;
        };
    };

    class BWA3_PzF3_Used: BWA3_PzF3 {
        author = "$STR_BWA3_Author";
        scope = 1;
        scopeArsenal = 1;
        baseWeapon = "BWA3_PzF3_Used";

        magazines[] = {"CBA_FakeLauncherMagazine"};

        class WeaponSlotsInfo: WeaponSlotsInfo {
            mass = LAUNCHER_MASS;
        };
    };
};

@commy2
Copy link
Contributor Author

commy2 commented Apr 20, 2019

Closes: acemod/ACE3#1335

@commy2
Copy link
Contributor Author

commy2 commented Apr 21, 2019

@commy2 commy2 removed the WIP label Apr 21, 2019
addons/optics/script_component.hpp Outdated Show resolved Hide resolved
@PabstMirror
Copy link
Contributor

These might be ace specific, not sure

put down "Launcher [Nato]" box, take nlaw and it is unloaded and cannot fire
nlaw mags don't show, might be because of

    class NLAW_F: CA_LauncherMagazine {
        scope = 1;

2 nalws show in ace arsenal, might want
scopeArsenal = 0; instead of 1

commy2
---------------------------------------------------------------------------- */

params ["_unit", "_launcher", "_muzzle", "", "", "", "_projectile"];
Copy link
Contributor

Choose a reason for hiding this comment

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

can be done in a later release, but we should add some way of handling spotting rounds (LAW 80)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, this is why I don't like dropping the launcher. It needs addWeaponWithAttachmentsCargoGlobal to work.

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe

_wh = "GroundWeaponHolder_Scripted" createVehicle position _unit;
_unit action ["DropWeapon", _wh, _usedLauncher];

Copy link
Contributor Author

Choose a reason for hiding this comment

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

DropWeapon is broken. Always has been always will be.

Copy link
Contributor

Choose a reason for hiding this comment

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

addWeaponWithAttachmentsCargo will be fully implemented in 1.96 (contact DLC is 1.94)

@commy2
Copy link
Contributor Author

commy2 commented Apr 25, 2019

Ref acemod/ACE3#6955

@Dystopian
Copy link
Contributor

Dystopian commented Apr 26, 2019

There was a feature in ACE2 - replace also rockets with launchers in ammo crates. So if there are NLAW launcher and 3 its rockets in a box, they become 4 NLAW disposable tubes. Is it a good idea for this PR, maybe optional with setting?
Upd: can be 3-state setting: leave rockets alone, replace with launcher, remove from box.

@commy2
Copy link
Contributor Author

commy2 commented Apr 26, 2019

Do we want this to be scripted though or just edit the configs in ACE?

See: acemod/ACE3@cfe40cc

@Dystopian
Copy link
Contributor

Config doesn't look universal (and quite big), scripted version could handle all disposable launchers/rockets. So I for script.

@commy2
Copy link
Contributor Author

commy2 commented Apr 26, 2019

Made it via script, but see no point in having a setting.

@Dystopian
Copy link
Contributor

Personally I like replacing rockets with launchers. Setting would suit those who doesn't like.

@commy2 commy2 added the WIP label Apr 26, 2019
@commy2
Copy link
Contributor Author

commy2 commented Apr 26, 2019

  • adds CBA_fnc_addWeaponWithoutItems, which is basically addWeapon without taking a magazine from inventory (has to be manually reloaded with addWeaponItem if needed) and without attachments (in case you use a class with pre-equipped attachments).

@commy2 commy2 removed the WIP label Apr 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Disposable launchers framework
4 participants