Simple NPC Strafing

If you liked this item, please rate it up on Steam Workshop page.

Author: PurpzXSLIDE

Last revision: 23 Jan at 06:09 UTC

File size: 7.42 KB

On Steam Workshop

Description:
Simple NPC Strafing

Makes Source engine NPCs smarter during combat by forcing them to strafe and dodge instead of standing still. This is a lightweight script that runs alongside existing AI, meaning it works with almost any faction or gamemode.

Features

  • Tactical Movement: NPCs will side-step and dodge when fired upon.
  • Dynamic Speed: They will walk during short strafes to keep their gun steady, and sprint during long strafes to cover ground quickly.
  • Smart Spacing: If an enemy gets too close (within ~30ft), NPCs will prioritize backing away to maintain a tactical distance.
  • Weapon Awareness:
    • Rifles/SMGs: Will try to keep distance and dodge frequently.
    • Shotguns: Will hold their ground and are less likely to retreat, allowing them to actually shoot.
    • Melee: Melee units (Stunsticks/Crowbars) will NOT strafe, so they don’t dodge away from you while trying to hit you.
  • Readiness: Forces Combine/Metrocops to keep their weapons raised while moving for better reaction times.

Configuration

You don’t need to use console commands anymore. The mod comes with a full settings panel.

Go to: Spawnmenu (Q) > Options > Simple NPC Strafing

You can adjust:

  • Strafe Chance: How often they dodge.
  • Cooldown: How fast they react.
  • Distances: Min/Max engage distance and "Keep Distance" thresholds.

Optimization & Compatibility

  • Optimized: Uses a timer-based system rather than a tick hook. It filters out non-weaponized NPCs (Zombies, Antlions) immediately to save performance.
  • Compatibility: Works with "iNPC", "Combine Soldiers+", and standard Half-Life 2 NPCs.