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

AI hooks and navmesh rebaking modifiers

Open read-0nly opened this issue 9 months ago • 1 comments

Adds the following hooks:

  • AI\OnAICaresAbout
  • AI\OnAIInitialize
  • NPC\OnGetBestRoamPoint
  • Turret\OnTurretCheckHostile
  • Turret\OnTurretShouldTarget

Adds the following modifiers:

  • BaseNavigator::defaultArea
  • BaseNavigator::navMeshQueryFilter
  • DungeonNavmesh::HasBuildOperationStarted
  • DungeonNavmesh::agentTypeId
  • DynamicNavMesh::HasBuildOperationStarted
  • DynamicNavMesh::agentTypeId
  • MonumentNavMesh::HasBuildOperationStarted
  • MonumentNavMesh::agentTypeId

The modifiers are just to allow rebaking navmesh so NPCs can roam freely. Niche application but would be nice to not have to custom patch each time

The AI hooks allow insertion of custom state behaviors as well as custom control of AI targeting (both to filter out normal targets and to inject abnormal ones). The NPC GetBestRoampoint lets you change how roam points are picked so they're not tied to AIInformationZones for free-roaming. The turret hooks allow custom targeting logic (like targeting NPCs and animals)

Usecase plugins: Psilocybin and cordyceps are utility plugins that allow custom event-state mapping and injection of custom state behaviors, AIZLiberator lets them free-roam and changes aspects of combat and chase behaviors, as well as hijacks takecover to mostly make them pick nearby spots because otherwise they try to run across the map to get to some AIZ-tied cover point. Navmesher rebackes the navmesh and tries to add some obstacles to things like cactii so the NPC stop running into them repeatedly. Admittedly, that lat part isn't working as ell as I hoped, it's a WIP. The full thing is built in layers and I've only added the lowest layers as a minimum-viable example Example usecase.zip

Hooks in isolation: AIPlus.opj.txt

read-0nly avatar May 22 '24 17:05 read-0nly