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

Medical - Add AI Unconsciousness exception (when using zeus module) #8903

Merged
merged 17 commits into from
May 8, 2022
Merged

Medical - Add AI Unconsciousness exception (when using zeus module) #8903

merged 17 commits into from
May 8, 2022

Conversation

YetheSamartaka
Copy link
Contributor

@YetheSamartaka YetheSamartaka commented May 5, 2022

  • Adds AI Unconsciousness exception option. It allows you to put AI into unconsciousness via Zeus Module even though the AI unconsciousness is disabled. This "feature" was possible before the medical rewrite and allowed to put selected AI units into unconsciousness even though the overall AI unconsciousness was disabled. This was very handy and many groups missed this ability including myself.
  • Special thanks to Pterolatypus for consultation.

YetheSamartaka and others added 11 commits December 10, 2020 01:13
This adds missing ACE_GForceCoef value for DF-15 uniforms.
DF-15 PR - cfgWeapons formating
Forgot to save it with braces and spaces around =
- Adds AI Unconsciousness exception option. If enabled, it allows you to put AI into unconsciousness via Zeus Module even though the AI unconsciousness is disabled. This "feature" was possible before the medical rewrite and allowed to put selected AI units into unconsciousness  even though the overall AI unconsciousness was disabled. This was very handy and many groups missing this option including myself.
- Special thanks to Pterolatypus for consultation.
tabs to spaces
last tab to space :copium:
stringtable tabs to spaces
@LinkIsGrim
Copy link
Contributor

LinkIsGrim commented May 5, 2022

I'd refactor this to handle the entirety of the statemachine condition inside a function if one is going to be called at all.

Don't particularly like the variable name, but meh.

Change in the Zeus module function should use EGVAR macro.

@YetheSamartaka
Copy link
Contributor Author

YetheSamartaka commented May 5, 2022

I'd refactor this to handle the entirety of the statemachine condition inside a function if one is going to be called at all.

Don't particularly like the variable name, but meh.

Change in the Zeus module function should use EGVAR macro.

  1. I tried to have that _this getVariable and so on inside the statemachine condition, but I have encountered difficulties.
  2. I'm aware that it is not the best variable name. I'm open to suggestions.
  3. Do you mean replacing the ace_medical_statemachine_AIUnconsciousness_Exception by the EGVAR(medical_statemachine,AIUnconsciousness_Exception)?

Copy link
Member

@mharis001 mharis001 left a comment

Choose a reason for hiding this comment

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

I don't think this should have a setting; it seems confusing. If the only goal is to allow for unconsciousness to be forced (for the Zeus module), let's add logic that specifically allows that without requiring a setting to be set.

@kymckay
Copy link
Member

kymckay commented May 5, 2022

I don't think this should have a setting; it seems confusing. If the only goal is to allow for unconsciousness to be forced (for the Zeus module), let's add logic that specifically allows that without requiring a setting to be set.

Was about to comment the exact same, a setting adds no value here. If we add the logic and someone doesn't want to unconscious AI via zeus they can just not do it.

- Addon option removed
- adjusted variable name
@YetheSamartaka YetheSamartaka changed the title Add AI Unconsciousness exception option Add AI Unconsciousness exception May 6, 2022
@YetheSamartaka
Copy link
Contributor Author

I don't think this should have a setting; it seems confusing. If the only goal is to allow for unconsciousness to be forced (for the Zeus module), let's add logic that specifically allows that without requiring a setting to be set.

Was about to comment the exact same, a setting adds no value here. If we add the logic and someone doesn't want to unconscious AI via zeus they can just not do it.

As requested, the addon option was removed. I've also adjusted the variable name.

@YetheSamartaka YetheSamartaka requested a review from mharis001 May 6, 2022 07:31
- utilized QEGVAR in getVariable
Copy link
Member

@kymckay kymckay left a comment

Choose a reason for hiding this comment

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

Minor stuff, you/others may disagree so feel free to justify/challenge 😃

addons/medical_statemachine/Statemachine.hpp Outdated Show resolved Hide resolved
@YetheSamartaka
Copy link
Contributor Author

Minor stuff, you/others may disagree so feel free to justify/challenge 😃

I actually agree with the option being removed. I included it here because I thought that someone might want to have an option to retain current behavior. The variable name was also very horrible initially.

- I've managed to properly implement the getVariable inside the condition thus allowing me to remove the function. Also kymckay had a good point on swapping the order for faster eval.
YetheSamartaka and others added 2 commits May 6, 2022 18:34
- setVariable optimalization

Co-authored-by: pterolatypus <pterolatypus@users.noreply.github.com>
Co-authored-by: pterolatypus <pterolatypus@users.noreply.github.com>
Copy link
Member

@mharis001 mharis001 left a comment

Choose a reason for hiding this comment

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

How does this work with the CardiacArrest state, which has a similar condition?

@YetheSamartaka
Copy link
Contributor Author

YetheSamartaka commented May 7, 2022

How does this work with the CardiacArrest state, which has a similar condition?

This exception only targets the Zeus module for unconsciousness, so it should not affect the CardiacArrest at all. I've tested it in-game and it hasn't caused any issues. Tried both enabled and disabled AI unconsciousness and it behaved as expected.

@PabstMirror PabstMirror added this to the 3.14.2 milestone May 7, 2022
@PabstMirror PabstMirror added the kind/enhancement Release Notes: **IMPROVED:** label May 7, 2022
@PabstMirror PabstMirror changed the title Add AI Unconsciousness exception Add AI Unconsciousness exception (when using zeus module) May 8, 2022
@PabstMirror PabstMirror changed the title Add AI Unconsciousness exception (when using zeus module) Medical - Add AI Unconsciousness exception (when using zeus module) May 8, 2022
@PabstMirror PabstMirror merged commit e994906 into acemod:master May 8, 2022
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.

6 participants