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

Subsystem that holds all registered smart object instances and offers the API for spatial queries and reservations. More...

Public Member Functions

SmartObject
bool GetSlotTransformFromRequestResult (FSmartObjectRequestResult RequestResult, FTransform &OutSlotTransform) const
 Returns the transform (in world space) of the slot associated to the given RequestResult.
void AddTagToSlot (const FSmartObjectSlotHandle SlotHandle, FGameplayTag Tag)
 Adds a single tag to the smart object slot represented by the provided handle.
FSmartObjectClaimHandle Claim (FSmartObjectRequestResult RequestResult, const AActor UserActor=nullptr)
FSmartObjectRequestResult FindSmartObject (FSmartObjectRequest Request, const AActor UserActor=nullptr) const
 Spatial lookup for first slot in range respecting request criteria and selection conditions.
bool FindSmartObjects (FSmartObjectRequest Request, TArray< FSmartObjectRequestResult > &OutResults, const AActor UserActor=nullptr) const
bool FindSmartObjects_BP (FSmartObjectRequest Request, TArray< FSmartObjectRequestResult > &OutResults, const AActor UserActor=nullptr) const
 Blueprint function for spatial lookup for slot candidates respecting request criteria and selection conditions.
void GetAllSlots (const FSmartObjectHandle Handle, TArray< FSmartObjectSlotHandle > &OutSlots) const
 Return all slots of a given smart object.
const USmartObjectBehaviorDefinition GetBehaviorDefinition (FSmartObjectClaimHandle ClaimHandle, TSubclassOf< USmartObjectBehaviorDefinition > DefinitionClass)
 Return the behavior definition of a given type from a claimed object.
const USmartObjectBehaviorDefinition GetBehaviorDefinitionByRequestResult (FSmartObjectRequestResult RequestResult, TSubclassOf< USmartObjectBehaviorDefinition > DefinitionClass)
 Return the behavior definition of a given type from a request result.
const FGameplayTagContainer & GetInstanceTags (const FSmartObjectHandle Handle) const
 Returns the list of tags associated to the smart object instance represented by the provided handle.
bool GetSlotLocation (FSmartObjectClaimHandle ClaimHandle, FVector &OutSlotLocation) const
 Returns the position (in world space) of the slot associated to the given claim handle.
ESmartObjectSlotState GetSlotState (const FSmartObjectSlotHandle SlotHandle) const
 Returns the state of the given Smart Object Slot handle.
const FGameplayTagContainer & GetSlotTags (const FSmartObjectSlotHandle SlotHandle) const
 Returns the list of tags associated to the smart object slot represented by the provided handle.
bool GetSlotTransform (FSmartObjectClaimHandle ClaimHandle, FTransform &OutSlotTransform) const
 Returns the transform (in world space) of the slot associated to the given claim handle.
void AddTagToInstance (const FSmartObjectHandle Handle, FGameplayTag Tag)
 Adds a single tag to the smart object instance represented by the provided handle.
USmartObjectComponent GetSmartObjectComponent (FSmartObjectClaimHandle ClaimHandle, ETrySpawnActorIfDehydrated TrySpawnActorIfDehydrated=ETrySpawnActorIfDehydrated ::No) const
 Returns the component associated to the claim handle if still accessible. In some scenarios the component may no longer exist but its smart object data could (e.g. streaming).
USmartObjectComponent GetSmartObjectComponentByRequestResult (FSmartObjectRequestResult Result, ETrySpawnActorIfDehydrated TrySpawnActorIfDehydrated=ETrySpawnActorIfDehydrated ::No) const
 Returns the component associated to the given request result In some scenarios the component may no longer exist but its smart object data could (e.g. streaming).
bool IsEnabled (const FSmartObjectHandle Handle) const
 Returns the enabled state of the smart object represented by the provided handle regardless of the disabled reason.
bool IsEnabledForReason (const FSmartObjectHandle Handle, FGameplayTag ReasonTag) const
 Returns the enabled state of the smart object represented by the provided handle based on a specific reason.
bool Release (FSmartObjectClaimHandle ClaimHandle)
void RemoveTagFromInstance (const FSmartObjectHandle Handle, FGameplayTag Tag)
 Removes a single tag from the smartobject instance represented by the provided handle.
bool RemoveTagFromSlot (const FSmartObjectSlotHandle SlotHandle, FGameplayTag Tag)
 Removes a single tag from the smart object slot represented by the provided handle.
bool SetEnabled (const FSmartObjectHandle Handle, bool bEnabled)
 Enables or disables the entire smart object represented by the provided handle using the default reason (i.e. Gameplay).. Delegate 'OnEvent' is broadcasted with ESmartObjectChangeReason::OnEnabled/ESmartObjectChangeReason::OnDisabled if state changed.
bool SetEnabledForReason (const FSmartObjectHandle Handle, FGameplayTag ReasonTag, bool bEnabled)
 Enables or disables the entire smart object represented by the provided handle using the specified reason. Delegate 'OnEvent' is broadcasted with ESmartObjectChangeReason::OnEnabled/ESmartObjectChangeReason::OnDisabled if state changed.
bool SetSlotEnabled (const FSmartObjectSlotHandle SlotHandle, bool bEnabled)
 Enables or disables the smart object slot represented by the provided handle.
const USmartObjectBehaviorDefinition Use (FSmartObjectClaimHandle ClaimHandle, TSubclassOf< USmartObjectBehaviorDefinition > DefinitionClass)
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 USmartObjectSubsystem Get ()
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

Subsystem that holds all registered smart object instances and offers the API for spatial queries and reservations.

Member Function Documentation

◆ AddTagToInstance()

void AddTagToInstance ( const FSmartObjectHandle Handle,
FGameplayTag Tag )

Adds a single tag to the smart object instance represented by the provided handle.

Parameters
HandleHandle to the smart object.
TagTag to add to the smart object instance.

◆ AddTagToSlot()

void AddTagToSlot ( const FSmartObjectSlotHandle SlotHandle,
FGameplayTag Tag )

Adds a single tag to the smart object slot represented by the provided handle.

Parameters
SlotHandleHandle to the smart object slot.
TagTag to add to the smart object slot.

◆ Claim()

FSmartObjectClaimHandle Claim ( FSmartObjectRequestResult RequestResult,
const AActor UserActor = nullptr )

◆ FindSmartObject()

FSmartObjectRequestResult FindSmartObject ( FSmartObjectRequest Request,
const AActor UserActor = nullptr ) const

Spatial lookup for first slot in range respecting request criteria and selection conditions.

Parameters
RequestParameters defining the search area and criteria
UserActorActor claiming the smart object used to evaluate selection conditions
Returns
First valid smart object in range. Not the closest one, just the one that happens to be retrieved first from space partition

◆ FindSmartObjects()

bool FindSmartObjects ( FSmartObjectRequest Request,
TArray< FSmartObjectRequestResult > & OutResults,
const AActor UserActor = nullptr ) const

◆ FindSmartObjects_BP()

bool FindSmartObjects_BP ( FSmartObjectRequest Request,
TArray< FSmartObjectRequestResult > & OutResults,
const AActor UserActor = nullptr ) const

Blueprint function for spatial lookup for slot candidates respecting request criteria and selection conditions.

Parameters
RequestParameters defining the search area and criteria
OutResultsList of smart object slot candidates
UserActorActor claiming the smart object
Returns
All valid smart objects in range.

◆ Get()

USmartObjectSubsystem Get ( )
static

◆ GetAllSlots()

void GetAllSlots ( const FSmartObjectHandle Handle,
TArray< FSmartObjectSlotHandle > & OutSlots ) const

Return all slots of a given smart object.

Parameters
HandleHandle to the smart object.
OutSlotsAll slots of the smart object

◆ GetBehaviorDefinition()

const USmartObjectBehaviorDefinition GetBehaviorDefinition ( FSmartObjectClaimHandle ClaimHandle,
TSubclassOf< USmartObjectBehaviorDefinition > DefinitionClass )

Return the behavior definition of a given type from a claimed object.

Parameters
ClaimHandleHandle to a claimed slot returned by any of the Claim methods.
DefinitionClassThe type of behavior definition.
Returns
The base class pointer of the requested behavior definition class associated to the slotClaim handle

◆ GetBehaviorDefinitionByRequestResult()

const USmartObjectBehaviorDefinition GetBehaviorDefinitionByRequestResult ( FSmartObjectRequestResult RequestResult,
TSubclassOf< USmartObjectBehaviorDefinition > DefinitionClass )

Return the behavior definition of a given type from a request result.

Parameters
RequestResultA request result returned by any of the Find methods.
DefinitionClassThe type of behavior definition.
Returns
The base class pointer of the requested behavior definition class associated to the request result

◆ GetInstanceTags()

const FGameplayTagContainer & GetInstanceTags ( const FSmartObjectHandle Handle) const

Returns the list of tags associated to the smart object instance represented by the provided handle.

Parameters
HandleHandle to the smart object.
Returns
Container of tags associated to the smart object instance.

◆ GetSlotLocation()

bool GetSlotLocation ( FSmartObjectClaimHandle ClaimHandle,
FVector & OutSlotLocation ) const

Returns the position (in world space) of the slot associated to the given claim handle.

Parameters
ClaimHandleHandle to a claimed slot returned by any of the Claim methods.
OutSlotLocationPosition (in world space) of the slot associated to ClaimHandle.
Returns
Whether the location was found and assigned to 'OutSlotLocation'

◆ GetSlotState()

ESmartObjectSlotState GetSlotState ( const FSmartObjectSlotHandle SlotHandle) const

Returns the state of the given Smart Object Slot handle.

◆ GetSlotTags()

const FGameplayTagContainer & GetSlotTags ( const FSmartObjectSlotHandle SlotHandle) const

Returns the list of tags associated to the smart object slot represented by the provided handle.

Parameters
SlotHandleHandle to the smart object slot.
Returns
Container of tags associated to the smart object instance, or empty container if slot was not valid.

◆ GetSlotTransform()

bool GetSlotTransform ( FSmartObjectClaimHandle ClaimHandle,
FTransform & OutSlotTransform ) const

Returns the transform (in world space) of the slot associated to the given claim handle.

Parameters
ClaimHandleHandle to a claimed slot returned by any of the Claim methods.
OutSlotTransformTransform (in world space) of the slot associated to ClaimHandle.
Returns
Whether the transform was found and assigned to 'OutSlotTransform'

◆ GetSlotTransformFromRequestResult()

bool GetSlotTransformFromRequestResult ( FSmartObjectRequestResult RequestResult,
FTransform & OutSlotTransform ) const

Returns the transform (in world space) of the slot associated to the given RequestResult.

Parameters
RequestResultResult returned by any of the Find Smart Object(s) methods.
OutSlotTransformTransform (in world space) of the slot associated to the RequestResult.
Returns
Whether the transform was found and assigned to 'OutSlotTransform'

◆ GetSmartObjectComponent()

USmartObjectComponent GetSmartObjectComponent ( FSmartObjectClaimHandle ClaimHandle,
ETrySpawnActorIfDehydrated TrySpawnActorIfDehydrated = ETrySpawnActorIfDehydrated :: No ) const

Returns the component associated to the claim handle if still accessible. In some scenarios the component may no longer exist but its smart object data could (e.g. streaming).

Parameters
ClaimHandleHandle to a claimed slot returned by any of the Claim methods.
TrySpawnActorIfDehydratedIndicates if the subsystem should try to spawn the actor/component associated to the smartobject if it is currently owned by an instanced actor.
Returns
A pointer to the USmartObjectComponent* associated to the handle.

◆ GetSmartObjectComponentByRequestResult()

USmartObjectComponent GetSmartObjectComponentByRequestResult ( FSmartObjectRequestResult Result,
ETrySpawnActorIfDehydrated TrySpawnActorIfDehydrated = ETrySpawnActorIfDehydrated :: No ) const

Returns the component associated to the given request result In some scenarios the component may no longer exist but its smart object data could (e.g. streaming).

Parameters
ResultA request result returned by any of the Find methods .
TrySpawnActorIfDehydratedIndicates if the subsystem should try to spawn the actor/component associated to the smartobject if it is currently owned by an instanced actor.
Returns
A pointer to the USmartObjectComponent* associated to the handle.

◆ IsEnabled()

bool IsEnabled ( const FSmartObjectHandle Handle) const

Returns the enabled state of the smart object represented by the provided handle regardless of the disabled reason.

Parameters
HandleHandle to the smart object.
Returns
True when associated smart object is found and set to be enabled. False otherwise.

◆ IsEnabledForReason()

bool IsEnabledForReason ( const FSmartObjectHandle Handle,
FGameplayTag ReasonTag ) const

Returns the enabled state of the smart object represented by the provided handle based on a specific reason.

Parameters
HandleHandle to the smart object.
ReasonTagValid Tag to test if enabled for a specific reason. Method will ensure if not valid (i.e. None).
Returns
True when associated smart object is found and set to be enabled. False otherwise.

◆ Release()

bool Release ( FSmartObjectClaimHandle ClaimHandle)

◆ RemoveTagFromInstance()

void RemoveTagFromInstance ( const FSmartObjectHandle Handle,
FGameplayTag Tag )

Removes a single tag from the smartobject instance represented by the provided handle.

Parameters
HandleHandle to the smart object.
TagTag to remove from the SmartObject instance.

◆ RemoveTagFromSlot()

bool RemoveTagFromSlot ( const FSmartObjectSlotHandle SlotHandle,
FGameplayTag Tag )

Removes a single tag from the smart object slot represented by the provided handle.

Parameters
SlotHandleHandle to the smart object slot.
TagTag to remove from the smart object slot.
Returns
True if the tag was removed.

◆ SetEnabled()

bool SetEnabled ( const FSmartObjectHandle Handle,
bool bEnabled )

Enables or disables the entire smart object represented by the provided handle using the default reason (i.e. Gameplay).. Delegate 'OnEvent' is broadcasted with ESmartObjectChangeReason::OnEnabled/ESmartObjectChangeReason::OnDisabled if state changed.

Parameters
HandleHandle to the smart object.
bEnabledIf true enables the smart object, disables otherwise.
Returns
True when associated smart object is found and set (or already set) to desired state; false otherwise.

◆ SetEnabledForReason()

bool SetEnabledForReason ( const FSmartObjectHandle Handle,
FGameplayTag ReasonTag,
bool bEnabled )

Enables or disables the entire smart object represented by the provided handle using the specified reason. Delegate 'OnEvent' is broadcasted with ESmartObjectChangeReason::OnEnabled/ESmartObjectChangeReason::OnDisabled if state changed.

Parameters
HandleHandle to the smart object.
ReasonTagValid Tag to specify the reason for changing the enabled state of the object. Method will ensure if not valid (i.e. None).
bEnabledIf true enables the smart object, disables otherwise.
Returns
True when associated smart object is found and set (or already set) to desired state; false otherwise.

◆ SetSlotEnabled()

bool SetSlotEnabled ( const FSmartObjectSlotHandle SlotHandle,
bool bEnabled )

Enables or disables the smart object slot represented by the provided handle.

Parameters
SlotHandleHandle to the smart object slot.
bEnabledIf true enables the slot, if false, disables the slot.
Returns
Previous enabled state.

◆ StaticClass()

UClass StaticClass ( )
static

◆ Use()