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 ammo cookoff #4376

Merged
merged 12 commits into from
Oct 6, 2016
Merged

Add ammo cookoff #4376

merged 12 commits into from
Oct 6, 2016

Conversation

thojkooi
Copy link
Contributor

When merged this pull request will:

  • Add ammo cookoff from ACE2

Targetting release to hide the diff. Will target master when 3.7.0 is released.

@thojkooi thojkooi added the kind/feature Release Notes: **ADDED:** label Sep 11, 2016
@thojkooi thojkooi added this to the 3.8.0 milestone Sep 11, 2016
@@ -52,3 +52,30 @@ class CfgCloudlets {
destroyOnWaterSurfaceOffset = 0;
};
};

class ExploAmmoExplosion {
Copy link
Contributor

Choose a reason for hiding this comment

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

tag ?

Copy link
Contributor Author

@thojkooi thojkooi Sep 17, 2016

Choose a reason for hiding this comment

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

ExploAmmoExplosion is from arma3

@commy2
Copy link
Contributor

commy2 commented Sep 11, 2016

Now we have FUNC(secondaryExplosions) and FUNC(detonateAmmunition). Could these be merged somehow? They do the same thing in theory.

@kymckay
Copy link
Member

kymckay commented Sep 11, 2016

Perhaps detonateAmmunition should simply have a chance to cause secondary explosions for explosive ammo types (instead of firing them off), removing the need for the secondary explosions function.

Then if the enableAmmoCookoff setting is disabled they can always cause secondary explosions.

@thojkooi
Copy link
Contributor Author

Perhaps detonateAmmunition should simply have a chance to cause secondary explosions for explosive ammo types (instead of firing them off)

It does do that at the moment already - it fires some off, others will detonate within / near the vehicle.

@kymckay
Copy link
Member

kymckay commented Sep 11, 2016

So we just allow it to also create the "SmallSecondary" used in fnc_secondaryExplosions and the function is totally obsolete?

@thojkooi
Copy link
Contributor Author

We could, but we might want to look at fuel for those as well.

@kymckay
Copy link
Member

kymckay commented Sep 20, 2016

So I've tested and it's totally possible to prevent ammo boxes from sinking into the ground by changing destrType to DestructDefault from DestructBuilding.

The downside is that after death the box is just left sitting there with no visual indication that it has been destroyed. Perhaps the current method of keeping the box technically alive while cook off occurs is preferable.

Going to play around some more with other types I can find, DestructWreck sounds interesting.

@kymckay
Copy link
Member

kymckay commented Sep 20, 2016

That one also does nothing. I suggest we keep it as is - as long as cookoff can be disabled per-box it shouldn't be problematic for mission makers since they can just disable it if a target box needs to be instantly destroyed or w/e.

@commy2
Copy link
Contributor

commy2 commented Sep 20, 2016

Couldn't you just delete the box after you are done with the fireworks?

@kymckay
Copy link
Member

kymckay commented Sep 20, 2016

I suppose we could, it would be more abrupt than the whole sinking into the ground thing though. I don't want to make a solo judgement call on that one.

@kymckay
Copy link
Member

kymckay commented Sep 20, 2016

It would also delete the box 😝 As obvious as that sounds - I think the vanilla destruction just disappears the box and it still exists somewhere in the 6th dimension. So it could be unexpected with regards to scripts/triggers and stuff.

@thojkooi
Copy link
Contributor Author

thojkooi commented Oct 3, 2016

This should be ready.

Copy link
Contributor

@commy2 commy2 left a comment

Choose a reason for hiding this comment

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

All good, except for my one comment.

if (_box getVariable [QGVAR(isCookingOff), false]) exitWith {};
_box setVariable [QGVAR(isCookingOff), true];

[QGVAR(cookOffBox), _box] call CBA_fnc_remoteEvent;
Copy link
Contributor

Choose a reason for hiding this comment

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

Needs local check.
Same problem as: https://github.com/acemod/ACE3/pull/4242/files

@commy2 commy2 self-assigned this Oct 4, 2016
thojkooi and others added 3 commits October 6, 2016 22:14
Does not include a fire effect, mostly just a proof of concept.

Should probably also add further potential cook-off conditons (if hit by tracer for example).
kymckay and others added 9 commits October 6, 2016 22:14
- Add burning effect while ammo box is cooking off
- Add setting to enable/disable ammo boxes cooking off
- Clear magazine cargo while box is burning

Currently the box will burn for 60 seconds hardcoded, this is to allow time for the ammunition to cook off (since boxes sink into the ground and dissapear when destroyed). Perhaps we can implement a way to burn until all ammo is expended.
I say optimize, the only real performance optimization is using `vectorMultiply`. The rest is readability optimization though!
- Remove unnecessary light source (fire particles provide lighting)
- Add randomness to cook off time
- Cook off begins with fire effect rather than smoke
Due to limitations in the way arma handles tracer rounds (there's no way to check if an individual projectile is a tracer), only magazines with a high enough tracer density (at least 1 in 4) can cause cook off this way. However this is deemed an acceptable approximation since the chance of this happening should be quite low anyway.
@thojkooi
Copy link
Contributor Author

thojkooi commented Oct 6, 2016

@commy2 done

@thojkooi thojkooi merged commit 059980b into master Oct 6, 2016
@thojkooi thojkooi deleted the add-ammo-cookoff branch October 6, 2016 20:37
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.

3 participants