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

Hit Reactions - Add weapon dropping on arm hit #9539

Merged
merged 95 commits into from
Jun 6, 2024

Conversation

SpicyBagpipes
Copy link
Contributor

@SpicyBagpipes SpicyBagpipes commented Oct 19, 2023

When merged this pull request will:

  • Gun will be dropped when it is hit by a bullet if probability met.
  • Gun will be dropped when arm is hit by a bullet if separate probability met.
  • AI will retrieve gun after a couple of seconds.

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}.

@SpicyBagpipes
Copy link
Contributor Author

2023-10-19.21-45-08.mp4

Doesn't happen much if at all with vanilla weapons, mostly a modded thing. Vanilla weapons just have bullets pass through

@LinkIsGrim
Copy link
Contributor

Do we want to add weapon dropping on hand/arm hits as well? Can just check against selection

@SpicyBagpipes
Copy link
Contributor Author

SpicyBagpipes commented Oct 19, 2023

Do we want to add weapon dropping on hand/arm hits as well? Can just check against selection

Possibly, linked to different slider? Can then move condition for dropping stuff into the events?
Probably worth making a hit reactions settings category

addons/hitreactions/initSettings.sqf Outdated Show resolved Hide resolved
addons/hitreactions/initSettings.sqf Outdated Show resolved Hide resolved
addons/hitreactions/initSettings.sqf Outdated Show resolved Hide resolved
addons/hitreactions/stringtable.xml Outdated Show resolved Hide resolved
addons/hitreactions/stringtable.xml Outdated Show resolved Hide resolved
addons/hitreactions/initSettings.sqf Outdated Show resolved Hide resolved
addons/hitreactions/functions/fnc_checkWeaponDrop.sqf Outdated Show resolved Hide resolved
addons/hitreactions/functions/fnc_checkWeaponDrop.sqf Outdated Show resolved Hide resolved
addons/hitreactions/XEH_postInit.sqf Outdated Show resolved Hide resolved
SpicyBagpipes and others added 3 commits October 20, 2023 00:32
Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
@johnb432
Copy link
Contributor

johnb432 commented Apr 1, 2024

Will do seperate % if John hasn't already, haven't checked as still early here

I didn't do it, as I forgot that. I'll let you do it.

Is lifestate not incapacitated whilst in transition to uncon?

Possibly. Can you investigate that?

@SpicyBagpipes
Copy link
Contributor Author

Will do seperate % if John hasn't already, haven't checked as still early here

I didn't do it, as I forgot that. I'll let you do it.

Is lifestate not incapacitated whilst in transition to uncon?

Possibly. Can you investigate that?

Tested with allUnits select {lifeState _x != "HEALTHY"}, unit is picked up the second they start falling once uncon

@johnb432 johnb432 added this to the 3.18.0 milestone Apr 20, 2024
@johnb432 johnb432 changed the title Hit Reactions - Add weapon dropping on gun hit Hit Reactions - Add weapon dropping on arm hit May 29, 2024
@johnb432
Copy link
Contributor

In a future PR (potentially): Look at adding this to all projectiles (I'm thinking mostly about fragmentation).

@johnb432 johnb432 requested a review from LinkIsGrim May 29, 2024 22:52
Copy link
Contributor

@johnb432 johnb432 left a comment

Choose a reason for hiding this comment

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

I'm going to make another PR that needs to be merged before this one, for the changes in ace_common_fnc_addWeapon.

@johnb432 johnb432 merged commit 33dc7e3 into acemod:master Jun 6, 2024
5 checks passed
blake8090 pushed a commit to blake8090/ACE3 that referenced this pull request Aug 18, 2024
* Create fnc_checkWeaponDrop.sqf

* Update fnc_checkWeaponDrop.sqf

* Create XEH_postInit.sqf

* Update XEH_postInit.sqf

* Update XEH_postInit.sqf

* Update fnc_checkWeaponDrop.sqf

* fix spelling issue

* Update initSettings.sqf

Add weaponDropEnabled setting

* Update stringtable.xml

* Update fnc_checkWeaponDrop.sqf

* Update initSettings.sqf

Forgot a bracket

* Add weapon drop chance setting

* Update XEH_postInit.sqf

* Update CfgEventHandlers.hpp

actually make it run postinit

* Update XEH_PREP.hpp

* Update stringtable.xml

* Update initSettings.sqf

No need, set chance to 0

* Update XEH_postInit.sqf

already comparing against chance, can just set to 0

* Update initSettings.sqf

* Update stringtable.xml

* Update XEH_postInit.sqf

* add arm hit chance

fix weapon thing too

* Update stringtable.xml

* Update addons/hitreactions/functions/fnc_checkWeaponDrop.sqf

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Update addons/hitreactions/functions/fnc_checkWeaponDrop.sqf

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* appearance stuff

* Update addons/hitreactions/initSettings.sqf

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Update addons/hitreactions/functions/fnc_checkWeaponDrop.sqf

Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>

* kjw's poor arithmetic

* Update fnc_checkWeaponDrop.sqf

wrong check

* remove systemchat debug

whoops

* Update fnc_checkWeaponDrop.sqf

* Update XEH_postInit.sqf

* Update fnc_checkWeaponDrop.sqf

* Early exit, wait for clear

* Make default setting 0

* Update script_component.hpp

* Update XEH_postInit.sqf

* Update script_component.hpp

* Update XEH_postInit.sqf

* Update XEH_postInit.sqf

* Update addons/hitreactions/functions/fnc_checkWeaponDrop.sqf

* Update XEH_postInit.sqf

Unsure if exitWith in postInit is proper? Seems better than nesting all of that in another scope imo

* Update XEH_preInit.sqf

* Update fnc_checkWeaponDrop.sqf

* Update addons/hitreactions/XEH_preInit.sqf

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Update hitreactions.md

* Update hitreactions.md

* Update addons/hitreactions/functions/fnc_checkWeaponDrop.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* Update addons/hitreactions/functions/fnc_checkWeaponDrop.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* Update addons/hitreactions/initSettings.sqf

* Update XEH_postInit.sqf

* Update addons/hitreactions/XEH_postInit.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* Update addons/hitreactions/XEH_postInit.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* Update addons/hitreactions/functions/fnc_checkWeaponDrop.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* Update addons/hitreactions/functions/fnc_checkWeaponDrop.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* Update XEH_postInit.sqf

* Update XEH_postInit.sqf

* Update fnc_checkWeaponDrop.sqf

* Spacing fixes

* Update addons/hitreactions/XEH_postInit.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* Take _hitEntity into account if exists

* Update fnc_checkWeaponDrop.sqf

_didHitGun will no longer ever be true

* Minor component cleanup

* Removed gun hits, added double hit detection

* Decouple AI and player probabilities

* Tweaks and fixes

* Update XEH_PREP.hpp

* Add missing param

* Fixed bugged state AI are in after using TakeWeapon

* Fixes and cleanup

* Made API clear, moved undroppable to config entry

* Update fnc_checkWeaponDrop.sqf

* Check for Zeus RC and avoid `setUnitLoadout`

* Expand `addWeapon`'s capabilities

* Cleaned up `addWeapon`

* Removed weapon replacement as it's apparently not necessary

* Defined undefined variable

---------

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
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.

9 participants