Oxide.Rust icon indicating copy to clipboard operation
Oxide.Rust copied to clipboard

Add OnNearbyTurretsScan hook

Open WheteThunger opened this issue 1 year ago • 0 comments

object OnNearbyTurretsScan(AutoTurret turret, List<AutoTurret> nearbyTurrets, bool created)
{
    LogWarning($"OnNearbyTurretsScan works!");
    return null;
}
  • Called when an auto turret spawns or despawns, in order to determine which turrets are nearby
  • Returning non-null will cancel the default Vis.Entities call, allowing for an alternative searching implementation
  • The list that will be populated with the Vis.Entities call is passed to the hook, so plugins can simply use a void return type and add additional turrets that may not be found by the Vis.Entities call, such as turrets that don't have a collider on the Deployed layer (e.g., for Car Turrets or Drone Turrets)
  • Works similar to the OnSamSiteTargetScan hook

WheteThunger avatar Feb 13 '24 06:02 WheteThunger