Half-Life: Alyx

Half-Life: Alyx

Expand the world of Half-Life: Alyx
Browse the Half-Life: Alyx Workshop to find the best new addons created by the community, or install the free tools yourself and start making your own Half-Life: Alyx content.
Learn More
JediPunk 3 30 Jul, 2023 @ 1:27am
spawn a npc_zombie without the headcrab
Hello,

this is how to spawn a npc_zombie without the headcrab on the head.

general logic:
the "npc_zombie" has a input called "ToggleHead" with the parameter "0" and "1". this input toggle the visibility for the headcrab on the zombie. But when the npc_zombie die, the dead headcrab will be visible again and just fall out of the npc_zombie. To solve the headcrab issue and keep the npc_zombie headcrab free, i dont actually kill the zombie. But it looks like it. I use a "math_counter" to count the hits the npc_zombie receive. After 10 hits with a bullet (or any other hit), the "math_counter" say the npc_zombie to ragdoll. That means the npc_zombie fall to the ground like dead. To prevent the npc_zombie from dying, because dying makes the headcrab visible again, i overide the health from the zombie to a high number (like 2000). After all it looks like the npc_zombie drop dead from bullet damage.

One issue appear asap. All other damage sources like a explosion (barrel, grenade) wont kill the zombie or drop it. To solve that it needs further investigation.

Lets Go!!
_______________________________________________________________

1. In the first gif you see how it looks when the headcrab is toggled off but reappear when the npc_zombie die.
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3012142345

2. In the second gif you see the npc_zombie drop "dead" (its not dead it just ragdoll on comman) without the headcrap reappearing.
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3012143324


3. i try to show the whole system but you need to understand how to use the entities i use.
1. npc_zombie = this is the enemy zombie we want to spawn without the headcrab. The npc_zombie give output when hit. Every hit the math_counter will count.
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3012150243

2. trigger_multiple = this trigger gonna forcespawn the npc from the point_template. any trigger can do.

3. point_template = the point template spawn the npc_zombie and override the npc_zombie health to a high number (2000hp). It prevents the zombie from dying. Thats basically the reason why the headcrab not spawn. It also enable the math_counter. It also toggle the visibility for the headcrab. In picture 5 (point 5) i show the input/output and parameter.
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3012150788

4. math_counter = this entity is counting the hits the npc_zombie receive. When the npc_zombie get 10 hits, the match counter force the npc_zombie to ragdoll. It looks like it drop dead but it is not dead.
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3012151798

5. like visible in the picture below (red square) i use a input named "ToggleHead" with the parameter "0". When the point_template "ForceSpawn" the "npc_zombie" by a "trigger_multiple" it also output the "ToggleHead" "0" and remove the headcrab shotly after the npc_zombie appear.
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3012026124
______________________________________________________________

I hope you can understand how this works. I tryed to create a video tutorial but it is realy hard to do for me. Maybe its at least a inspiration for better solution.
feedback is welcome.
< >
Showing 1-2 of 2 comments
...BadLucky 30 Jul, 2023 @ 9:46am 
1. Have you handled the death SFX?

I've been wanting to override the obnoxiously loud (and fake) death effect but haven't gotten 'round to it (and there's the issue of it possibly being one of the core effects that are notoriously difficult to mod/work-around....but in your case it can duplicated for use in map logic).

2. You can do clever things with the OnHalfHealth outputs (or whatever its called), it's a genuinely simple way to have zombies count their own health and trigger early outputs (but might be based on code/cfg stats, not entity).

. . . . I like using 'halfhealth' to require some burst damage during an appropriately forgiving time window (else they regenerate a small portion)... it makes zombies seem tougher when it counts while still being realistically vulnerable at the same time.
Last edited by ...BadLucky; 30 Jul, 2023 @ 9:49am
JediPunk 3 30 Jul, 2023 @ 12:09pm 
Originally posted by ...BadLucky:
1. Have you handled the death SFX?

I've been wanting to override the obnoxiously loud (and fake) death effect but haven't gotten 'round to it (and there's the issue of it possibly being one of the core effects that are notoriously difficult to mod/work-around....but in your case it can duplicated for use in map logic).

2. You can do clever things with the OnHalfHealth outputs (or whatever its called), it's a genuinely simple way to have zombies count their own health and trigger early outputs (but might be based on code/cfg stats, not entity).

. . . . I like using 'halfhealth' to require some burst damage during an appropriately forgiving time window (else they regenerate a small portion)... it makes zombies seem tougher when it counts while still being realistically vulnerable at the same time.


hello ...BadLucky,

the npc_zombie dont die in my scenario. it just go ragdoll after get hit by bullets after a couple shots. Any death related behavior for the npc_zombie dont get activated.

the npc_zombie wont make any death noise when dropping. it just goes down silent. honestly it felt just right the way i moded this. but if you want , you can add a death sound effect when the npc_zombie drop to the ground.


it would be nice if you or someone else tryout my idea and send some feedback about it here.

i hope i understand your post right. i might have missunderstood something because my english is rusty. i apologise for that.
< >
Showing 1-2 of 2 comments
Per page: 1530 50