Env headcrabcanister: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Explain SkyboxCannisterCount.)
(noted 3(!) keyvalues that are in the FGD but not in code.)
Line 1: Line 1:
{{lang|Env headcrabcanister}}
{{lang|Env headcrabcanister}}
[[File:Headcrabcanister.jpg|frame|right]]
[[File:Headcrabcanister.jpg|frame|right]]
{{hl2 point|env_headcrabcanister}} The canister is a mortar shell containing a payload of [[headcrab]]s. The mortar shell inflicts damage within a radius of where it lands and releases headcrabs after impact. [[Input]]s and [[entity]] options offer control over impact damage and when the headcrabs are released, among other options.
{{hl2 point|env_headcrabcanister}} The canister is a mortar shell containing a payload of [[headcrab]]s. The mortar shell inflicts damage within a radius of where it lands and releases headcrabs after impact. Inputs and keyvalues offer control over impact damage and when the headcrabs are released, among other options.


For an example of their use, see the shantytown in {{ent|d1_canals_05}}.
For an example of their use, see the shantytown in {{ent|d1_canals_05}}.
{{stray ent|{{portal}}}}


{{code class|CEnvHeadcrabCanister|env_headcrabcanister.cpp}}
{{code class|CEnvHeadcrabCanister|env_headcrabcanister.cpp}}
Line 10: Line 12:
{{varcom|start}}
{{varcom|start}}
{{varcom|sk_env_headcrabcanister_shake_amplitude|50|Arbitrary decimal (float)|Crash effect's shake amplitude. Though the default is 50, the shake amplitude can only go up to 16.}}
{{varcom|sk_env_headcrabcanister_shake_amplitude|50|Arbitrary decimal (float)|Crash effect's shake amplitude. Though the default is 50, the shake amplitude can only go up to 16.}}
{{varcom|sk_env_headcrabcanister_shake_radius|1024|dist|Radius the player must be within for the screen shake effect to occur. Shake amplitude is gradually decreased for the player depending on where they are between the explosion center and this distance away.}}
{{varcom|sk_env_headcrabcanister_shake_radius|1024|dist|Radius the player must be within for the screen shake effect to occur. Shake amplitude is gradually decreased the farther away from the explosion the player is.}}
{{varcom|sk_env_headcrabcanister_shake_radius_vehicle|2500|dist|As above, but when in a vehicle.}}
{{varcom|sk_env_headcrabcanister_shake_radius_vehicle|2500|dist|As above, but when in a vehicle.}}
{{varcom|end}}
{{varcom|end}}
Line 32: Line 34:
:*2: Poison Headcrabs}}
:*2: Poison Headcrabs}}
{{KV|Headcrab count (HeadcrabCount)|int|Number of headcrabs to spawn on impact.}}
{{KV|Headcrab count (HeadcrabCount)|int|Number of headcrabs to spawn on impact.}}
{{KV|Flight Speed (FlightSpeed)|float|Speed to fly through the air.}}
{{KV|Flight Time (FlightTime)|float|Time to fly through the air in seconds.}}
{{KV|Starting Height (StartingHeight)|float|Relative height from the landing position at which the canister should be launched. Positive values mean launch it above the impact point, negative values mean launch it below.}}
{{KV|Min Refire time (MinSkyboxRefireTime)|float|Min number of seconds before the canister is refired. This will only work for canisters placed in the skybox.}}
{{KV|Min Refire time (MinSkyboxRefireTime)|float|Min number of seconds before the canister is refired. This will only work for canisters placed in the skybox.}}
{{KV|Max Refire time (MaxSkyboxRefireTime)|float|Max number of seconds before the canister is refired. This will only work for canisters placed in the skybox.}}
{{KV|Max Refire time (MaxSkyboxRefireTime)|float|Max number of seconds before the canister is refired. This will only work for canisters placed in the skybox.}}
Line 42: Line 41:
{{KV|Smoke duration (SmokeLifetime)|float|Duration that the canister smokes. -1 means always smoke.}}
{{KV|Smoke duration (SmokeLifetime)|float|Duration that the canister smokes. -1 means always smoke.}}
{{KV|Launch Position Name (LaunchPositionName)|target_destination|If the canister should launch to its origin from another point within the world, this should specify an {{ent|info_target}} at the launch origin.}}
{{KV|Launch Position Name (LaunchPositionName)|target_destination|If the canister should launch to its origin from another point within the world, this should specify an {{ent|info_target}} at the launch origin.}}
{{KV|Flight Speed (FlightSpeed)|deprecated=1|float|Speed to fly through the air. Not present in code.}}
{{KV|Flight Time (FlightTime)|deprecated=1|float|Time to fly through the air in seconds. Not present in code.}}
{{KV|Starting Height (StartingHeight)|deprecated=1|float|Relative height from the landing position at which the canister should be launched. Positive values mean launch it above the impact point, negative values mean launch it below. Not present in code.}}
{{KV BaseAnimating|base=1}}
{{KV BaseAnimating|base=1}}
{{KV BaseEntity|base=1}}
{{KV BaseEntity|base=1}}

