Skip to content

Conversation

@Blixibon
Copy link
Collaborator

Allows specific Combine soldiers to act as medics or ammo resuppliers when specified by the mapper. This behavior was ported from citizens and functions identically to them.

This is in draft status due to two questions about the implementation:

  1. Every medic/ammo resupplier-related cvar is currently a distinct copy of an identical cvar used by citizens. The alternative would be to externally draw from the original citizen cvars, which may be simpler and more efficient, but would provide less control over any potential tweaks to soldier medics without also changing citizen medics.
  2. Soldiers currently use two new spawnflags for respectively becoming a medic or an ammo resupplier in the same way citizens have spawnflags, although they do not use the same bits. New spawnflags can be an issue if there's a chance forks of E:Z2 have custom spawnflags for soldiers, but this is unlikely.

@1upD I'm curious to hear if you have any input on these points

@Blixibon Blixibon requested a review from 1upD November 22, 2023 07:53
@GitHubUser53123

This comment was marked as spam.

int iAmmoType = GetAmmoDef()->Index( STRING(m_iszAmmoSupply) );
if ( iAmmoType == -1 )
{
DevMsg("ERROR: Citizen attempting to give unknown ammo type (%s)\n", STRING(m_iszAmmoSupply) );
Copy link

Choose a reason for hiding this comment

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

This should probably say "Combine", "Combine soldier", or "soldier". Maybe even insert the classname

@1upD
Copy link

1upD commented Feb 25, 2024

I feel very conflicted about how heavily this code copies from existing code in the citizen class. Citizens, vortigaunts, and now Combine soldiers need to heal. Maybe some day Metrocops will need to as well. I feel like there should be some way to share this feature between different NPCs, like perhaps making it part of the PlayerCompanion class or separating it into its own behavior. However, I also think that those approaches would risk changing the original functionality, which would not be desired. I think for that reason this is probably the best way to do it even if it is a little copy and paste heavy. It just makes me wish NPCs were more modular.

I also want to state that Combine soldiers not healing in EZ2 was a design choice and I think that was good for the overall narrative of the game. For those watching this PR, just for complete clarity, this functionality is for use in custom maps or future content. It's not something that will be seen in the main game.

@1upD
Copy link

1upD commented Feb 25, 2024

As far as the questions go:

  1. Separate ConVars is ideal so that Combine healing values can be tweaked separately from citizens.
  2. I think the concern about spawnflags is valid. Especially because these spawnflags wouldn't have parity with the Citizen spawn flags. I'd prefer to use a key value just in case.

@Yankumo-Koishi
Copy link

How's going about this? Haven't seen any activities in the months

@1upD
Copy link

1upD commented Aug 25, 2024

@Blixibon Do we need this PR to be merged for testing in the near future? It looks like it's still in draft status with unaddressed comments. No pressure if we don't need it, I just want to make sure it's not forgotten.

@Blixibon Blixibon force-pushed the ez2/feature/soldier-medic-abilities branch from 0a420c4 to b7d18c2 Compare January 31, 2025 19:08
@Blixibon
Copy link
Collaborator Author

I've addressed the concern regarding the spawnflags and force-pushed this branch to the latest version of ez2/mapbase in case of build automation errors.

@Blixibon Blixibon marked this pull request as ready for review January 31, 2025 19:09
@Blixibon Blixibon requested a review from 1upD January 31, 2025 19:10
else
{
if ( HasCondition( COND_COMBINE_PLAYERHEALREQUEST ) )
DevMsg( "Would say: sorry, need to recharge\n" );
Copy link

Choose a reason for hiding this comment

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

Nitpick, but this should have the debug name of the NPC

//-----------------------------------------------------------------------------
void CNPC_Combine::InputForceHealthKitToss( inputdata_t &inputdata )
{
TossHealthKit( UTIL_GetLocalPlayer(), Vector(48.0f, 0.0f, 0.0f) );
Copy link

Choose a reason for hiding this comment

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

It would be cool if we could use the input to specify another entity by targetname, but I digress

@1upD
Copy link

1upD commented Aug 19, 2025

This PR is ancient but I'm thinking of merging it before the next release. Maybe another smaller release before 2.0

@1upD 1upD self-requested a review September 1, 2025 03:31
ConVar sk_combine_heal_player_min_forced( "sk_combine_heal_player_min_forced", "10.0" );
ConVar sk_combine_heal_ally( "sk_combine_heal_ally", "30" );
ConVar sk_combine_heal_ally_delay( "sk_combine_heal_ally_delay", "20" );
ConVar sk_combine_heal_ally_min_pct( "sk_combine_heal_ally_min_pct", "0.90" );
Copy link

Choose a reason for hiding this comment

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

It looks like this and the following ConVars are unused

@1upD 1upD merged commit c89e456 into entropy-zero:ez2/mapbase Nov 11, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants