ACE3 icon indicating copy to clipboard operation
ACE3 copied to clipboard

Cookoff - Mini-Rewrite

Open johnb432 opened this issue 1 year ago • 8 comments

When merged this pull request will:

  • Fixes #8736.
  • Fixes #8683 by placing the smoke pillar on the engine selection.
  • To start vehicle or ammo box cook-offs, an event has to be run on the server.
  • Same goes for ammo cook-offs.
  • Made all effects JIP compatible ~~(exception are the jet and ring effects, as they only last 20 seconds max)~~.
  • Removed tiny explosion effects that were present in the smoke when an ammo box is cooking off, as it looks excessive when machine gun ammo is detonating. If projectiles are created during cook-off, they will ensure that such effects occur, but in a more suited manner to the cook-off happening.
  • Ammo boxes can now cook-off from incendiary rounds (incendiary definition comes from vehicle_damage).
  • Attached the cook-off sound to the vehicle, so that it moves with the vehicle.
  • Cook-off sound is deleted when the vehicle is deleted.
  • CBA settings have been reworked:
    • GVAR(enable) has been removed.
      • This setting was too ambiguous in my opinion. 3 separate settings exist (GVAR(enableFire), GVAR(enableAmmoCookoff) & GVAR(enableAmmobox)) that allow to control most aspects that GVAR(enable) does, making it redundant.
      • With the current system, if players dismount the vehicle that is going to cook off fast enough, the vehicle won't cook off. Checking for players within a vehicle is therefore pointless in my eyes.
      • This change means that setting QGVAR(enable) on objects will no longer affect ammo detonation, but only fire effects. QGVAR(enableAmmoCookoff) already exists and can be set in the editor, although that's currently not listed in the docs - that has been rectified.
    • GVAR(enableFire) is now the sole setting that handles vehicle cook-off fire. This setting does not handle ammo detonation (handled by GVAR(enableAmmoCookoff)).
    • Added a duration coefficient setting GVAR(cookoffDuration) for cook-off (fixes #9743).
    • GVAR(probabilityCoef) has been made useful again. It's only used in the advanced vehicle damage component.
    • Moved GVAR(removeAmmoDuringCookoff) from vehicle_damage into cookoff. Changed it so that it removes all magazines upon ammunition cook-off.
  • Code cleanup.

SP and MP testing has been conducted, but could use some more.

IMPORTANT

  • If the contribution affects the documentation, please include your changes in this pull request so the documentation will appear on the website.
  • Development Guidelines are read, understood and applied.
  • Title of this PR uses our standard template Component - Add|Fix|Improve|Change|Make|Remove {changes}.

johnb432 avatar Jan 27 '24 08:01 johnb432

Something that has always frustrated me about vehicle cookoff is how the ammo goes shooting out of the vehicle, sometimes landing 100m+ away from it. A round's propellant burning doesn't actually give it velocity unless it's contained by a barrel, it will just pop out of its casing, and ammo in storage shouldn't be exiting the vehicle at all.

Drofseh avatar Jan 28 '24 18:01 Drofseh

This or #5327 first for review?

LinkIsGrim avatar Feb 02 '24 01:02 LinkIsGrim

This or #5327 first for review?

#5327 should probably be first, although that means I need to include the changes I mentioned above.

johnb432 avatar Feb 02 '24 17:02 johnb432

This or #5327 first for review?

#5327 should probably be first, although that means I need to include the changes I mentioned above.

Done, #5327 is ready to review.

johnb432 avatar Feb 02 '24 22:02 johnb432

This is fully ready to review.

johnb432 avatar Feb 05 '24 16:02 johnb432

I'll hold off from merging until #9061 is merged.

johnb432 avatar Apr 04 '24 11:04 johnb432

@johnb432 merge conflicts

LinkIsGrim avatar May 24 '24 23:05 LinkIsGrim

@johnb432 merge conflicts

I need to still resolve some stuff, so hold off from merging, I'll handle it.

johnb432 avatar May 25 '24 09:05 johnb432

I'm done with the changes. Those changes are:

  • redid internal events, so that API events wouldn't change
  • fixed some bugs that came with merging 9061

johnb432 avatar May 26 '24 07:05 johnb432