Talk:Npc launcher

From Valve Developer Community
Jump to: navigation, search

This entity seems to be used in Half-Life 2, in d1_eli_02. Can anyone else check other games? --RandomCatDude (talk) 19:35, 1 December 2018 (UTC)


Targeting a target

Using a trigger_multiple, logic_relay, and npc_launcher together. Make the trigger_multiple activate the logic_relay. Then we set the targetname of the !activator (of the trigger). The npc_launcher turns on, updates, fires. After the missile fires, we clear the target's targetname, forget it existed and turn off. I am not certain if the UpdateEnemyMemory/ForgetEntity is needed. Further testing is required.

logic_relay

OnTrigger !activator AddOutput targetname missile_target

OnTrigger <npc_launcher> SetEnemy missile_target


OnTrigger <npc_launcher> TurnOn

OnTrigger <npc_launcher> UpdateEnemyMemory

OnTrigger <npc_launcher> FireOnce


OnTrigger missile_target AddOutput targetname (make it a space or blank)

OnTrigger <npc_launcher> ForgetEntity

OnTrigger <npc_launcher> TurnOff

Notes

  • If the target is dead by time of launch, the missiles appear to head towards the ground.
  • If the target dies while the missiles are in-flight they appear to loop around the target. This will need to be fixed programmatically. Probably with a proximity detection to explode when in range of target.