npc_soldier_assault

From Valve Developer Community
Jump to navigation Jump to search
An npc_soldier_assault prefab.

A prefab located in the Prefabs HL2 folder, containing a script setup that will handle an assault of a squad of four Combine soldiers.

This prefab contains the following:

  • Four npc_combine_s NPC templates (numbered from 1 to 4), to be used as the assaulting squad.
  • A point_template entity to spawn them.
  • A logic_relay entity that when triggered will trigger the spawning and assault.
  • An ai_goal_assault entity that will make the spawned soldiers proceed to their designated assault_rallypoints, and then proceed to their assault_assaultpoints as the assault commences.
  • Four assault_rallypoint positions.
  • Four assault_assaultpoint positions.

Fixing this prefab

This prefab doesn't work properly as-is because of the misuse of wildcards.

Locate the ai_goal_assault entity, and do the following:

  1. Change Rally Point Set from soldier_assault1_rally3* to soldier_assault1_rally*.
  2. Change Actor(s) to affect from soldier_assault1_soldier1* to soldier_assault1_soldier*.

Also, the "&i" tokens in the Squad Name value of the npc_soldier_s doesn't work, so if you intend to use multiple sets of this prefab in a map, you should change soldier_assault&i_squad to something different for each assault squad to prevent them from communicating visuals with each other.

Finally, remember that you do have to have something there in addition to what is in the prefab to trigger the logic_relay entity, or nothing at all will happen -- some sort of trigger or a logic_auto to trigger the logic_relay when the map loads. The soldiers won't do anything very interesting unless you set some info_node points to indicate possible paths for them, either.