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

Public Member Functions

Functions
const FPerceptionSightSettings & GetSightCapabilities (const UCharacterPerceptionComponent CharacterPerceptionComponent) const
 Returns how good this character can hear.
bool CanAnyPlayerSee (const AActor Actor, float32 MinTimeSeconds=0.000000, float32 AwarenessThreshold=0.000000) const
 Returns true if any player can see the given character.
bool CanSee (const AGothicCharacter Character, const AGothicCharacter Other, float32 MinTimeSeconds=0.000000, float32 AwarenessThreshold=0.000000) const
 Returns true if the given Character can see Other.
bool CanSense (const AGothicCharacter Character, const AGothicCharacter Other, float32 MinTimeSeconds=0.000000) const
 Returns true if the given Character can sense Other.
void FillPerceivedAgent (FPerceivedAgent &Out, FPerceptionAgentHandle Sensing, FPerceptionAgentHandle Perceived) const
FGameplayTagContainer GetAgentTagsOfActor (AActor Actor) const
FGameplayTagContainer GetAgentTagsOfAgent (FPerceptionAgentHandle Agent) const
TArray< AGothicCharacter > GetAllCharactersSensing (const AActor SensedActor, EPerceptionSense ViaSense, FGameplayTagContainer IncludeCharactersWith, FGameplayTagContainer ExcludeCharactersWith, float32 MinAwareness=50.000000) const
 Returns a list of all characters that perceive the given character.
TArray< AGothicCharacter > GetAllHostilesSensingCharacter (const AGothicCharacter SensedCharacter, EPerceptionSense ViaSense, FGameplayTagContainer IncludeCharactersWith, FGameplayTagContainer ExcludeCharactersWith, float32 MinAwareness=50.000000) const
 Returns a list of all characters that are hostile to and sense the given character.
TArray< AGothicCharacter > GetAllSensedCharacters (AGothicCharacter PerceivedBy, FGameplayTagContainer IncludeCharactersWith, FGameplayTagContainer ExcludeCharactersWith, EPerceptionSense ViaSense=EPerceptionSense ::None, bool bRequiresFullAwareness=false, float32 MinAwareness=50.000000) const
 Returns a list of all characters that the given character can perceive in some way.
TArray< AGothicCharacter > GetAllSensedCharactersWithRelationship (AGothicCharacter PerceivedBy, ERelationship Relationship, ERelationshipHostility Hostility, FGameplayTagContainer IncludeCharactersWith, FGameplayTagContainer ExcludeCharactersWith, EPerceptionSense ViaSense=EPerceptionSense ::None, bool bRequiresFullAwareness=false, float32 MinAwareness=50.000000) const
 Returns a list of all characters that the given character can perceive in some way and who have the given relationship.
TSet< AGothicCharacter > GetCharactersPerceivedByHandler (FPerceptionHandlerHandle HandlerHandle, bool bCheckForTags=true) const
 Returns all characters that the given handler has gained perception of right now.
const FPerceptionHearingSettings & GetHearingCapabilities (const UCharacterPerceptionComponent CharacterPerceptionComponent) const
 Returns how good this character can hear.
TSet< AItemVisualWorld > GetItemsPerceivedByHandler (FPerceptionHandlerHandle HandlerHandle) const
 Returns all items that the given handler has gained perception of right now.
void BroadcastPerceptionEvent (FGameplayTag EventTag, FVector AtLocation, const AActor OriginActor, const AActor TargetActor, const AActor InstigatorActor, const AActor AffectedActor, const AActor EffectCauser, FGameplayTagContainer EffectCauserTags, float32 Magnitude=0.000000, float32 EstimatedSecondsUntilImpact=0.000000)
 Puts a custom event into the given SensingCharacters memory and broadcasts it to all sensing characters.
FPerceptionAgentHandle GetViewTargetAgent (FPerceptionAgentHandle SensingAgent) const
 Returns handle of agent the given agent is looking at. Returns an unsetted handle if the agent isn't looking at any other agent.
bool HasFreeLineOfSightBetween (const AGothicCharacter Character, const AGothicCharacter Other) const
 Returns true if there was a unobstructed raycast between the two characters heads.
bool HasPotentialPathBetween (const AGothicCharacter Character, const AGothicCharacter Other) const
 Returns true if there might be a path between the two agents (uses pathfinding queries done for hearing perceptions).
bool IsInHearingRangeOfAnyPlayer (const AActor Actor, EPerceptionNoiseLoudness Loudness) const
 Returns true if any player can see the given character.
void ReportSoundShort (AActor Instigator, FGameplayTag SoundTag, FVector AtLocation, EPerceptionNoiseLoudness Loudness, float32 WaitSeconds=0.000000, bool IsBoundToOriginActor=true)
 Call when someone made a noise that is very short.
FPerceptionSoundAreaHandle ReportSoundWithDuration (AActor Instigator, FGameplayTag SoundTag, FVector AtLocation, EPerceptionNoiseLoudness Loudness, float32 Duration, bool IsBoundToOriginActor=true)
 Call when someone made a noise that can be heard for some time.
FPerceptionSoundAreaHandle ReportSoundWithInfiniteDuration (AActor Instigator, FGameplayTag SoundTag, FVector AtLocation, EPerceptionNoiseLoudness Loudness, bool IsBoundToOriginActor=true)
 Call when someone made a noise that is looping indefinitely.
void StopSoundEvent (FPerceptionSoundAreaHandle AreaEventHandle)
 Stops an ongoing sound event earlier than its specified duration.
void TestRemoveAllPerceptionHandlers ()
 Can be called to completely empty the perception system from all handlers for testing. Usecase is to call this first, and then add a single specific handler.
bool TryCreatePerceptionEvent (const AGothicCharacter EventSensedBy, FGameplayTag EventTag, FVector AtLocation, FVector AtNavLocation, const AActor OriginActor, const AActor TargetActor, const AActor InstigatorActor, const AActor AffectedActor, FRememberedPerception &Perception)

Static Public Member Functions

Static Functions
static UClass StaticClass ()
static UPerceptionSystem Get ()
static bool & DebugGetIgnorePlayerPerceptionsRef ()

Member Function Documentation

◆ BroadcastPerceptionEvent()

void BroadcastPerceptionEvent ( FGameplayTag EventTag,
FVector AtLocation,
const AActor OriginActor,
const AActor TargetActor,
const AActor InstigatorActor,
const AActor AffectedActor,
const AActor EffectCauser,
FGameplayTagContainer EffectCauserTags,
float32 Magnitude = 0.000000,
float32 EstimatedSecondsUntilImpact = 0.000000 )

Puts a custom event into the given SensingCharacters memory and broadcasts it to all sensing characters.

◆ CanAnyPlayerSee()

bool CanAnyPlayerSee ( const AActor Actor,
float32 MinTimeSeconds = 0.000000,
float32 AwarenessThreshold = 0.000000 ) const

Returns true if any player can see the given character.

◆ CanSee()

bool CanSee ( const AGothicCharacter Character,
const AGothicCharacter Other,
float32 MinTimeSeconds = 0.000000,
float32 AwarenessThreshold = 0.000000 ) const

Returns true if the given Character can see Other.

◆ CanSense()

bool CanSense ( const AGothicCharacter Character,
const AGothicCharacter Other,
float32 MinTimeSeconds = 0.000000 ) const

Returns true if the given Character can sense Other.

◆ DebugGetIgnorePlayerPerceptionsRef()

bool & DebugGetIgnorePlayerPerceptionsRef ( )
static

◆ FillPerceivedAgent()

void FillPerceivedAgent ( FPerceivedAgent & Out,
FPerceptionAgentHandle Sensing,
FPerceptionAgentHandle Perceived ) const

◆ Get()

UPerceptionSystem Get ( )
static

◆ GetAgentTagsOfActor()

FGameplayTagContainer GetAgentTagsOfActor ( AActor Actor) const

◆ GetAgentTagsOfAgent()

FGameplayTagContainer GetAgentTagsOfAgent ( FPerceptionAgentHandle Agent) const

◆ GetAllCharactersSensing()

TArray< AGothicCharacter > GetAllCharactersSensing ( const AActor SensedActor,
EPerceptionSense ViaSense,
FGameplayTagContainer IncludeCharactersWith,
FGameplayTagContainer ExcludeCharactersWith,
float32 MinAwareness = 50.000000 ) const

Returns a list of all characters that perceive the given character.

◆ GetAllHostilesSensingCharacter()

TArray< AGothicCharacter > GetAllHostilesSensingCharacter ( const AGothicCharacter SensedCharacter,
EPerceptionSense ViaSense,
FGameplayTagContainer IncludeCharactersWith,
FGameplayTagContainer ExcludeCharactersWith,
float32 MinAwareness = 50.000000 ) const

Returns a list of all characters that are hostile to and sense the given character.

◆ GetAllSensedCharacters()

TArray< AGothicCharacter > GetAllSensedCharacters ( AGothicCharacter PerceivedBy,
FGameplayTagContainer IncludeCharactersWith,
FGameplayTagContainer ExcludeCharactersWith,
EPerceptionSense ViaSense = EPerceptionSense :: None,
bool bRequiresFullAwareness = false,
float32 MinAwareness = 50.000000 ) const

Returns a list of all characters that the given character can perceive in some way.

◆ GetAllSensedCharactersWithRelationship()

TArray< AGothicCharacter > GetAllSensedCharactersWithRelationship ( AGothicCharacter PerceivedBy,
ERelationship Relationship,
ERelationshipHostility Hostility,
FGameplayTagContainer IncludeCharactersWith,
FGameplayTagContainer ExcludeCharactersWith,
EPerceptionSense ViaSense = EPerceptionSense :: None,
bool bRequiresFullAwareness = false,
float32 MinAwareness = 50.000000 ) const

Returns a list of all characters that the given character can perceive in some way and who have the given relationship.

◆ GetCharactersPerceivedByHandler()

TSet< AGothicCharacter > GetCharactersPerceivedByHandler ( FPerceptionHandlerHandle HandlerHandle,
bool bCheckForTags = true ) const

Returns all characters that the given handler has gained perception of right now.

◆ GetHearingCapabilities()

const FPerceptionHearingSettings & GetHearingCapabilities ( const UCharacterPerceptionComponent CharacterPerceptionComponent) const

Returns how good this character can hear.

◆ GetItemsPerceivedByHandler()

TSet< AItemVisualWorld > GetItemsPerceivedByHandler ( FPerceptionHandlerHandle HandlerHandle) const

Returns all items that the given handler has gained perception of right now.

◆ GetSightCapabilities()

const FPerceptionSightSettings & GetSightCapabilities ( const UCharacterPerceptionComponent CharacterPerceptionComponent) const

Returns how good this character can hear.

◆ GetViewTargetAgent()

FPerceptionAgentHandle GetViewTargetAgent ( FPerceptionAgentHandle SensingAgent) const

Returns handle of agent the given agent is looking at. Returns an unsetted handle if the agent isn't looking at any other agent.

◆ HasFreeLineOfSightBetween()

bool HasFreeLineOfSightBetween ( const AGothicCharacter Character,
const AGothicCharacter Other ) const

Returns true if there was a unobstructed raycast between the two characters heads.

◆ HasPotentialPathBetween()

bool HasPotentialPathBetween ( const AGothicCharacter Character,
const AGothicCharacter Other ) const

Returns true if there might be a path between the two agents (uses pathfinding queries done for hearing perceptions).

◆ IsInHearingRangeOfAnyPlayer()

bool IsInHearingRangeOfAnyPlayer ( const AActor Actor,
EPerceptionNoiseLoudness Loudness ) const

Returns true if any player can see the given character.

◆ ReportSoundShort()

void ReportSoundShort ( AActor Instigator,
FGameplayTag SoundTag,
FVector AtLocation,
EPerceptionNoiseLoudness Loudness,
float32 WaitSeconds = 0.000000,
bool IsBoundToOriginActor = true )

Call when someone made a noise that is very short.

◆ ReportSoundWithDuration()

FPerceptionSoundAreaHandle ReportSoundWithDuration ( AActor Instigator,
FGameplayTag SoundTag,
FVector AtLocation,
EPerceptionNoiseLoudness Loudness,
float32 Duration,
bool IsBoundToOriginActor = true )

Call when someone made a noise that can be heard for some time.

Note: Use the returned handle to stop this sound perception earlier than the given duration.

◆ ReportSoundWithInfiniteDuration()

FPerceptionSoundAreaHandle ReportSoundWithInfiniteDuration ( AActor Instigator,
FGameplayTag SoundTag,
FVector AtLocation,
EPerceptionNoiseLoudness Loudness,
bool IsBoundToOriginActor = true )

Call when someone made a noise that is looping indefinitely.

Note: Use the returned handle to stop this sound perception at some point.

◆ StaticClass()

UClass StaticClass ( )
static

◆ StopSoundEvent()

void StopSoundEvent ( FPerceptionSoundAreaHandle AreaEventHandle)

Stops an ongoing sound event earlier than its specified duration.

◆ TestRemoveAllPerceptionHandlers()

void TestRemoveAllPerceptionHandlers ( )

Can be called to completely empty the perception system from all handlers for testing. Usecase is to call this first, and then add a single specific handler.

◆ TryCreatePerceptionEvent()

bool TryCreatePerceptionEvent ( const AGothicCharacter EventSensedBy,
FGameplayTag EventTag,
FVector AtLocation,
FVector AtNavLocation,
const AActor OriginActor,
const AActor TargetActor,
const AActor InstigatorActor,
const AActor AffectedActor,
FRememberedPerception & Perception )