Revision as of 06:43, 17 September 2018

English (en)Translate (Translate)
Headcrabcanister.jpg

Template:Hl2 point The canister is a mortar shell containing a payload of headcrabs. The mortar shell inflicts damage within a radius of where it lands and releases headcrabs after impact. Inputs and keyvalues offer control over impact damage and when the headcrabs are released, among other options.

For an example of their use, see the shantytown in d1_canals_05.

Note.pngNote:This entity is also in the code for Portal. Its functionality is not guaranteed.


C++ In code, it is represented by theCEnvHeadcrabCanisterclass, defined in theenv_headcrabcanister.cppfile.

ConVars/Commands

Cvar/Command Parameters or default value Descriptor Effect
sk_env_headcrabcanister_shake_amplitude 50 Arbitrary decimal (float) Crash effect's shake amplitude. Though the default is 50, the shake amplitude can only go up to 16.
sk_env_headcrabcanister_shake_radius 1024 Hammer units Radius the player must be within for the screen shake effect to occur. Shake amplitude is gradually decreased the farther away from the explosion the player is.
sk_env_headcrabcanister_shake_radius_vehicle 2500 Hammer units As above, but when in a vehicle.

Flags

  • 1: No Impact Sound
  • 2: No Launch Sound
  • 4096: Start Impacted
  • 8192: Land at initial position
  • 16384: Wait for input to open
  • 32768: Wait for input to spawn headcrabs
  • 65536: No smoke
  • 131072: No shake
  • 262144: Remove on impact
  • 524288: No impact effects

Keyvalues

Which headcrab to Spawn? (HeadcrabType) ([todo internal name (i)]) <choices>
Select which headcrab will jump out the canister.
  • 0: Normal headcrabs
  • 1: Fast Headcrabs
  • 2: Poison Headcrabs
Headcrab count (HeadcrabCount) ([todo internal name (i)]) <integer>
Number of headcrabs to spawn on impact.
Min Refire time (MinSkyboxRefireTime) ([todo internal name (i)]) <float>
Min number of seconds before the canister is refired. This will only work for canisters placed in the skybox.
Max Refire time (MaxSkyboxRefireTime) ([todo internal name (i)]) <float>
Max number of seconds before the canister is refired. This will only work for canisters placed in the skybox.
Canister count (SkyboxCannisterCount) ([todo internal name (i)]) <integer>
Number of canisters to produce and fire across the skybox. The target should be positioned inside the skybox. 0 means fire continuously, forever.
Impact damage (Damage) ([todo internal name (i)]) <float>
Max damage the canister applies on impact.
Impact damage Radius (DamageRadius) ([todo internal name (i)]) <float>
Max radius of the impact damage for the canister.
Smoke duration (SmokeLifetime) ([todo internal name (i)]) <float>
Duration that the canister smokes. -1 means always smoke.
Launch Position Name (LaunchPositionName) ([todo internal name (i)]) <targetname>
If the canister should launch to its origin from another point within the world, this should specify an info_target at the launch origin.
Flight Speed (FlightSpeed) ([todo internal name (i)]) <float> Obsolete
Deprecated.
Speed to fly through the air. Not present in code.
Flight Time (FlightTime) ([todo internal name (i)]) <float> Obsolete
Deprecated.
Time to fly through the air in seconds. Not present in code.
Starting Height (StartingHeight) ([todo internal name (i)]) <float> Obsolete
Deprecated.
Relative height from the landing position at which the canister should be launched. Positive values mean launch it above the impact point, negative values mean launch it below. Not present in code.
Note.pngNote:Content moved to Rendering and studio model related KIO/Keyvalues for continuation of page history


Inputs

FireCanister
Fires the canister.
OpenCanister
Opens the canister (must be called after the OnImpacted output is fired).
SpawnHeadcrabs
Spawns headcrabs (must be called after the OnImpacted output is fired and after OpenCanister is triggered, if the Wait for Input to open' flag is checked).)
StopSmoke
Causes the smoke effect to stop.
Note.pngNote:Content moved to Rendering and studio model related KIO/Inputs for continuation of page history


Outputs

OnLaunched <targetnameRedirectInput/string>
Fired when the canister is launched. This output automatically puts the targetname of the canister into the parameter box for inputs, if the mapper does not override the parameter with something else.
OnImpacted
Fires when canister hits the ground.
OnOpened
Fires when canister has finished opening.
Note.pngNote:Content moved to Rendering and studio model related KIO/Outputs for continuation of page history