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

Overheating - Fix issues from release #8617

Merged
merged 25 commits into from
Nov 8, 2021

Conversation

Drofseh
Copy link
Contributor

@Drofseh Drofseh commented Oct 25, 2021

When merged this pull request will:

  • add ace_overheating_fnc_canCoolWeaponWithItem function
  • add setting, ace_overheating_suppressorCoef, to adjust how much additional heat goes into the weapon when a suppressor is equipped
  • add setting, ace_overheating_coolingCoef, to adjust how quickly weapons cool
  • add exit to ammo temp loop if ace_overheating_cookoffCoef is changed to 0 mid-mission, this prevents an issue where all weapons start to cookoff regardless of temp, because required temp gets multiplied by ace_overheating_cookoffCoef which has been set to 0
  • add public functions ace_overheating_fnc_getAmmoTemperature, ace_overheating_fnc_setAmmoTemperature, ace_overheating_fnc_getWeaponTemperature, ace_overheating_fnc_setWeaponTemperature
  • add type of jam to ace_weaponJammed local event, close Overheating - Add jam type to ace_weaponJammed event #8637
  • clear all weapon heat on death, fix Overheating - weapon heat not cleared on respawn #8642
  • deprecate ace_overheating_fnc_getBarrelMass to be a wrapper for ace_overheating_fnc_getWeaponData that only returns barrel mass, this is cached and therefore faster
  • improve documentation
  • move ace_overheating_heatCoef check to a more sensible place
  • move overheating cookoff into separate function ace_overheating_fnc_cookoffWeapon
  • require mission restart when ace_overheating_heatCoef setting is changed (it gets cached per ammo type)
  • use ambientTemperature as floor for weapon and ammo temp
  • workaround for Ace Capture have cooling weapon on same point with no weapon in hand #8657

- move heatCoef to a more sensible place
- require mission restart for heatCoef setting change (it gets cached per ammo type)
- add exit to ammo temp loop if cookoffCoef is changed to 0 mid-mission, this prevents an issue where all weapon cookoff regardless of temp, because required temp gets multiplied by cookoffCoef which has been set to 0.
- add type of jam to ace_weaponJammed local event
- fix acemod#8637
@veteran29 veteran29 added this to the 3.14.1 milestone Oct 28, 2021
Co-authored-by: TyroneMF <TyroneMF@hotmail.com>
@jonpas jonpas added the kind/bug-fix Release Notes: **FIXED:** label Oct 28, 2021
@jonpas jonpas changed the title Overheating - fix issues from release Overheating - Fix issues from release Oct 28, 2021
@LinkIsGrim
Copy link
Contributor

GVAR(cacheWeaponData) = call CBA_fnc_createNamespace;
GVAR(cacheAmmoData) = call CBA_fnc_createNamespace;
GVAR(cacheSilencerData) = call CBA_fnc_createNamespace;

This could be changed to use hashMap instead.

Drofseh and others added 5 commits October 29, 2021 22:43
Co-authored-by: GhostIsSpooky <69561145+Salluci@users.noreply.github.com>
…rrel mass values

- cache closed bolt value by moving config look up to ace_overheating_fnc_getWeaponData
- cache barrel mass value by moving calculation from ace_overheating_fnc_getBarrelMass to ace_overheating_fnc_getWeaponData
- deprecate ace_overheating_fnc_getBarrelMass to be a wrapper for ace_overheating_fnc_getWeaponData that only returns barrel mass
@Drofseh
Copy link
Contributor Author

Drofseh commented Nov 1, 2021

My workaround for #8657 will check if they are surrendering or captive and not show the interaction.

I don't think this truly solves the issue though as other things added to the hand selection in the future will be able to overlap.

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
@Drofseh
Copy link
Contributor Author

Drofseh commented Nov 3, 2021

I've had a request from @10Dozen to add a keybind to unload the magazine. Use case is that's faster to hit a key than it is to open the inventory and drag the mag from weapon to container.

He'd like it in ace_common so that it can still be used even when overheating isn't loaded, for example if a group has a "no loaded weapon in base" rule and they come back from a patrol.

