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

Mortar interaction and ammunition handling #3043

Merged
merged 25 commits into from
Feb 20, 2016
Merged

Mortar interaction and ammunition handling #3043

merged 25 commits into from
Feb 20, 2016

Conversation

VKing6
Copy link
Member

@VKing6 VKing6 commented Dec 16, 2015

This is a port of code originally written by Grey and Glowbal at 16AA.

Goals of this branch is to remove the multiple-round magazines for the mortars and restricting them to loading 1 round at a time and to give assistant gunners and ammo carriers something to do. The plan is to make this module-controlled.

Current status:

  • Port major script components to ACE
  • Add interaction menu support for loading rounds
  • Add new mortar magazines and make them carriable by infantry
  • Port proper inventory images and ground models for new magazines
  • Implement options in module to avoid changing existing missions
    • Add module settings
    • Don't show loading/unloading actions if ammunition handling is not set
    • Init mortar to replace weapon and remove vanilla magazines if ammunition handling is set
  • Zeus testing
  • Unload rounds to player inventory
  • Update module documentation and class list
  • Ammo boxes
  • Translations
  • MP testing
  • Make the mortar reloadable by the gunner with a time penalty Eh too complicated for now; the time penalty will be having to get out and back in between shots.

Todo:
Implement in module (Choose new or old/don't break old missions)
Magazine UI+model
Add preparing delay
Fix function readmes
Cleanup in functions?
Credits
MP Testing
@VKing6 VKing6 self-assigned this Dec 16, 2015
@jokoho48
Copy link
Member

@VKing6 i will take a look to the Models tomorrow

displayName = CSTRING(magazine_HE_LaserGuided_displayName);
descriptionShort = CSTRING(magazine_HE_LaserGuided_descriptionShort);
model = PATHTOF(data\l16_ammo_he.p3d)
picture = PATHTOF(UI\w_l16_ammo_he_ca.paa);
Copy link
Member

Choose a reason for hiding this comment

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

TAAAAAB

@Grey-Soldierman
Copy link
Contributor

You can blame me for awful code. Im glad you guys are finding it helpful though. If there is any stuff that it links to in the main 16AA modpack that you want/need just let me know and ill pass the source files along.

@VKing6
Copy link
Member Author

VKing6 commented Dec 17, 2015

Hey I can't claim to write the best code myself (why do you think I wanted to take yours in the first place :p), I'm just more pedantic.

@thojkooi thojkooi added this to the 3.6.0 milestone Dec 17, 2015
@VKing6
Copy link
Member Author

VKing6 commented Dec 17, 2015

Now taking suggestions on the best way to prepare the mortars if ammunition handling is enabled.

The challenges:

  • Weapon must be replaced
  • Default magazines must be removed
  • Consideration for missions where no mortars are placed on mission start, but where mortars will be assembled during play (mortars that are disassembled and reassembled should be okay)

@bux
Copy link
Member

bux commented Dec 17, 2015

  • Zeus spawned mortars (?)


_static setMagazineTurretAmmo [_magazine, _ammoCount, [0]];

}] call EFUNC(common,addEventHandler);
Copy link
Member Author

Choose a reason for hiding this comment

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

Should these three eventhandlers be defined in postinit rather than clientinit?


// if (GVAR(useAmmoHandling)) then {
_this call FUNC(mortarInit);
// };
Copy link
Member Author

Choose a reason for hiding this comment

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

This GVAR isn't read from the module in time to work on preplaced mortars.
Any suggestions on how I can delay execution until the variable's been read?

Copy link
Member

Choose a reason for hiding this comment

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

if (!EGVAR(common,settingsInitFinished)) exitWith {
    EGVAR(common,runAtSettingsInitialized) pushBack [{
        if (GVAR(useAmmoHandling)) then {
            _this call FUNC(mortarInit)
        };
    }, _this];
};
_this call FUNC(mortarInit);

@VKing6
Copy link
Member Author

VKing6 commented Dec 19, 2015

Okay I've written a functional init script that works on reassembled mortars as well as preplaced ones (should work on zeus or script-placed ones as well, but haven't tested yet).

I'd love to get some feedback on the above issue in initPost as well as a general critique of fnc_mortarInit

@VKing6 VKing6 closed this Dec 19, 2015
@VKing6 VKing6 reopened this Dec 19, 2015
@VKing6
Copy link
Member Author

VKing6 commented Dec 19, 2015

Made Zeus compatible.
AI and Zeus-controlled AI can use the mortar as normal until a player enters it, which initializes the mortar for ammunition handling.

VKing6 added a commit that referenced this pull request Dec 20, 2015
@VKing6 VKing6 mentioned this pull request Dec 20, 2015
@VKing6 VKing6 removed the status/WIP label Jan 10, 2016
@VKing6 VKing6 modified the milestones: 3.5.0, 3.6.0 Jan 12, 2016
@VKing6
Copy link
Member Author

VKing6 commented Jan 12, 2016

I'd like to have this tested for 3.5.0, as I think it's ready (unless testing shows something horribly broken ofc).

@VKing6
Copy link
Member Author

VKing6 commented Feb 14, 2016

Switched over to playerVehicleChanged EH instead of GetIn/InitPost on commy's suggestion. Seems to work a lot smoother, but I'll have to do another MP dedi test.

@VKing6
Copy link
Member Author

VKing6 commented Feb 19, 2016

Calling this good to merge from my end.

@thojkooi thojkooi added kind/feature Release Notes: **ADDED:** and removed needs review status/needs-testing labels Feb 20, 2016
thojkooi added a commit that referenced this pull request Feb 20, 2016
Mortar interaction and ammunition handling
@thojkooi thojkooi merged commit 1e3596b into master Feb 20, 2016
@thojkooi thojkooi deleted the Mortar_interact branch February 20, 2016 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Release Notes: **ADDED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants