Skip to content
Jakub Baranowski edited this page Dec 12, 2021 · 4 revisions

ai

CreateOverDuration(Duration, Amount, SpawnsTable, Tag)

Parameters:

  • Duration float Time in seconds. The time over which to spawn the AI. Also the AI will be frozen until this time runs out.
  • Amount int the amount of the AI to spawn.
  • SpawnsTable table{SpawnPoint} the table with all the spawn points to spawn the AI in. Will go from the first to last entry, and will stop after reaching the Amount.
  • Tag string this tag will be added to the spawned AI. Keep in mind that the AI will spawn without a tag unless you assign on here, regardless of whether the spawn point used has tags assigned or not.

This method will spawn AI over the time specified in Duration. This method is asynchronus, which means it will not stop the execution of the following code in the script. Moreover there can be only one "instance" of this method running at any given time. This means that you will need to wait until the last call is finished before calling it again. If you call this method before the last call finishes, the last call will be aborted, and the new one will start.

Create(SpawnPoint, Tag, FreezeTime)

Parameters:

  • SpawnPoint SpawnPoint a spawn point at which the AI will be spawned.
  • Tag string this tag will be added to the spawned AI. Keep in mind that the AI will spawn without a tag unless you assign on here, regardless of whether the spawn point used has tags or not.
  • FreezeTime float Time in seconds. AI will be frozen until this time runs out.

This method will spawn a frozen AI at a given SpawnPoint. The AI will unfreeze after time provided as parameter FreezeTime passes.

CleanUp(Tag)

Parameters:

  • Tag string used to determine which AI instances to clean up.

This method will clean up all AI instances with a given Tag.

GetMaxCount()

This method will return an integer specifying the maximum amount of the AI that can be spawned. I assume that this is a value set up in the game itself, and can't be defined by the user.

GetControllers(Class, Tag, TeamId, SquadId)

Parameters:

  • Class string a path to the AI controller class. AFAIK there is only one class available "/Game/GBCore/AI/BP_AIController.BP_AIController_C".
  • Tag string a tag of the AI controllers we want to grab.
  • TeamId int team ID of the AI controllers we want to get.
  • SquadId int squad ID of the AI controllers we want to get.

ProjectPointToNavigation(Point, Extent)

Parameters:

  • Point table vector{x,y,z} point to project to navigation.
  • Extent table vector{x,y,z} extent within which to search for the projected point.

Projects the given point to navigation mesh. The projected point will be within the given extent. Will return nil if there is no point on navigation mesh within extent from given point.

GetRandomReachablePointInRadius(Origin, Radius)

Parameters:

  • Origin table vector{x,y,z} point to project to navigation.
  • Radius number radius within which to search for the random point.

Returns a random point on navigation mesh within radius of the origin point. Will return nil if there are no points on navigation mesh within radius from origin.

CheckLocationReachable

KillAI (Actor)

New in 1032

GetGuardPointName (Actor)

New in 1032

Actor has to be GuardPoint type

CreateWithTransform (Actor, Transform, Tag, FreezeTime)

New in 1032

GetSpawnPointInfo (Actor)

New in 1032