I've written a function for it, but one thing I want to include is the possibilty for a custom unload animation ACE_unloadAction and unload sound ACE_unloadSound config entries from mod makers, similar to how there is a config entry for a custom jam clearning animation ACE_clearJamAction.

If this keybind goes into ace_common though, I'm not sure where to document these config entries.

Thoughts?

@PabstMirror
Copy link
Contributor

IMHO it could be added later to another PR if it's going to be in common
We'd really like to get these fixes done for 3.14.1

@Drofseh
Copy link
Contributor Author

Drofseh commented Nov 5, 2021

I think I'm done for this PR.
#8569 is still an issue, but I'm not sure how to solve that yet and I think it's fine to leave it for another PR.

@Drofseh Drofseh marked this pull request as ready for review November 5, 2021 19:26
@Drofseh Drofseh requested a review from PabstMirror November 5, 2021 19:27
@pterolatypus
Copy link
Contributor

require mission restart when ace_overheating_heatCoef setting is changed (it gets cached per ammo type)

Why not just clear the cache whenever the setting is changed? This seems like the kind of value people would want to tweak progressively without having to restart the mission.

@Drofseh
Copy link
Contributor Author

Drofseh commented Nov 7, 2021

require mission restart when ace_overheating_heatCoef setting is changed (it gets cached per ammo type)

Why not just clear the cache whenever the setting is changed? This seems like the kind of value people would want to tweak progressively without having to restart the mission.

Makes sense, what would be the best way to do this?

Oh it looks like Pabst already took care of it, thank you!

Co-authored-by: jonpas <jonpas33@gmail.com>
@PabstMirror PabstMirror merged commit 99c85e3 into acemod:master Nov 8, 2021
AndreasBrostrom pushed a commit to AndreasBrostrom/ACE3 that referenced this pull request Dec 3, 2021
* move overheating cookoff into separate function

* move heatCoef and require mission restart for setting change

- move heatCoef to a more sensible place
- require mission restart for heatCoef setting change (it gets cached per ammo type)

* add exit to ammo temp loop if cookoffCoef is changed to 0 mid-mission

- add exit to ammo temp loop if cookoffCoef is changed to 0 mid-mission, this prevents an issue where all weapon cookoff regardless of temp, because required temp gets multiplied by cookoffCoef which has been set to 0.

* file end new line

* update header for ace_overheating_fnc_cookoffWeapon

* use ambientTemperature as floor for weapon and ammo temp

* add coolingCoef setting

* improve feature documentation

* add fnc_cookoffWeapon to XEH_PREP

* add type of jam to ace_weaponJammed local event

- add type of jam to ace_weaponJammed local event
- fix acemod#8637

* fix misspelling

Co-authored-by: TyroneMF <TyroneMF@hotmail.com>

* clear all weapon heat on death

* Update addons/overheating/functions/fnc_updateTemperature.sqf

Co-authored-by: GhostIsSpooky <69561145+Salluci@users.noreply.github.com>

* deprecate ace_overheating_fnc_getBarrelMass, cache weapon bolt and barrel mass values

- cache closed bolt value by moving config look up to ace_overheating_fnc_getWeaponData
- cache barrel mass value by moving calculation from ace_overheating_fnc_getBarrelMass to ace_overheating_fnc_getWeaponData
- deprecate ace_overheating_fnc_getBarrelMass to be a wrapper for ace_overheating_fnc_getWeaponData that only returns barrel mass

* add public functions to get and set weapon and ammo temperature

* add `canCoolWeaponWithItem` function, workaround for acemod#8657

* Apply suggestions from code review

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

* add coef setting for addition heat from suppressor

* Update fnc_overheat.sqf

* improve fnc_canCoolWeaponWithItem

* remove extra (

* Move canCoolWeaponWithItem action code to function

* Use hashmaps and reset on settings change

* Apply suggestions from code review

Co-authored-by: jonpas <jonpas33@gmail.com>

Co-authored-by: TyroneMF <TyroneMF@hotmail.com>
Co-authored-by: GhostIsSpooky <69561145+Salluci@users.noreply.github.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
Co-authored-by: jonpas <jonpas33@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug-fix Release Notes: **FIXED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Overheating - weapon heat not cleared on respawn Overheating - Add jam type to ace_weaponJammed event
8 participants