Skip to content

iplocator/Pulse-AI-Yield

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pulse-ai-yield

Improves ambient NPC traffic reactions around emergency vehicles with active sirens.

The resource runs client-side. Each player locally scans nearby player-driven emergency vehicles and gently retasks nearby NPC traffic to move away, pull right, slow down, or briefly hold position.

Install

Place the resource in:

resources/[pulse]/pulse-ai-yield

If server.cfg already contains:

ensure [pulse]

then the resource will start with the rest of the Pulse resources after a server restart.

For immediate testing:

ensure pulse-ai-yield

How It Works

  • Detects nearby player vehicles with sirens on.
  • Treats vehicle class 18 as emergency by default.
  • Scans nearby NPC traffic from the game vehicle pool.
  • Ignores player vehicles, emergency vehicles, empty vehicles, dead drivers, mission vehicles, and parked vehicles.
  • Retasks NPC drivers with short cooldowns so the script does not spam AI tasks every frame.

Config

Edit config.lua.

Important settings:

Config.ScanRadius = 115.0
Config.FrontConeDegrees = 130.0
Config.SideRadius = 42.0
Config.BehindRadius = 18.0
Config.RetaskCooldown = 2600
Config.PullRightDistance = 3.8
Config.PullForwardDistance = 18.0
Config.YieldSpeed = 4.5

Useful tuning:

  • Increase ScanRadius if traffic should react earlier.
  • Increase SideRadius if cross traffic should brake/hold earlier.
  • Lower RetaskCooldown if NPCs feel slow to react.
  • Raise RetaskCooldown if traffic looks twitchy.
  • Increase PullRightDistance slightly if same-direction vehicles are not clearing enough room.
  • Avoid enabling AlwaysAvoidRadius unless testing, because all-direction avoidance can make NPCs turn unpredictably.

Custom Emergency Vehicles

Most proper police/EMS/fire vehicles should use GTA vehicle class 18.

If a custom emergency vehicle does not, add its spawn name:

Config.EmergencyModels = {
    ['polbuffalo'] = true,
    ['my_custom_ambo'] = true,
}

Notes

This does not permanently rewrite GTA traffic AI. It applies short local tasks to NPC drivers around active emergency vehicles. That keeps it lightweight and avoids server-wide entity control issues, but behavior can still vary based on road layout, density, and GTA pathfinding.

If traffic overreacts, reduce ScanRadius, SideRadius, or raise RetaskCooldown.

About

Makes ambient AI traffic yield more consistently to emergency vehicles with sirens.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages