Tutorials
Head Crab Canister
So. On to env_headcrabcanisters, home to all manner of lovely gribbly things. Well. Home to headcrabs, anyway.
There are three main ways to use an env_headcrabcanister.
Method 1; a stationary, 'already landed' env_headcrabcanister.
Method 2; an 'targetted' env_headcrabcanister.
Method 3; a 'non-targetted' env_headcrabcanister.
All three of these methods require a trigger_once, or the like, if you wish to actually spawn headcrabs or have the env_headcrabcanister actually do anything at all.
Method 1; Stationary.
Place your env_headcrabcanister where you would like it to be in the game. I'd suggest putting it in a crater, or at the very least putting scorch marks on the ground where it has supposedly impacted.
Rotate it as you require, remembering that the headcrabs need space to come out if you want them to spawn.
Give the env_headcrabcanister a name, then set the headcrab type, and the number of headcrabs you wish to spawn. You can, if you wish, adjust the amount of time the env_headcrabcanister emits smoke for, too.
Now, we go to the flags. This is where the main differences between the methods arise.
We want the env_headcrabcanister to have already launched. What we now need to decide is what we want the env_headcrabcanister to do; whether it should spawn some headcrabs, or be a piece of the scenery. I'll assume, for the sake of this tutorial, that we want to spawn some headcrabs.
Check Start Impacted. This will make the env_headcrabcanister start where you place it in Hammer.
Check Wait for input to open and Wait for input to spawn headcrabs. Ordinarily, when an env_headcrabcanister impacts the ground, it'll do these things itself. We want it to be triggered by the player walking near it, however.
Create a trigger_once around the env_headcrabcanister. Two outputs are required for the OnTrigger event; OpenCanister and SpawnHeadcrabs. Make sure you set the delay on SpawnHeadcrabs to at least 0.75, otherwise the headcrabs will be unable to spawn.
Compile and run. Move into the trigger, and wait for the env_headcrabcanister to open...
Method 2; Targetted.
Set the env_headcrabcanister up as before; place it where you want it to end up in the level, and set the number of headcrabs it creates and such. I'd suggest leaving the speed and flight time unchanged; the default values look good enough to me.
Instead of checking Start Impacted, however, use Land at initial position. For the sake of this tutorial, leave everything else unchecked.
Use the trigger_once to target the env_headcrabcanister's input of FireCanister.
Compile, and run. Move into the trigger, and wait for the Flight time...
...I'd suggest not standing where it's likely to hit, incidentally.
The env_headcrabcanister will take Flight time seconds, moving at the Flight speed, to impact where you have already put it.
The flight path is generated by checking the angle at which the env_headcrabcanister is meant to land at, the Flight time, and the Flight speed. It will be drawn in the 3d skybox, if one exists.
It will ignore scenery, and fly directly through it as if it is not there.
Method 3; Non-Targetted.
This final method is best used for firing env_headcrabcanisters inside the skybox, mainly as eye candy than to actually interact with the world.
The env_headcrabcanister can be placed in the skybox. It can then be fired by a trigger, after being aimed and having its Flight time and Flight speed adjusted. It will fly through the air, and impact wherever the values take it.
I'd suggest the best way to use this method is to fire the env_headcrabcanister over the head of the player (as in, still inside the 3d skybox), with the flag Remove on impact checked. In this way, you can simulate multiple env_headcrabcanister launches without the whole mess of headcrabs at the end.
Trust me, it looks quite scary to see fifteen env_headcrabcanister fly over your head.
If the env_headcrabcanisters hit the skybox containing the player at any point, they will continue on into it. This can have the side effect of moving the env_headcrabcanister somewhat, and generating a strange vapour trail. Hence, I advise using Method 2 to actually introduce an env_headcrabcanister into the world.
This method can also be used to fire env_headcrabcanisters in a random pattern inside of the skybox, of course, but for best results in a single player game I'd again suggest using Method 2.
Have fun.
Noctu
