Advanced Usage: Useful AI Functions - spencershepard/RotorOps GitHub Wiki
Advanced Usage: Useful Functions with or without Conflict
External AI Tasks
The Conflict game type sets AI tasks automatically for units inside of the staging area or Conflict Zones. You can use these snippets for groups outside of these zones or for your missions that are not running a Conflict game. Again, you probably don't need these.
Group Name Task Assignment
Now you can automatically task ground units by including keywords in the group name.
- 'PATROL': Seek out objects in a small radius. If no objects or not enough objects, then random points within the radius. Infantry or vehicles.
- 'SHIFT': Periodically shift positions within a radius. Seek out roads in urban environments or random points in open environments. Vehicles.
- 'GUARD': Periodically seek out objects within a radius. Designed to simulate idle infantry movement.
- 'AGGRESSIVE': Seek out enemies in a radius.
- 'ACTIVEZONE': Move to the active conflict zone.
These can be used with the 'STATIC' keyword if you do not wish for them to be influenced by other zone-based automatic task assignments.
Set infantry or ground vehicles to patrol an area
Copy and paste this into a Run Script command (advanced waypoint actions) for a group to wander an area
local this_group = ...
RotorOps.aiTask(this_group, "patrol")
Set infantry or ground vehicles to find enemies in a radius
Copy and paste this into a Run Script command (advanced waypoint actions) for a group to seek out enemies in an area
local this_group = ...
RotorOps.aiTask(this_group, "aggressive")
Set infantry or ground vehicles to find enemies in a zone
Copy and paste this into a Run Script command (advanced waypoint actions) for a group to seek out enemies in a trigger zone
local this_group = ...
local zone_name = "changeme" --add the name of your zone
RotorOps.aiTask(this_group, "aggressive", zone_name)