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

Common - Add ace_common_fnc_addExplosionEventHandler #10243

Merged
merged 6 commits into from
Sep 7, 2024
Merged

Conversation

PabstMirror
Copy link
Contributor

Add an explosion event handler to common so multiple systems can hook into the same event

  • Local event
  • ace_hearing take the local event and re-broadcasts
    (might be worthwhile to only broadcast to close-distance units?)

@PabstMirror PabstMirror added the kind/enhancement Release Notes: **IMPROVED:** label Aug 22, 2024
@PabstMirror PabstMirror added this to the 3.18.0 milestone Aug 22, 2024
@lambdatiger
Copy link
Contributor

lambdatiger commented Aug 23, 2024

Ignore that last comment, I was mistaken.

I am un-mistaken, there's some hurdles with using local on projectiles that I couldn't overcome using init event handlers on ace_frag and was planning on addressing with Arma 3 v2.18's getShotInfo, specifically the isReal value.

fuckingHellFoundIt.mp4

@PabstMirror PabstMirror modified the milestones: 3.18.0, Ongoing Aug 24, 2024
@PabstMirror
Copy link
Contributor Author

e.g. 12Rnd_120mm_HE_shells_Tracer_Red
seems like shots that are tracers and explosive will show as local to all units (or all units in visible range?)
and produce the explode event multiple times

This PR can wait, but it's really just a wrapper for changes from #10002 so we'll have to figure something out for hearing
or we'll have problems with n^2 ear ringing

@PabstMirror
Copy link
Contributor Author

PabstMirror commented Aug 27, 2024

I see only 2 solutions right now

  • we put this (and the hearing/explosion part) on hold until 2.18
  • we have this hook into firedEH just like the frag pr is doing (and then revert back after 2.18?)

@johnb432
Copy link
Contributor

johnb432 commented Aug 28, 2024

* we have this hook into firedEH just like the frag pr is doing (and then revert back after 2.18?)

I don't think fired would work for things such as mines and explosives, but I haven't tested and can't confirm it at all.

Since some projectiles seem to be local to all units, wouldn't they be objNull on different clients, meaning we could just filter out isNull and have it work? It's not great from a network point of view, but imo it beats using the fired EH. Testing suggests the above would work.

@johnb432
Copy link
Contributor

Even better: Dedmen told me that local objects return a netID of 0:0. I tested it with projectiles and it seems to also be the case.

PabstMirror and others added 2 commits August 30, 2024 13:34
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
@PabstMirror
Copy link
Contributor Author

PabstMirror commented Aug 30, 2024

If "ProjectileCreated" is added during preInit it will pickup mission placed explosives
but we won't know if we want it until after settings are init...

maybe something to think about in the future

@PabstMirror PabstMirror modified the milestones: Ongoing, 3.18.0 Aug 30, 2024
@johnb432
Copy link
Contributor

If "ProjectileCreated" is added during preInit it will pickup mission placed explosives but we won't know if we want it until after settings are init...

maybe something to think about in the future

if (!EGVAR(common,settingsInitFinished)) exitWith {
    EGVAR(common,runAtSettingsInitialized) pushBack [{}, _this];
};

?

PabstMirror and others added 2 commits September 2, 2024 22:00
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
@PabstMirror
Copy link
Contributor Author

seems to work correctly in mp with a pre-placed satchel

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
@PabstMirror
Copy link
Contributor Author

I can't test mp on dev branch so we won't really know until the RC is out, but sounds like it will work as expected
posting comments from #dev_rc_branch comments for reference

johnb43 — 08/28/2024 8:53 AM
Do we have a method of being able to tell if an object or projectile exists on the current machine only?
I'd like to avoid sending references to objects/projectiles don't exist globally over the network.
If we don't have methods currently, could we get them returned in getEntityInfo/getShotInfo? I can make a ticket if wanted.
Dedmen (ง •̀_•́)ง — 08/28/2024 9:01 AM
NetID
0:0 for locals
johnb43 — 08/28/2024 9:07 AM
Do you know if that works for projectiles too?
Dedmen (ง •̀_•́)ง — 08/28/2024 9:09 AM
Uff
Maybe not. But I'd expect shot info to have the local/virtual/fake flag
Yeah the isReal flag
It's false for remote projectiles.
Don't know if there would be a local projectile that's also not real
johnb43 — 08/28/2024 9:13 AM
It looks like netID returns 0:0 for local projectiles
But we might switch over to getShotInfo isReal when 2.18 comes out
Thanks!

@PabstMirror PabstMirror merged commit d4ffdd7 into master Sep 7, 2024
4 checks passed
@PabstMirror PabstMirror deleted the explosionEH branch September 7, 2024 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants