G1R AngelScript
Scripting reference for the Gothic 1 Remake
Loading...
Searching...
No Matches
UNearbyActorsSubsystem Class Reference

Tracks a set of actors and allows fast spatial lookups, ie. determining all nearby items or other characters. More...

Public Member Functions

Functions
void StopTrackingActorsOfClass (TSubclassOf< AActor > Class)
 Stops tracking and updating of actors inheriting of the given class.
TArray< AActor > FindActorsOfClassInRadius (TSubclassOf< AActor > Class, FVector Center, float32 Radius) const
 Returns all tracked actors of the given class that are intersecting with the given radius.
TArray< AActor > FindActorsOfClassInRadius2D (TSubclassOf< AActor > Class, FVector Center, float32 Radius) const
 Returns all tracked actors of the given class that are intersecting with the given radius.
TArray< USceneComponent > FindComponentsOfClassInBox (TSubclassOf< USceneComponent > Class, FBox Box) const
 Returns all tracked components of the given class that are inside the given box.
TArray< USceneComponent > FindComponentsOfClassInRadius (TSubclassOf< USceneComponent > Class, FVector Center, float32 Radius) const
 Returns all tracked components of the given class that are intersecting with the given radius.
bool IsTrackingActorClass (TSubclassOf< AActor > Class)
 Whether the given class is tracked by this subsystem. Also returns true, if the given class inherits from a tracked class.
bool IsTrackingComponentClass (TSubclassOf< USceneComponent > Class)
 Whether the given class is tracked by this subsystem. Also returns true, if the given class inherits from a tracked class.
TArray< AActor > FindActorsOfClassInBox (TSubclassOf< AActor > Class, FBox Box) const
 Returns all tracked actors of the given class that are inside the given box.
void StopTrackingComponentsOfClass (TSubclassOf< USceneComponent > Class)
 Stops tracking and updating of components inheriting of the given class.
void StopTrackingDynamicallyCreatedComponent (USceneComponent Component)
void TrackActorsOfClass (TSubclassOf< AActor > Class)
 Begins tracking all actors inheriting from given class. Updates their position automatically.
void TrackComponentsOfClass (TSubclassOf< USceneComponent > Class)
 Begins tracking all components inheriting from given class. Updates their position automatically.
void TrackDynamicallyCreatedComponent (USceneComponent Component)
 Must be called on dynamically created components that you want to be tracked here.
Public Member Functions inherited from UObject
bool MarkPackageDirty () const
void RemoveFromRoot ()
bool GetIsRooted () const
bool IsTransient () const
bool Modify (bool bAlwaysMarkDirty=true)
void SetTransactional (bool bTransactional)
bool IsSupportedForNetworking () const
UClass GetClass () const
UObject GetOuter () const
UObject GetTypedOuter (TSubclassOf< UObject > Target) const
 Traverses the outer chain searching for the next object of a certain type.
UPackage GetOutermost () const
UPackage GetPackage () const
void AddToRoot ()
UWorld GetWorld () const
FName GetName () const
FString GetFullName (const UObject StopOuter=nullptr) const
FString GetPathName (const UObject StopOuter=nullptr) const
bool IsA (const UClass Class) const
 Returns true if this object is of the specified type, or a child of that type.
void SaveConfig ()
void LoadConfig ()
void ReloadConfig ()
void CopyScriptPropertiesFrom (const UObject OtherObject)
void opCast (?&Address) const
FString ToString () const

Static Public Member Functions

Static Functions
static UNearbyActorsSubsystem Get ()
static UClass StaticClass ()
Static Public Member Functions inherited from UTickableWorldSubsystem
static UClass StaticClass ()
Static Public Member Functions inherited from UWorldSubsystem
static UClass StaticClass ()
Static Public Member Functions inherited from USubsystem
static UClass StaticClass ()
Static Public Member Functions inherited from UObject
static UClass StaticClass ()

Additional Inherited Members

Public Attributes inherited from UObject
const UClass Class
const UObject Outer
const UPackage Outermost
const UPackage Package
const UWorld World
const FName Name
const bool IsRooted

Detailed Description

Tracks a set of actors and allows fast spatial lookups, ie. determining all nearby items or other characters.

You can set classes that should be tracked in the config via DefaultTrackedActorClasses. With the classes set up here, you don't need to register them manually via code.

Usage examples (from within a UObject):

Start tracking all actors of a certain class. Only those will be considered by range queries:

UNearbyActorsSubsystem::Get(this)->TrackActorsOfClass<ACharacter>();

Query actors in range:

auto NearbyCharacters = UNearbyActorsSubsystem::Get(this)->FindActorsInRadius<ACharacter>(Location, Radius);

Member Function Documentation

◆ FindActorsOfClassInBox()

TArray< AActor > FindActorsOfClassInBox ( TSubclassOf< AActor > Class,
FBox Box ) const

Returns all tracked actors of the given class that are inside the given box.

◆ FindActorsOfClassInRadius()

TArray< AActor > FindActorsOfClassInRadius ( TSubclassOf< AActor > Class,
FVector Center,
float32 Radius ) const

Returns all tracked actors of the given class that are intersecting with the given radius.

◆ FindActorsOfClassInRadius2D()

TArray< AActor > FindActorsOfClassInRadius2D ( TSubclassOf< AActor > Class,
FVector Center,
float32 Radius ) const

Returns all tracked actors of the given class that are intersecting with the given radius.

◆ FindComponentsOfClassInBox()

TArray< USceneComponent > FindComponentsOfClassInBox ( TSubclassOf< USceneComponent > Class,
FBox Box ) const

Returns all tracked components of the given class that are inside the given box.

◆ FindComponentsOfClassInRadius()

TArray< USceneComponent > FindComponentsOfClassInRadius ( TSubclassOf< USceneComponent > Class,
FVector Center,
float32 Radius ) const

Returns all tracked components of the given class that are intersecting with the given radius.

◆ Get()

UNearbyActorsSubsystem Get ( )
static

◆ IsTrackingActorClass()

bool IsTrackingActorClass ( TSubclassOf< AActor > Class)

Whether the given class is tracked by this subsystem. Also returns true, if the given class inherits from a tracked class.

◆ IsTrackingComponentClass()

bool IsTrackingComponentClass ( TSubclassOf< USceneComponent > Class)

Whether the given class is tracked by this subsystem. Also returns true, if the given class inherits from a tracked class.

◆ StaticClass()

UClass StaticClass ( )
static

◆ StopTrackingActorsOfClass()

void StopTrackingActorsOfClass ( TSubclassOf< AActor > Class)

Stops tracking and updating of actors inheriting of the given class.

◆ StopTrackingComponentsOfClass()

void StopTrackingComponentsOfClass ( TSubclassOf< USceneComponent > Class)

Stops tracking and updating of components inheriting of the given class.

◆ StopTrackingDynamicallyCreatedComponent()

void StopTrackingDynamicallyCreatedComponent ( USceneComponent Component)

◆ TrackActorsOfClass()

void TrackActorsOfClass ( TSubclassOf< AActor > Class)

Begins tracking all actors inheriting from given class. Updates their position automatically.

◆ TrackComponentsOfClass()

void TrackComponentsOfClass ( TSubclassOf< USceneComponent > Class)

Begins tracking all components inheriting from given class. Updates their position automatically.

◆ TrackDynamicallyCreatedComponent()

void TrackDynamicallyCreatedComponent ( USceneComponent Component)

Must be called on dynamically created components that you want to be tracked here.