Skip to content

Conversation

@ampreeT
Copy link
Owner

@ampreeT ampreeT commented Dec 18, 2025

Barnacles will now be instantly rewarded for a NPC kill and also trigger the NPC's outputs on grab. Tested on a Linux dedicated server with the following commands:

npc_create npc_human_grunt; ent_setname abc; ent_fire abc addoutput "OnDeath !player:AddOutput:rendercolor 255 0 0:0:-1"

Fixes half of #254.

Changes:

  • Barnacles will apply damage to their ragdoll as soon as they grab a NPC.

@ak47toh
Copy link
Contributor

ak47toh commented Dec 21, 2025

Hi @ampreeT. Unfortunately so far it didn't work for me. Using your command and spawning a Human Grunt just right the bottom of the Barnacle's tongue, it still requires completely swallowing/eating the grunt after pulling up only then it works.

Again, if you kill the Barnacle before it could eat/kill the Human Grunt, it will not count (kill messages also won't shows up "Barnacle killed Human Grunt"). Thus it will not trigger the red glow.

So far just tried out listen server. Will do this again in dedicated server and update you a bit.

@ampreeT
Copy link
Owner Author

ampreeT commented Dec 21, 2025

Hi @ampreeT. Unfortunately so far it didn't work for me. Using your command and spawning a Human Grunt just right the bottom of the Barnacle's tongue, it still requires completely swallowing/eating the grunt after pulling up only then it works.

Again, if you kill the Barnacle before it could eat/kill the Human Grunt, it will not count (kill messages also won't shows up "Barnacle killed Human Grunt"). Thus it will not trigger the red glow.

So far just tried out listen server. Will do this again in dedicated server and update you a bit.

Hey I wasn't able to reproduce the issue while using this PR on a Linux Dedicated Server. Were you seeing any errors in the console? See video below on map bm_c1a3b:

Screencast_20251221_150653.webm

@ak47toh
Copy link
Contributor

ak47toh commented Dec 22, 2025

I've just tried it in my Linux dedicated server and yes it worked. Also works well for other NPCs like Zombies and Headcrabs too.

However, it still doesn't work on listen server. Though I would like to stress that I'm using Windows when compiling the scripts and playing it locally. So in this part, its either listen version that doesn't work, or its the Windows issue.

@ak47toh
Copy link
Contributor

ak47toh commented Dec 22, 2025

Slightly unrelated question, are you able to look into the part when Barnacles are spawned via spawnmaking entities like npc_maker, the spawned Barnacle's OnAllLiveChildrenDead won't work to trigger events when they dies?

It's not an extremely priority fix since I had workarounds though, but would be good if there's a patch for it.

@Alienmario
Copy link
Collaborator

The barnacle might be missing this call, since it stays in the world.

// tell owner ( if any ) that we're dead.This is mostly for NPCMaker functionality.
CBaseEntity *pOwner = GetOwnerEntity();
if ( pOwner )
{
    pOwner->DeathNotice( this );
    SetOwnerEntity( NULL );
}

@ak47toh
Copy link
Contributor

ak47toh commented Dec 23, 2025

I've just tried it in my Linux dedicated server and yes it worked. Also works well for other NPCs like Zombies and Headcrabs too.

However, it still doesn't work on listen server. Though I would like to stress that I'm using Windows when compiling the scripts and playing it locally. So in this part, its either listen version that doesn't work, or its the Windows issue.

UPDATE: Windows/listen seems to work now after re-testing again. So looks good now.

@ampreeT ampreeT requested a review from Alienmario December 24, 2025 01:42
Copy link
Collaborator

@Alienmario Alienmario left a comment

Choose a reason for hiding this comment

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

Lgtm codewise.

@ampreeT
Copy link
Owner Author

ampreeT commented Dec 24, 2025

Slightly unrelated question, are you able to look into the part when Barnacles are spawned via spawnmaking entities like npc_maker, the spawned Barnacle's OnAllLiveChildrenDead won't work to trigger events when they dies?

It's not an extremely priority fix since I had workarounds though, but would be good if there's a patch for it.

Yeah, I'll look into this and address it in a new PR.

@ampreeT ampreeT merged commit 68b33b7 into master Dec 24, 2025
2 checks passed
@ampreeT ampreeT deleted the barnacle-npc-instant-kill branch December 24, 2025 02:18
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