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 setDead API #10045

Merged
merged 7 commits into from
May 31, 2024
Merged

Common - Add setDead API #10045

merged 7 commits into from
May 31, 2024

Conversation

johnb432
Copy link
Contributor

When merged this pull request will:

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 johnb432 added the kind/feature Release Notes: **ADDED:** label May 29, 2024
@johnb432 johnb432 added this to the 3.18.0 milestone May 29, 2024
@johnb432 johnb432 requested a review from LinkIsGrim May 29, 2024 08:13
@johnb432
Copy link
Contributor Author

Do we want to add a callable event for this, so that units can be killed from any client?

@PabstMirror
Copy link
Contributor

in ace_medical_statemachine_fnc_enteredStateDeath

we could add
private _source = _unit getVariable [QEGVAR(medical,lastDamageSource), objNull];
and change to
[_unit, _causeOfDeath, _source, _instigator] call EFUNC(medical_status,setDead);

should give us a more accurate killed EH, but I'm not sure what side effects it might have
or why we didn't do it originally

@PabstMirror
Copy link
Contributor

maybe merge now and I can do that in a followup

Copy link
Member

@BrettMayson BrettMayson left a comment

Choose a reason for hiding this comment

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

Add an event at the same time?

@LinkIsGrim
Copy link
Contributor

ace_killed should already fire, unless you mean event to kill remote units

@BrettMayson
Copy link
Member

That only fires with medical enabled right? And it also won't include the reason string

@johnb432
Copy link
Contributor Author

That only fires with medical enabled right? And it also won't include the reason string

ace_killed is indeed part of medical_status, but it includes the reason string (it's the 2nd param of ace_killed). It's raised automatically as the unit is killed, so there is no need to raise any events for when ace_medical is loaded.

I'm not sure if we want to add events when ace_medical isn't loaded. We could reuse ace_killed, but I'm not sure if that's a good idea. If a mod doesn't use ace_medical, it has to rely on the Vanilla Killed EH, meaning it could also have its own way of handling reasons of death.

I added the reason as a param for when ace_medical is loaded, I didn't intend it to be used when it wasn't loaded, as I don't see the point of using a reason when not using ace_medical.

@johnb432
Copy link
Contributor Author

We can add events in another PR if it's necessary.

@johnb432 johnb432 merged commit 9f2ee9f into master May 31, 2024
5 checks passed
@johnb432 johnb432 deleted the common-set-dead-api branch May 31, 2024 20:07
blake8090 pushed a commit to blake8090/ACE3 that referenced this pull request Aug 18, 2024
* Added `setDead` API

* Update XEH_PREP.hpp

* Update fnc_setDead.sqf

* Update addons/common/functions/fnc_disableUserInput.sqf

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

* Update fnc_setDead.sqf

* Added warning for non-local units

---------

Co-authored-by: Grim <69561145+LinkIsGrim@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.

5 participants