G1R AngelScript
Scripting reference for the Gothic 1 Remake
Loading...
Searching...
No Matches
AIHelper Namespace Reference

Functions

AI
bool IsValidAILocation (FVector Location)
UBlackboardComponent GetBlackboard (AActor Target)
UNavigationPath GetCurrentPath (AController Controller)
 Returns a NEW UOBJECT that is a COPY of navigation path given controller is currently using. The result being a copy means you won't be able to influence agent's pathfollowing by manipulating received path. Please use GetCurrentPathPoints if you only need the array of path points.
int GetCurrentPathIndex (const AController Controller)
 Return the path index the given controller is currently at. Returns INDEX_NONE if no path.
const TArray< FVector > GetCurrentPathPoints (AController Controller)
 Returns an array of navigation path points given controller is currently using.
int GetNextNavLinkIndex (const AController Controller)
 Return the path index of the next nav link for the current path of the given controller. Returns INDEX_NONE if no path or no incoming nav link.
bool IsValidAIDirection (FVector DirectionVector)
AAIController GetAIController (AActor ControlledActor)
 The way it works exactly is if the actor passed in is a pawn, then the function retrieves pawn's controller cast to AIController. Otherwise the function returns actor cast to AIController.
bool IsValidAIRotation (FRotator Rotation)
void SendAIMessage (APawn Target, FName Message, UObject MessageSource, bool bSuccess=true)
APawn SpawnAIFromClass (TSubclassOf< APawn > PawnClass, UBehaviorTree BehaviorTree, FVector Location, FRotator Rotation=FRotator(), bool bNoCollisionFail=false, AActor Owner=nullptr)
 Spawns AI agent of a given class. The PawnClass needs to have AIController set for the function to spawn a controller as well.
AI|Navigation
void SimpleMoveToLocation (AController Controller, FVector Goal)
void SimpleMoveToActor (AController Controller, const AActor Goal)
Animation
void UnlockAIResourcesWithAnimation (UAnimInstance AnimInstance, bool bUnlockMovement, bool UnlockAILogic)
 unlocks indicated AI resources of animated pawn. Will unlock only animation-locked resources
void LockAIResourcesWithAnimation (UAnimInstance AnimInstance, bool bLockMovement, bool LockAILogic)
 locks indicated AI resources of animated pawn

Function Documentation

◆ GetAIController()

AAIController GetAIController ( AActor ControlledActor)

The way it works exactly is if the actor passed in is a pawn, then the function retrieves pawn's controller cast to AIController. Otherwise the function returns actor cast to AIController.

◆ GetBlackboard()

UBlackboardComponent GetBlackboard ( AActor Target)

◆ GetCurrentPath()

UNavigationPath GetCurrentPath ( AController Controller)

Returns a NEW UOBJECT that is a COPY of navigation path given controller is currently using. The result being a copy means you won't be able to influence agent's pathfollowing by manipulating received path. Please use GetCurrentPathPoints if you only need the array of path points.

◆ GetCurrentPathIndex()

int GetCurrentPathIndex ( const AController Controller)

Return the path index the given controller is currently at. Returns INDEX_NONE if no path.

◆ GetCurrentPathPoints()

const TArray< FVector > GetCurrentPathPoints ( AController Controller)

Returns an array of navigation path points given controller is currently using.

◆ GetNextNavLinkIndex()

int GetNextNavLinkIndex ( const AController Controller)

Return the path index of the next nav link for the current path of the given controller. Returns INDEX_NONE if no path or no incoming nav link.

◆ IsValidAIDirection()

bool IsValidAIDirection ( FVector DirectionVector)

◆ IsValidAILocation()

bool IsValidAILocation ( FVector Location)

◆ IsValidAIRotation()

bool IsValidAIRotation ( FRotator Rotation)

◆ LockAIResourcesWithAnimation()

void LockAIResourcesWithAnimation ( UAnimInstance AnimInstance,
bool bLockMovement,
bool LockAILogic )

locks indicated AI resources of animated pawn

◆ SendAIMessage()

void SendAIMessage ( APawn Target,
FName Message,
UObject MessageSource,
bool bSuccess = true )

◆ SimpleMoveToActor()

void SimpleMoveToActor ( AController Controller,
const AActor Goal )

◆ SimpleMoveToLocation()

void SimpleMoveToLocation ( AController Controller,
FVector Goal )

◆ SpawnAIFromClass()

APawn SpawnAIFromClass ( TSubclassOf< APawn > PawnClass,
UBehaviorTree BehaviorTree,
FVector Location,
FRotator Rotation = FRotator ( ),
bool bNoCollisionFail = false,
AActor Owner = nullptr )

Spawns AI agent of a given class. The PawnClass needs to have AIController set for the function to spawn a controller as well.

Parameters
BehaviorTreeif set, and the function has successfully spawned and AI controller, this BehaviorTree asset will be assigned to the AI controller, and run.
Ownerlets you spawn the AI in a sublevel rather than in the persistent level (which is the default behavior).

◆ UnlockAIResourcesWithAnimation()

void UnlockAIResourcesWithAnimation ( UAnimInstance AnimInstance,
bool bUnlockMovement,
bool UnlockAILogic )

unlocks indicated AI resources of animated pawn. Will unlock only animation-locked resources