Author Topic: [Suggestion] Can't use Medi-Kit on a mind-controlled unit  (Read 1210 times)

Online Delian

  • Colonel
  • ****
  • Posts: 382
    • View Profile
[Suggestion] Can't use Medi-Kit on a mind-controlled unit
« on: August 29, 2024, 12:32:49 pm »
In some cases (item medikitTargetMatrix = 31), when the player tries to use a medi-kit on a mind-controlled enemy unit, they're unable to do so, despite this unit technically being "friendly". What could be the problem?

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8889
    • View Profile
Re: Can't use Medi-Kit on a mind-controlled unit
« Reply #1 on: August 29, 2024, 12:40:40 pm »
The unit is still technically "enemy".
It's only seemingly "friendly".

Online Delian

  • Colonel
  • ****
  • Posts: 382
    • View Profile
Re: Can't use Medi-Kit on a mind-controlled unit
« Reply #2 on: August 29, 2024, 01:06:14 pm »
Ah, thanks for the quick answer.

Hmm. The player's units perceive the mind-controlled unit as their own. They can't fire at it, and they won't reaction fire when it moves around. So for any purpose of selecting targets, unit's current faction is normally used instead of the original faction. Am I wrong to think that this behavior should also apply to medi-kits?

ActionMenuState.cpp -> ActionMenuState::handleAction()
Code: [Select]
if ((weapon->getAllowTargetFriendGround() && bu->getOriginalFaction() == FACTION_PLAYER) ||
(weapon->getAllowTargetNeutralGround() && bu->getOriginalFaction() == FACTION_NEUTRAL) ||
(weapon->getAllowTargetHostileGround() && bu->getOriginalFaction() == FACTION_HOSTILE))
...
if ((weapon->getAllowTargetFriendStanding() && tile->getUnit()->getOriginalFaction() == FACTION_PLAYER) ||
(weapon->getAllowTargetNeutralStanding() && tile->getUnit()->getOriginalFaction() == FACTION_NEUTRAL) ||
(weapon->getAllowTargetHostileStanding() && tile->getUnit()->getOriginalFaction() == FACTION_HOSTILE))
« Last Edit: August 29, 2024, 01:12:54 pm by Delian »

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8889
    • View Profile
Re: Can't use Medi-Kit on a mind-controlled unit
« Reply #3 on: August 29, 2024, 01:15:20 pm »
I could compare "current faction" instead of "original faction".

Consequences of that would be:

1. you will not be able to heal a mind-controlled xcom soldier... which (in my personal opinion) is much worse than not being able to heal a mind-controlled alien

2. healing fatal wounds gives experience... which is balanced by soldier being wounded/out of service. Aliens however cannot be "out of service", so the balance would be broken... which is why modders asked me explicitly to implement the feature as it is today.

Original discussion is lost, but feel free to ask e.g. Dioxine.

Am I wrong to think that this behavior should also apply to medi-kits?

There's a lot of places in OXC and OXCE, where current faction is considered and also a lot of places where original faction is considered.

You're not wrong, but you're also not correct.
« Last Edit: August 29, 2024, 01:18:13 pm by Meridian »

Online Delian

  • Colonel
  • ****
  • Posts: 382
    • View Profile
Re: Can't use Medi-Kit on a mind-controlled unit
« Reply #4 on: August 29, 2024, 02:28:43 pm »
1. That sound logical. A mind-controlled xcom soldier would not allow anyone with a needle to touch them, same way as normal enemies don't (in case of matrix=31). The counter to enemy mind control has always been to mind-control the soldier back.

2. In XPZ, the exp provision wouldn't be affected by this change because most medi-kits that can heal fatal wounds have matrix=63 (e.g. Bandages), so they can already be used on enemies and give exp either way. There's a few exceptions, however, if the player wanted to train soldier exp, then they can always bring extra medi-kits with matrix=63.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8889
    • View Profile
Re: Can't use Medi-Kit on a mind-controlled unit
« Reply #5 on: August 29, 2024, 02:38:31 pm »
Fair enough.

As I said, it's intentionally implemented this way.

For a change, I'd need a request from (multiple) modder(s).
(and even then also an idea how to keep it backwards-compatible)

Offline Yankes

  • Commander
  • *****
  • Posts: 3290
    • View Profile
Re: Can't use Medi-Kit on a mind-controlled unit
« Reply #6 on: August 29, 2024, 02:47:40 pm »
On other hand how use "human" medkit on organism that have near noting in common with humans?
Most drugs can no effect on alien biology or even be poisonous.
I think this should be separate configs (like bigger bit flags) as current version have logical usage that is not possible in new version.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8889
    • View Profile
Re: Can't use Medi-Kit on a mind-controlled unit
« Reply #7 on: August 29, 2024, 02:52:15 pm »
In the original game, the medi-kit can already be used on aliens and mind-controlled aliens.

Sorry, but in the original, the aliens don't even bleed.

Online Delian

  • Colonel
  • ****
  • Posts: 382
    • View Profile
Re: Can't use Medi-Kit on a mind-controlled unit
« Reply #8 on: August 29, 2024, 03:04:14 pm »
For a change, I'd need a request from (multiple) modder(s).
(and even then also an idea how to keep it backwards-compatible)

I would consider the current behavior to be a bug, but we can also go with a suggestion I suppose. In that case, the topic can be moved to the suggestions subforum.

For backwards compatibility, uhh... mediKitUseOriginalFaction... something.

On other hand how use "human" medkit on organism that have near noting in common with humans?

In the original game, the medi-kit can already be used on aliens and mind-controlled aliens. What you're asking for is an ability to customize what sort of races a medi-kit could be used on. But that's far outside the scope of this topic.

Sorry, but in the original, the aliens don't even bleed.

Well, with Aliens Bleeding option on. Hmm. I wonder if you can use painkiller/stim on them...

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8889
    • View Profile
Re: Can't use Medi-Kit on a mind-controlled unit
« Reply #9 on: August 29, 2024, 03:22:29 pm »
In that case, the topic can be moved to the suggestions subforum.

Moved.

Well, with Aliens Bleeding option on.

Original doesn't have this option (or any option for that matter).
Not that it makes any difference for this discussion anyway.

Offline Ethereal

  • Commander
  • *****
  • Posts: 672
    • View Profile
Re: [Suggestion] Can't use Medi-Kit on a mind-controlled unit
« Reply #10 on: August 29, 2024, 06:19:18 pm »
By the way, are there any algorithms for the aliens to use first aid kits? Can they use first aid kits themselves, or is it an object of unknown purpose for them?

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8889
    • View Profile
Re: [Suggestion] Can't use Medi-Kit on a mind-controlled unit
« Reply #11 on: August 29, 2024, 08:49:55 pm »
By the way, are there any algorithms for the aliens to use first aid kits? Can they use first aid kits themselves, or is it an object of unknown purpose for them?

There is no support for AI to use medi-kits atm.

But it would be relatively easy to implement.
Self-heal that is.
Healing another unit would be more complicated.

Offline Ethereal

  • Commander
  • *****
  • Posts: 672
    • View Profile
Re: [Suggestion] Can't use Medi-Kit on a mind-controlled unit
« Reply #12 on: August 29, 2024, 09:15:29 pm »
There is no support for AI to use medi-kits atm.

But it would be relatively easy to implement.
Self-heal that is.
Healing another unit would be more complicated.

It would be great. It would also be nice to teach the AI ​​to use the other functions of the first aid kit. For example, if the stamina or morale at the start of the turn is less than 50%.

Offline yergnoor

  • Colonel
  • ****
  • Posts: 147
    • View Profile
Re: [Suggestion] Can't use Medi-Kit on a mind-controlled unit
« Reply #13 on: August 29, 2024, 10:48:43 pm »
But it would be relatively easy to implement.
Self-heal that is.
Healing another unit would be more complicated.
Just a crazy idea, is it possible to implement a weapon with negative damage that ignores armor?    Some opponents could then be turned into medics if they knew how to target wounded comrades below a certain health limit as targets for such weapons.    This weapon can be thought of as a kind of high-tech remote healing device, firing disposable injectors containing healing substances.

Offline Ethereal

  • Commander
  • *****
  • Posts: 672
    • View Profile
Re: [Suggestion] Can't use Medi-Kit on a mind-controlled unit
« Reply #14 on: August 30, 2024, 10:46:36 am »
Just a crazy idea, is it possible to implement a weapon with negative damage that ignores armor?    Some opponents could then be turned into medics if they knew how to target wounded comrades below a certain health limit as targets for such weapons.    This weapon can be thought of as a kind of high-tech remote healing device, firing disposable injectors containing healing substances.

This is already from the series "PSI-minigun".