npc_launcher

From Valve Developer Community
Jump to navigation Jump to search
Class hierarchy
CNPC_Launcher
CAI_BaseNPC
CBaseCombatCharacter
CBaseFlex
CBaseAnimatingOverlay
CBaseAnimating
CBaseEntity
npc_launcher.cpp

npc_launcher is a model entity available in Half-Life 2 series Half-Life 2 series, Portal Portal, and Source SDK BasesSource SDK BasesSource SDK Bases Source SDK Bases.

Can fire rocket-propelled grenades or other missiles with many property customizations. The missiles can be made to home on a target or follow a path. It is used in d3_c17_06b when rockets break up a wood bridge. Also used in d1_eli_02 to simulate the Combine APC rockets when the base is getting attacked.

Keyvalues

Start On (StartOn) <boolean>
Will the launcher be active at spawn?
Missile Model (MissileModel) <model path>
The model for the fired missile
Warning.pngWarning:This KV's default value doesn't point to an existing resource. It should instead point to models/Weapons/W_missile.mdl.
Launch Sound (LaunchSound) <string>
Sound when the missile launches
Fly Sound (FlySound) <string>
The sound the missile makes in air
Warning.pngWarning:This KV's default value doesn't point to an existing resource. It should instead point to weapons/rpg/rocket1.wav.
Smoke Trail (SmokeTrail) <choices>
What trail the missile leaves behind
  • 0: Off
  • 1: On
  • 2: On Homing
Launch Smoke (LaunchSmoke) <boolean>
Is there smoke on launch?
Launch Delay (LaunchDelay) <integer>
When ON, how long to wait between each launch
Launch Speed (LaunchSpeed) <string>
Initial launch speed of missile (in up direction)
Path Corner Name (PathCornerName) <string>
Name of a path corner. If set launches a pathfollowing missing, rather than a homing missile
Homing Speed (HomingSpeed) <string>
Speed to reach when homing
Homing Strength (HomingStrength) <integer>
How strong in homing effect (0-100)
Homing Delay (HomingDelay) <string>
Number of seconds to delay before homing starts
Homing Ramp Up (HomingRampUp) <string>
Number of seconds it takes to reach full homing strength after homing delay
Homing Duration (HomingDuration) <string>
Number of seconds the homing effect lasts
Homing Ramp Down (HomingRampDown) <string>
Number of seconds it takes homing effect to decay after homing duration
Gravity (Gravity) <string>
Min Range (MinRange) <integer>
Minimun distance a target can be to be attacked
MaxRange (MaxRange) <integer>
Maximum distance a target can be to be attacked
Spin Magnitude (SpinMagnitude) <string>
Strength of spin in missile trajectory
Spin Speed (SpinSpeed) <string>
How fast does the spin rotate through 360
Damage (Damage) <string>
How much damage does each missile do
DamageRadius (DamageRadius) <string>
How far away from impact does the missle do damage
BaseNPC keyvalues

CBaseCombatCharacter:

Relationship (Relationship) <string> !FGD
<string|targetname or classname> <string|disposition> <int|rank>
Changes whether this entity likes or dislikes certain other things. Used like the ai_relationship entity, with this entity as the subject.
Values for disposition are:
  • D_HT: Hate
  • D_FR: Fear
  • D_LI: Like
  • D_NU: Neutral
Physics Impact Damage Scale (physdamagescale) <float>
Multiplier for damage amount when this entity is hit by a physics object. With a value of 0 the entity will take no damage from physics.

CAI_BaseNPC:

Target Path Corner (target) <targetname>
The path_corner that this NPC will move to after spawning.
Squad Name (squadname) <string>
NPCs that are in the same squad (i.e., have matching squad names) will share information about enemies and will take turns attacking and covering each other.
Hint Group (hintgroup) <string>
Hint groups are used by NPCs to restrict their hint-node searching to a subset of the map's hint nodes. Only hint nodes with matching hint group names will be considered by this NPC.
Hint Limit Nav (hintlimiting) <boolean>
Limits NPC to using specified hint group for navigation requests. Does not limit local navigation.
Sleep State (sleepstate) <choices>
Holds the NPC in stasis until specified condition. See also Wake Radius and Wake Squad.
  • 0: None
  • 1: Waiting for threat
  • 2: Waiting for PVS
  • 3: Waiting for input, ignore PVS
  • 4: Auto PVS
  • 5: Auto PVS after PVS
Wake Radius (wakeradius) <float>
Auto-wake if player comes within this distance.
Wake Squad (wakesquad) <boolean>
Wake all of the NPCs squadmates if the NPC is woken.
Enemy Filter (enemyfilter) <targetname>
Filter entity to test targets against.
Ignore unseen enemies (ignoreunseenenemies) <boolean>
Prefers visible enemies, regardless of distance or relationship priority.

DamageFilter:

Damage Filter (damagefilter) <targetname>
Name of the filter_damage_type entity that controls which entities can damage us.

Flags

Check LOS : [65536]
BaseNPC flags 


Inputs

TurnOn
Turn on Launcher
TurnOff
Turn off Launcher
LOSCheckOn
Start checking line of sight before firing
LOSCheckOff
Stop checking line of sight before firing
SetEnemyEntity
Set entity I should attack. Ignores visibility. (output from other entity only)
ClearEnemyEntity
Clear set enemy enemy
FireOnce
Fire Once (if have enemy)
BaseNPC inputs 

Outputs

OnLaunch
!activator = enemy launched at
!caller = this entity
Fires when missile is launched.
BaseNPC Outputs
OnDamaged
Fired when this NPC takes damage (!activator is the damage inflictor).
OnDamagedByPlayer
Fired when this NPC is hurt by a player (!activator is the attacker or vehicle driver [if friendly fire]).
OnDamagedByPlayerSquad
Fired when this NPC is hurt by a player OR by one of the player's squadmates (!activator is the attacker or vehicle driver [if friendly fire]).
OnDeath
Fired when this NPC is killed (!activator is the killer).
OnDenyCommanderUse
Fired when this NPC has refused to join the player's squad.
OnForcedInteractionAborted
Fired when the NPC aborts a forced interaction for some reason (target NPC died, couldn't be pathed to, etc.).
OnForcedInteractionStarted
Fired when the NPC starts a forced interaction.
OnForcedInteractionFinished
"NPCs in actbusies can no longer perform dynamic interactions."
Todo: What does this mean?
OnHalfHealth
Fired when this NPC reaches half of its maximum health.
OnHearCombat
Fired when this NPC hears combat sounds.
OnHearPlayer
Fired when this NPC hears the player.
OnHearWorld
Fired when this NPC hears a sound (other than combat or the player).
OnFoundEnemy <targetname*RedirectOutput/ehandle>
Fired when this NPC establishes line of sight to its enemy.
OnLostEnemy
Fired when this NPC loses its enemy. Usually due to the enemy being killed/removed, or because this NPC has selected a newer, more dangerous enemy.
OnLostEnemyLOS
Fired when this NPC loses line of sight to its enemy.
OnFoundPlayer <targetname*RedirectOutput/ehandle>
Fired when this NPC establishes line of sight to its enemy, and that enemy is a player.
OnLostPlayer
Fired when this NPC loses its enemy, and that enemy was a player. Usually due to the enemy being killed/removed, or because this NPC has selected a newer, more dangerous enemy.
OnLostPlayerLOS
Fired when this NPC loses line of sight to its enemy, and that enemy is a player.
OnSleep
Fired when this NPC enters a sleep state.
OnWake
Fired when this NPC comes out of a sleep state.