Overview
We all have those moments when we need to kill a virtual npc_vr_citizen_female or npc_vr_citizen_male in Virtual Reality. What did they ever do to you? Nothing? Ah well, in this tutorial I will be showing how to set up one of these poor virtual souls so they die in a convincing way when shot.
Setup NPC
Use the entity tool to create an npc_vr_citizen_female or npc_vr_citizen_male – make sure you use the VR ones, not the standard npc_citizen as that doesn’t work.
Double click the NPC with any selection tool (or press Alt+Enter) to open the object properties.
Give your NPC a name. Remember this name, we’ll be using it in the next step!
Object Properties
In the Object Properties window, click the Outputs tab!
I have set up 3 different interactions that generate outputs depending on what happens.
At the bottom of this window should be the Add button – click it! Now use the dropdown boxes like so:
“My output named”:
- OnDamagedByPlayer – Damage dealt by the player
- OnDamaged – Damage dealt by… anything? If you have a Combine shoot this character, maybe use this? Honestly I don’t quite know the difference.
- OnDeath – When the NPC’s health is 0
Use these to trigger whatever you want to do whenever an NPC is damaged, but the most important one you need is OnDeath, so let’s follow my OnDeath setup.
“Target entities named”: insert your NPC name here.
“Via this input”: Use BecomeRagdoll. The NPC, when enough damage is taken (which appears to be just 1 bullet from a pistol), will now ragdoll elegantly onto the floor.
Leave the other inputs blank, unless you want to create something like this!
Profit
Congratulations. You have successfully created someone who can convincingly flop over when killed.
Happy map-making!