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

SensingComponent encapsulates sensory (ie sight and hearing) settings and functionality for an Actor, allowing the actor to see/hear Pawns in the world. It does nothing on network clients. More...

Public Member Functions

AI|Components|PawnSensing
void SetSensingUpdatesEnabled (bool bEnabled)
 Enables or disables sensing updates. The timer is reset in either case.
float32 GetPeripheralVisionCosine () const
void SetPeripheralVisionAngle (float32 NewPeripheralVisionAngle)
 Sets PeripheralVisionAngle. Calculates PeripheralVisionCosine from PeripheralVisionAngle.
void SetSensingInterval (float32 NewSensingInterval)
 Changes the SensingInterval. If we are currently waiting for an interval, this can either extend or shorten that interval. A value <= 0 prevents any updates.
float32 GetPeripheralVisionAngle () const
Functions
bool GetbEnableSensingUpdates () const
 If true, component will perform sensing updates. At runtime change this using SetSensingUpdatesEnabled().
void SetbEnableSensingUpdates (bool Value)
 If true, component will perform sensing updates. At runtime change this using SetSensingUpdatesEnabled().
bool GetbOnlySensePlayers () const
 If true, will only sense player-controlled pawns in the world. Default: true.
const float32 & GetSensingInterval () const
 Amount of time between pawn sensing updates. Use SetSensingInterval() to adjust this at runtime. A value <= 0 prevents any updates.
void SetbOnlySensePlayers (bool Value)
 If true, will only sense player-controlled pawns in the world. Default: true.
bool GetbSeePawns () const
 If true, we will perform visibility tests and will trigger notifications when a Pawn is visible. Default: true.
void SetbSeePawns (bool Value)
 If true, we will perform visibility tests and will trigger notifications when a Pawn is visible. Default: true.
bool GetbHearNoises () const
 If true, we will perform audibility tests and will be notified when a Pawn makes a noise that can be heard. Default: true IMPORTANT NOTE: If we can see pawns (bSeePawns is true), and the pawn is visible, noise notifications are not triggered.
void SetbHearNoises (bool Value)
 If true, we will perform audibility tests and will be notified when a Pawn makes a noise that can be heard. Default: true IMPORTANT NOTE: If we can see pawns (bSeePawns is true), and the pawn is visible, noise notifications are not triggered.
Public Member Functions inherited from UActorComponent
void Tick (float32 DeltaSeconds)
 Event called every frame if tick is enabled.
EComponentCreationMethod GetComponentCreationMethod () const
void SetbIsEditorOnly (bool Value)
void EndPlay (EEndPlayReason EndPlayReason)
 Blueprint implementable event for when the component ends play, generally via destruction or its Actor's EndPlay.
void BeginPlay ()
 Blueprint implementable event for when the component is beginning play, called before its owning actor's BeginPlay or when the component is dynamically created if the Actor has already BegunPlay.
void MarkRenderStateDirty ()
bool HasBegunPlay () const
void SetbTickInEditor (bool Value)
bool IsVisualizationComponent () const
void SetIsVisualizationComponent (bool Value)
void AsyncPhysicsTick (float32 DeltaSeconds, float32 SimSeconds)
 Event called every async physics tick if bAsyncPhysicsTickEnabled is true.
bool GetbReplicateUsingRegisteredSubObjectList () const
 When true the replication system will only replicate the registered subobjects list When false the replication system will instead call the virtual ReplicateSubObjects() function where the subobjects need to be manually replicated.
void SetbReplicateUsingRegisteredSubObjectList (bool Value)
 When true the replication system will only replicate the registered subobjects list When false the replication system will instead call the virtual ReplicateSubObjects() function where the subobjects need to be manually replicated.
bool GetbReplicates () const
 Is this component currently replicating? Should the network code consider it for replication? Owning Actor must be replicating first!
void SetbReplicates (bool Value)
 Is this component currently replicating? Should the network code consider it for replication? Owning Actor must be replicating first!
bool GetbAutoActivate () const
 Whether the component is activated at creation or must be explicitly activated.
void SetbAutoActivate (bool Value)
 Whether the component is activated at creation or must be explicitly activated.
void SetbEditableWhenInherited (bool Value)
 True if this component can be modified when it was inherited from a parent actor class.
void SetbCanEverAffectNavigation (bool Value)
 Whether this component can potentially influence navigation.
bool GetbIsEditorOnly () const
 If true, the component will be excluded from non-editor builds.
bool IsBeingDestroyed () const
 Returns whether the component is in the process of being destroyed.
void SetIsReplicated (bool ShouldReplicate)
 Enable or disable replication. This is the equivalent of RemoteRole for actors (only a bool is required for components).
void DestroyComponent (UObject Object)
 Unregister and mark for pending kill a component. This may not be used to destroy a component that is owned by an actor unless the owning actor is calling the function.
bool ComponentHasTag (FName Tag) const
 See if this component contains the supplied tag.
AActor GetOwner () const
 Follow the Outer chain to get the AActor that 'Owns' this component.
void SetAutoActivate (bool bNewAutoActivate)
 Sets whether the component should be auto activate or not. Only safe during construction scripts.
bool IsActive () const
 Returns whether the component is active or not.
void ToggleActive ()
 Toggles the active state of the component.
void SetActive (bool bNewActive, bool bReset=false)
 Sets whether the component is active or not.
void Activate (bool bReset=false)
 Activates the SceneComponent, should be overridden by native child classes.
void Deactivate ()
 Deactivates the SceneComponent.
float32 GetComponentTickInterval () const
 Returns the tick interval for this component's primary tick function, which is the frequency in seconds at which it will be executed.
void AddTickPrerequisiteActor (AActor PrerequisiteActor)
 Make this component tick after PrerequisiteActor.
void AddTickPrerequisiteComponent (UActorComponent PrerequisiteComponent)
 Make this component tick after PrerequisiteComponent.
void RemoveTickPrerequisiteComponent (UActorComponent PrerequisiteComponent)
 Remove tick dependency on PrerequisiteComponent.
void SetTickableWhenPaused (bool bTickableWhenPaused)
 Sets whether this component can tick when paused.
bool IsComponentTickEnabled () const
 Returns whether this component has tick enabled or not.
void SetTickGroup (ETickingGroup NewTickGroup)
 Changes the ticking group for this component.
void RemoveTickPrerequisiteActor (AActor PrerequisiteActor)
 Remove tick dependency on PrerequisiteActor.
void SetComponentTickIntervalAndCooldown (float32 TickInterval)
 Sets the tick interval for this component's primary tick function. Does not enable the tick interval. Takes effect imediately.
void SetComponentTickInterval (float32 TickInterval)
 Sets the tick interval for this component's primary tick function. Does not enable the tick interval. Takes effect on next tick.
void SetComponentTickEnabled (bool bEnabled)
 Set this component's tick functions to be enabled or disabled. Only has an effect if the function is registered.
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 UPawnSensingComponent Get (const AActor Actor, FName WithName=NAME_None)
static UPawnSensingComponent GetOrCreate (AActor Actor, FName WithName=NAME_None)
static UPawnSensingComponent Create (AActor Actor, FName WithName=NAME_None)
static UClass StaticClass ()
Static Public Member Functions inherited from UActorComponent
static UActorComponent Get (const AActor Actor, FName WithName=NAME_None)
static UActorComponent GetOrCreate (AActor Actor, FName WithName=NAME_None)
static UActorComponent Create (AActor Actor, FName WithName=NAME_None)
static UClass StaticClass ()
Static Public Member Functions inherited from UObject
static UClass StaticClass ()

Public Attributes

AI
float32 PeripheralVisionAngle
 How far to the side AI can see, in degrees. Use SetPeripheralVisionAngle to change the value at runtime.
float32 LOSHearingThreshold
 Max distance at which a makenoise(1.0) loudness sound can be heard if unoccluded (LOSHearingThreshold should be > HearingThreshold).
float32 SightRadius
 Maximum sight distance.
float32 HearingMaxSoundAge
 Max age of sounds we can hear. Should be greater than SensingInterval, or you might miss hearing some sounds!
float32 SensingInterval
 Amount of time between pawn sensing updates. Use SetSensingInterval() to adjust this at runtime. A value <= 0 prevents any updates.
float32 HearingThreshold
 Max distance at which a makenoise(1.0) loudness sound can be heard, regardless of occlusion.
bool bSeePawns
 If true, we will perform visibility tests and will trigger notifications when a Pawn is visible. Default: true.
bool bOnlySensePlayers
 If true, will only sense player-controlled pawns in the world. Default: true.
bool bEnableSensingUpdates
 If true, component will perform sensing updates. At runtime change this using SetSensingUpdatesEnabled().
bool bHearNoises
 If true, we will perform audibility tests and will be notified when a Pawn makes a noise that can be heard. Default: true IMPORTANT NOTE: If we can see pawns (bSeePawns is true), and the pawn is visible, noise notifications are not triggered.
Variables
FSeePawnDelegate__PawnSensingComponent OnSeePawn
 Delegate to execute when we see a Pawn.
const float32 PeripheralVisionCosine
 Cosine of limits of peripheral vision. Computed from PeripheralVisionAngle.
FHearNoiseDelegate__PawnSensingComponent OnHearNoise
 Delegate to execute when we hear a noise from a Pawn's PawnNoiseEmitterComponent.
Public Attributes inherited from UActorComponent
bool bAutoActivate
 Whether the component is activated at creation or must be explicitly activated.
TArray< TObjectPtr< UAssetUserData > > AssetUserData
 Array of user data stored with the component.
TArray< TObjectPtr< UAssetUserData > > AssetUserDataEditorOnly
 Array of user data stored with the component.
bool bReplicates
 Is this component currently replicating? Should the network code consider it for replication? Owning Actor must be replicating first!
FActorComponentTickFunction PrimaryComponentTick
 Main tick function for the Component.
bool bIsEditorOnly
 If true, the component will be excluded from non-editor builds.
bool bReplicateUsingRegisteredSubObjectList
 When true the replication system will only replicate the registered subobjects list When false the replication system will instead call the virtual ReplicateSubObjects() function where the subobjects need to be manually replicated.
TArray< FName > ComponentTags
 Array of tags that can be used for grouping and categorizing. Can also be accessed from scripting.
const EComponentCreationMethod ComponentCreationMethod
const AActor Owner
 Follow the Outer chain to get the AActor that 'Owns' this component.
FActorComponentDeactivateSignature OnComponentDeactivated
 Called when the component has been deactivated.
FActorComponentActivatedSignature OnComponentActivated
 Called when the component has been activated, with parameter indicating if it was from a reset.
float32 ComponentTickInterval
 Returns the tick interval for this component's primary tick function, which is the frequency in seconds at which it will be executed.
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

SensingComponent encapsulates sensory (ie sight and hearing) settings and functionality for an Actor, allowing the actor to see/hear Pawns in the world. It does nothing on network clients.

Member Function Documentation

◆ Create()

UPawnSensingComponent Create ( AActor Actor,
FName WithName = NAME_None )
static

◆ Get()

UPawnSensingComponent Get ( const AActor Actor,
FName WithName = NAME_None )
static

◆ GetbEnableSensingUpdates()

bool GetbEnableSensingUpdates ( ) const

If true, component will perform sensing updates. At runtime change this using SetSensingUpdatesEnabled().

◆ GetbHearNoises()

bool GetbHearNoises ( ) const

If true, we will perform audibility tests and will be notified when a Pawn makes a noise that can be heard. Default: true IMPORTANT NOTE: If we can see pawns (bSeePawns is true), and the pawn is visible, noise notifications are not triggered.

◆ GetbOnlySensePlayers()

bool GetbOnlySensePlayers ( ) const

If true, will only sense player-controlled pawns in the world. Default: true.

◆ GetbSeePawns()

bool GetbSeePawns ( ) const

If true, we will perform visibility tests and will trigger notifications when a Pawn is visible. Default: true.

◆ GetOrCreate()

UPawnSensingComponent GetOrCreate ( AActor Actor,
FName WithName = NAME_None )
static

◆ GetPeripheralVisionAngle()

float32 GetPeripheralVisionAngle ( ) const

◆ GetPeripheralVisionCosine()

float32 GetPeripheralVisionCosine ( ) const

◆ GetSensingInterval()

const float32 & GetSensingInterval ( ) const

Amount of time between pawn sensing updates. Use SetSensingInterval() to adjust this at runtime. A value <= 0 prevents any updates.

◆ SetbEnableSensingUpdates()

void SetbEnableSensingUpdates ( bool Value)

If true, component will perform sensing updates. At runtime change this using SetSensingUpdatesEnabled().

◆ SetbHearNoises()

void SetbHearNoises ( bool Value)

If true, we will perform audibility tests and will be notified when a Pawn makes a noise that can be heard. Default: true IMPORTANT NOTE: If we can see pawns (bSeePawns is true), and the pawn is visible, noise notifications are not triggered.

◆ SetbOnlySensePlayers()

void SetbOnlySensePlayers ( bool Value)

If true, will only sense player-controlled pawns in the world. Default: true.

◆ SetbSeePawns()

void SetbSeePawns ( bool Value)

If true, we will perform visibility tests and will trigger notifications when a Pawn is visible. Default: true.

◆ SetPeripheralVisionAngle()

void SetPeripheralVisionAngle ( float32 NewPeripheralVisionAngle)

Sets PeripheralVisionAngle. Calculates PeripheralVisionCosine from PeripheralVisionAngle.

◆ SetSensingInterval()

void SetSensingInterval ( float32 NewSensingInterval)

Changes the SensingInterval. If we are currently waiting for an interval, this can either extend or shorten that interval. A value <= 0 prevents any updates.

◆ SetSensingUpdatesEnabled()

void SetSensingUpdatesEnabled ( bool bEnabled)

Enables or disables sensing updates. The timer is reset in either case.

◆ StaticClass()

UClass StaticClass ( )
static

Member Data Documentation

◆ bEnableSensingUpdates

bool bEnableSensingUpdates

If true, component will perform sensing updates. At runtime change this using SetSensingUpdatesEnabled().

◆ bHearNoises

bool bHearNoises

If true, we will perform audibility tests and will be notified when a Pawn makes a noise that can be heard. Default: true IMPORTANT NOTE: If we can see pawns (bSeePawns is true), and the pawn is visible, noise notifications are not triggered.

◆ bOnlySensePlayers

bool bOnlySensePlayers

If true, will only sense player-controlled pawns in the world. Default: true.

◆ bSeePawns

bool bSeePawns

If true, we will perform visibility tests and will trigger notifications when a Pawn is visible. Default: true.

◆ HearingMaxSoundAge

float32 HearingMaxSoundAge

Max age of sounds we can hear. Should be greater than SensingInterval, or you might miss hearing some sounds!

◆ HearingThreshold

float32 HearingThreshold

Max distance at which a makenoise(1.0) loudness sound can be heard, regardless of occlusion.

◆ LOSHearingThreshold

float32 LOSHearingThreshold

Max distance at which a makenoise(1.0) loudness sound can be heard if unoccluded (LOSHearingThreshold should be > HearingThreshold).

◆ OnHearNoise

Delegate to execute when we hear a noise from a Pawn's PawnNoiseEmitterComponent.

◆ OnSeePawn

Delegate to execute when we see a Pawn.

◆ PeripheralVisionAngle

float32 PeripheralVisionAngle

How far to the side AI can see, in degrees. Use SetPeripheralVisionAngle to change the value at runtime.

◆ PeripheralVisionCosine

const float32 PeripheralVisionCosine

Cosine of limits of peripheral vision. Computed from PeripheralVisionAngle.

◆ SensingInterval

float32 SensingInterval

Amount of time between pawn sensing updates. Use SetSensingInterval() to adjust this at runtime. A value <= 0 prevents any updates.

◆ SightRadius

float32 SightRadius

Maximum sight distance.