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

Base-task for the daily routines the characters are supposed to have. The AI switches to Daily Routines, if there are no other things to do right now. More...

Public Member Functions

Functions
void RequestDailyRoutineScheduleUpdateWithRandomTimeOffset ()
 Same as RequestDailyRoutineScheduleUpdate but will wait a random amount of time before doing the update. This is so not all characters will start moving at the exact same moment.
void HandleWeatherChange (EWeather PreviousWeather, EWeather NewWeather)
 Called when this routine would switch schedules because of a change in weather. Allows to put interrupt-states to react to the new weather.
bool OverridePreferredLocationForRoutineTask (FDailyRoutineTaskDescription Desc, UPreferredLocationComponent PreferredLocation) const
 Set a custom preferred location for the given routine task. Return true if you set anything.
void DoInterruptState (UCharacterAIState StateTemplate)
 Pauses the current task and does the given state instead (until it finishes).
void DoInterruptStateOfClass (TSubclassOf< UCharacterAIState > StateClass)
 Pauses the current task and does the given state instead (until it finishes).
int GetScheduleSecondsRandomOffset (int Day) const
 Each character can have some random offset to the times in their schedule, so they don't all start new tasks at exactly the same time.
EWeather GetWeather () const
 Returns the current weather conditions for the characters location.
bool IsDoingInterruptState () const
 Returns true if an interrupt state is currently active.
bool NeedsAttributeRestore () const
 Returns true if this character has taken damage (or spent Mana, etc) and would need a restore.
void RequestDailyRoutineScheduleUpdate ()
 Re-evaluates the daily routine schedule, e.g. when the weather changed.
void AddRoutineTaskEx (FDailyRoutineTaskDescription TaskDesc)
void RestoreAttributes ()
 Will fully restore this NPCs health, mana, etc.
void Schedule (int StartHour, int StartMinute, UCharacterAIState Task, FName AtWaypoint, float32 WaypointRadius=1000.000000, TSubclassOf< UNavArea > InNavArea=nullptr, UTerritoryConfig Territory=nullptr)
 Add this task to Sunny weather.
void ScheduleAnyWeather (int StartHour, int StartMinute, UCharacterAIState Task, FName AtWaypoint, float32 WaypointRadius=1000.000000, TSubclassOf< UNavArea > InNavArea=nullptr, UTerritoryConfig Territory=nullptr)
 Add this task to Cloudy weather.
void ScheduleDuringEvent (TSubclassOf< UAIWorldEvent > EventClass, int StartHour, int StartMinute, UCharacterAIState Task, FName AtWaypoint, float32 WaypointRadius=1000.000000, UTerritoryConfig Territory=nullptr)
 Add this task to be done if a certain event is active.
void ScheduleIfCloudy (int StartHour, int StartMinute, UCharacterAIState Task, FName AtWaypoint, float32 WaypointRadius=1000.000000, TSubclassOf< UNavArea > InNavArea=nullptr, UTerritoryConfig Territory=nullptr)
 Add this task to Cloudy weather.
void ScheduleIfRaining (int StartHour, int StartMinute, UCharacterAIState Task, FName AtWaypoint, float32 WaypointRadius=1000.000000, TSubclassOf< UNavArea > InNavArea=nullptr, UTerritoryConfig Territory=nullptr)
 Add this task to Raining weather.
void ScheduleIfRainingL2 (int StartHour, int StartMinute, UCharacterAIState Task, FName AtWaypoint, float32 WaypointRadius=1000.000000, TSubclassOf< UNavArea > InNavArea=nullptr, UTerritoryConfig Territory=nullptr)
 Add this task to Raining weather.
void ScheduleIfRainingL3 (int StartHour, int StartMinute, UCharacterAIState Task, FName AtWaypoint, float32 WaypointRadius=1000.000000, TSubclassOf< UNavArea > InNavArea=nullptr, UTerritoryConfig Territory=nullptr)
 Add this task to Raining weather.
void ScheduleRemoveAllForEvent (TSubclassOf< UAIWorldEvent > EventClass)
 Removes all ScheduleEntries that are for the given event class so you can override base behavior in a child class.
Public Member Functions inherited from UCharacterAIState
UCharacterAIState GetCurrentSubstate () const
 Returns the substate we're waiting for right now. (If there is one).
void AddDynamicOwnedGameplayTagToOwner (FGameplayTag Tag)
 Adds a new OwnedGameplayTag to the owner, but only if this AIState has not added one of these before. It's safe to call multiple times, it won't add more than 1 tag. The tags will be removed automatically once this state ends.
void AssessEventFromPerception (FRememberedPerception Perception, FPerceptionShortTermMemory Memory, FGameplayTag Assess)
 Performs an AssessEvent from the given perception.
void DisplayImGui ()
 Override to call ImGui:: Functions that are shown in the AIStates debug tool.
void DisplayOverheadImGui ()
 Override to call ImGui:: Functions that are shown in Overhead box.
void DrawStateImGui ()
 Draws this states imgui panel, callable from script/BP.
TArray< FName > GetSimulationPreferredLocationLoop () const
 Return an array with points that should be navigated to during daily routine simulation. Only required when the normal schedule waypoint is too far off.
void HandleStateEnded (EGenericTaskResult Result)
 Called when this state has ended. (Not if the character got destroyed).
void OnAnyPerceptionReceived (AActor Instigator, FGameplayTag Tag)
 Called when any perception event was triggered.
void OnGameplayTagEvent (const FGameplayTag Tag, FGameplayEventData EventData)
 Called when our AbilitySystemComponent received an event with any tag that was put into GameplayTagEventSubscriptions.
void SetupPerceptions (UCharacterPerceptionComponent Perception)
 Override this to setup the perception handlers for this state.
bool ShouldShowTaskInfoInImGui ()
 Override decide whether to show the imgui info of the base-class (currently awaited task, etc).
int CancelSubStatesOfClass (TSubclassOf< UCharacterAIState > Class)
 Cancels all currently running tasks/substates of the given class. Returns the number of cancelled states.
void DebugDrawInWorld () const
 Draws debug information in the world. Use outside PIE possible.
FBox EstimateMovementBoundingBox () const
 How far will the character go during this state?
AGothicCharacterState GetCharacterState () const
 Persistent state of this character.
AGothicAIController GetController () const
 Controller this state belongs to.
void BindAssessmentToPerception (FPerceptionHandler &PerceptionHandler, FGameplayTag WhenGained=FGameplayTag ::Empty, FGameplayTag WhenLost=FGameplayTag ::Empty)
FVector GetMoveGoalOffsetFor (const AActor TargetActor) const
 When following us/going towards us, offset the goal location by the returned value. This is useful for e.g. combat formations, where multiple characters follow a leader.
AGothicNPCState GetNPCState () const
 Persistent state of this character (If this is an NPC).
AGothicCharacter GetOther () const
 Other character that is relevant to this state. (If Others contains more than one Character, the first one is returned).
UCharacterAIState GetParentState () const
 Returns the state that started us as a substate. Nullptr if we are the root state.
AGothicCharacter GetSelf () const
 Character this state belongs to.
bool IsInSubStateOfClass (TSubclassOf< UCharacterAIState > Class)
 Returns true, if we're currently waiting for a substate of the given class.
bool IsSubStateOf (TSubclassOf< UCharacterAIState > Class)
 Returns true, if we're currently being run by a parent state of the given class.
bool MayDoGracefulExitNow () const
 Override and return true here for extra conditions on when a graceful exit is allowed. Note: Should be used in the states coroutine somewhere in conjunction with bShouldExitState.
void OnGracefulExitRequested ()
 Called from outside to signal that the state should gracefully end as soon as possible. This allows the proper animations to be played before switching to a different state.
bool PrefersGracefulExit () const
 Override and return true here if this state should do a graceful exit instead of an immediate switch, if possible. Note: Just a hint to external code.
void RemoveDynamicOwnedGameplayTagFromOwner (FGameplayTag Tag)
 Removes the given tag from the owner, as long as it has been added from this state's AddDynamicOwnedGameplayTagToOwner. This function will not touch Tags that were not added by this AIState. The tags will be removed automatically once this state ends.
void ResetWalkSpeed ()
 This task will no longer override the WalkSpeed but keeps subscription to WalkSpeedModifierComponent.
void RestartState ()
 Lets this state re-start its DoTask()-Coroutine. This can only be used on Script based AIStates!
void SetOther (AGothicCharacter Other)
 Sets the other character that is relevant to this state.
void SetWalkSpeed (EWalkSpeed WalkSpeed)
 Override WalkSpeed with the EGothicSpeedPriority::CharacterAIState while this task is alive or until user calls ResetWalkSpeed().
Public Member Functions inherited from UAbilityTaskCoroutine
void StopWaitingAndContinueTask ()
 Cancels any WaitSeconds/WaitTask/etc calls that were currently blocking the DoTask-Coroutine.
const EGenericTaskResult & WaitForFirstTaskToEnd (FAbilityTaskExecutor Task1, FAbilityTaskExecutor Task2, FAbilityTaskExecutor Task3=FAbilityTaskExecutor(), FAbilityTaskExecutor Task4=FAbilityTaskExecutor(), FAbilityTaskExecutor Task5=FAbilityTaskExecutor(), FAbilityTaskExecutor Task6=FAbilityTaskExecutor())
const EGenericTaskResult & WaitForLastTaskToEnd (FAbilityTaskExecutor Task1, FAbilityTaskExecutor Task2, FAbilityTaskExecutor Task3=FAbilityTaskExecutor(), FAbilityTaskExecutor Task4=FAbilityTaskExecutor(), FAbilityTaskExecutor Task5=FAbilityTaskExecutor(), FAbilityTaskExecutor Task6=FAbilityTaskExecutor())
const EGenericTaskResult & DoOneOf (float32 Weight1, FAbilityTaskExecutor Task1, float32 Weight2, FAbilityTaskExecutor Task2, float32 Weight3=0.0f, FAbilityTaskExecutor Task3=FAbilityTaskExecutor(), float32 Weight4=0.0f, FAbilityTaskExecutor Task4=FAbilityTaskExecutor(), float32 Weight5=0.0f, FAbilityTaskExecutor Task5=FAbilityTaskExecutor(), float32 Weight6=0.0f, FAbilityTaskExecutor Task6=FAbilityTaskExecutor(), float32 Weight7=0.0f, FAbilityTaskExecutor Task7=FAbilityTaskExecutor(), float32 Weight8=0.0f, FAbilityTaskExecutor Task8=FAbilityTaskExecutor())
void CancelAwaitedTaskAndEndAfterwards ()
 Cancels the task that is currently being executed by calling ExternalCancel on it.
void DoTask ()
 Override this in Script to define what should happen in this task!
void OnActivate ()
 Override this in Script to define what should happen when task is started.
void PerformAutoTimeskip ()
 Automatically executes the coroutine and requests timeskips on awaited tasks and timers. Override RequestTimeskip and call this to have this behavior for your task.
const EGenericTaskResult & WaitForTask (FAbilityTaskExecutor Task)
void WaitForEvent (UObject Object, FName MulticastDelegateName)
 Call from DoTask() - Waits until the given delegate on the given object is called.
const EGenericTaskResult & WaitForTask (UAbilityTaskGeneric Task)
 Call from DoTask() - Runs the given task and pauses the function until the task has ended.
const EGenericTaskResult & WaitForTaskTimeLimited (float32 CancelAfterSeconds, UAbilityTaskGeneric Task)
 Call from DoTask() - Runs the given task and pauses the function until the task has ended or the given time has passed. If the timer is reached, the task is cancelled.
void WaitOneTick ()
 Call from DoTask() - Pauses the function for one single tick and resumes execution in the next frame.
void WaitSeconds (float32 Seconds)
 Call from DoTask() - Pauses the function for time specified and resumes execution after the given time passed.
void WaitUntil (float32 WorldTimeSeconds)
 Call from DoTask() - Pauses the function until the world time (World.TimeSeconds) has reached the given time and resumes execution.
Public Member Functions inherited from UAbilityTaskGeneric
FInGameTime GetInGameTimeNow () const
 Returns the current InGame-Time (fast-forwarded when the player sleeps).
void HandleAvatarChanged ()
 Called when the Character this state belongs to was spawned or despawned.
void OnExternalCancel ()
 Override to decide what should happen when your task got cancelled from outside.
void EndTaskAsCancelled ()
 Call this instead of EndTask() to signal the task was cancelled.
void EndTaskAsFailure ()
 Call this instead of EndTask() to signal the task having failed.
void EndTaskAsSuccess ()
 Call this instead of EndTask() to signal the task ending successfully.
void EndTaskWithResult (EGenericTaskResult Result)
 Call this instead of EndTask() to signal the task having failed.
AGothicAIController GetAvatarAIController () const
 If the avatar is controlled by an AIController, returns it. Nullptr otherwise.
AGothicCharacter GetAvatarCharacter () const
 If the avatar is a GothicCharacter, returns it. Nullptr otherwise.
AGothicCharacterState GetAvatarCharacterState () const
 If the avatar is a GothicCharacter, returns its CharacterState. Nullptr otherwise.
AGothicNPCState GetAvatarNPCState () const
 If the avatar is a n NPC, returns its NPCState. Nullptr otherwise.
APlayerController GetAvatarPlayerController () const
 If the avatar is controlled by a PlayerController, returns it. Nullptr otherwise.
void ExternalCancel ()
FInGameTime GetRuntimeInGame () const
 How long this task has been running for (in InGame-time).
float32 GetRuntimeSeconds () const
 How long this task has been running for (in seconds).
float32 GetTimeRequestedToSkip () const
 Returns how many seconds we're supposed to skip.
void HandleTimeskipRequest ()
 Let this task skip forward in time, ie. teleporting the Avatar to their destination or somewhere along the way or skipping animations. Use GetTimeRequestedToSkip() and ReportTimeSkipped(...) to get info on how much to skip and to notify if you were able to skip something.
bool HasBeenActivated () const
 Returns true if ReadyForActivated has ever been called on this task.
bool HasTaskJustStarted (float32 ThresholdRealtimeSeconds=10.000000) const
 Returns true if this task has not been running for long yet. For Dailyroutine-Tasks this can be used to check if the task was activated via the regular schedule or re-activated after the schedule was interrupted.
bool IsInDailyRoutineSimulation () const
 Returns true, if this task is owned by an NPC that does DailyRoutine simulation (has no visuals) right now.
bool ReportTimeSkip (float32 SecondsThatWillBeSkipped)
 Reports that this task is able to skip some of the requested time to skip and requests for permission to do so. Returns true when the timeskip was accepted and it's okay to do the actions now.
bool ReportTimeSkipWhateverIsLeft ()
 Reports that this task would run forever and can skip all the time that we have left. Returns true when the timeskip was accepted and it's okay to do the actions now.
void SetCustomPathfollowingSetting (FGothicPathfollowSettings PathfollowSetting)
 When pathfollowing should behave different for this AIState, provide your own settings.
Public Member Functions inherited from UAbilityTaskBase
bool IsFinished () const
bool IsPaused () const
UAbilityTaskBase DuplicateTask (UGameplayAbility ToAbility, UObject Outer=nullptr)
bool IsDuplicateOf (const UAbilityTaskBase Other) const
 Returns true if this task was created by duplicating the given one.
void MakeChildOf (UAbilityTaskBase OtherTask)
bool IsActive () const
Public Member Functions inherited from UAngelscriptAbilityTask
void OnDestroy (bool bInOwnerFinished)
void InitSimulatedTask (UGameplayTasksComponent InGameplayTasksComponent)
bool IsWaitingOnAvatar () const
void Activate ()
bool IsWaitingOnRemotePlayerdata () const
void TickTask (float32 DeltaTimeSecs)
void SetWaitingOnAvatar ()
void ClearWaitingOnAvatar ()
void ClearWaitingOnRemotePlayerData ()
UGameplayAbility BP_GetAbility (bool bInOwnerFinished) const
FGameplayAbilitySpecHandle GetAbilitySpecHandle (bool bInOwnerFinished) const
UAbilitySystemComponent GetAbilitySystemComponent ()
bool ShouldBroadcastAbilityTaskDelegates () const
bool IsForRemoteClient () const
bool IsLocallyControlled () const
bool IsPredictingClient () const
UGameplayAbility GetAbility () const
bool GetIsPausable ()
void SetIsPausable (bool bNewState)
void SetIsSimulatedTask (bool bNewState)
void SetAbilitySystemComponent (UAbilitySystemComponent InAbilitySystemComponent)
void SetIsTickingTask (bool bNewState)
void SetWaitingOnRemotePlayerData ()
bool GetIsSimulatedTask ()
bool GetIsSimulating ()
bool GetIsTickingTask ()
Public Member Functions inherited from UGameplayTask
void ReadyForActivation ()
void EndTask ()
 Called explicitly to end the task (usually by the task itself). Calls OnDestroy. Note:: you need to call EndTask before sending out any "on completed" delegates. If you don't the task will still be in an "active" state while the event receivers may assume it's already "finished".
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 UClass StaticClass ()
Static Public Member Functions inherited from UCharacterAIState
static UClass StaticClass ()
static UCharacterAIState CreateFromClass (TSubclassOf< UCharacterAIState > Class, UGameplayAbility_CharacterAI OwningAI)
 Instantiates an AIState from class, makes them easier to be used from script if all you have is a class!
Static Public Member Functions inherited from UAbilityTaskCoroutine
static UClass StaticClass ()
Static Public Member Functions inherited from UAbilityTaskGeneric
static UClass StaticClass ()
Static Public Member Functions inherited from UAbilityTaskBase
static UClass StaticClass ()
Static Public Member Functions inherited from UAngelscriptAbilityTask
static UClass StaticClass ()
static UAngelscriptAbilityTask CreateAbilityTaskAndRunIt (TSubclassOf< UAngelscriptAbilityTask > TaskType, UGameplayAbility ThisAbility, FName NewInstanceName=NAME_None)
 This method will both create the task and call ReadyForActivation on it for you immediately.
static UAngelscriptAbilityTask CreateAbilityTask (TSubclassOf< UAngelscriptAbilityTask > TaskType, UGameplayAbility ThisAbility, FName NewInstanceName=NAME_None, UObject Outer=nullptr)
 If you create a task using this function from AS, you must start it manually using ReadyForActivation. This is useful if you want to set up properties on the task before you run it.
Static Public Member Functions inherited from UAbilityTask
static UClass StaticClass ()
Static Public Member Functions inherited from UGameplayTask
static UClass StaticClass ()
Static Public Member Functions inherited from UObject
static UClass StaticClass ()

Public Attributes

AIState_DailyRoutine
TMap< TSubclassOf< UQuest >, TSubclassOf< UAIState_DailyRoutine > > SwitchToRoutineOnQuestSuccess
 Auto-switch to these routine if the given quest succeeds.
float32 ScheduleTimeOffsetMinutesMax
 Upper bound of the random offset to applied to each schedule entry to get some automatic variance.
float32 WeatherPerceptionDelay
 How many seconds to wait until the character notices a change in weather.
float32 WeatherPerceptionDelayVariance
 Max. random amount of seconds added to the WeatherPerceptionDelay.
TArray< FDailyRoutineTaskDescription > SortedTaskList
 List of tasks to execute over the day, sorted by by clock time. If there are multiple tasks with the same time, the last one (with a true condition) of them will be executed. The rest will be skipped.
UCharacterAIState InterruptState
 Something we might be doing out-of-order, like checking the weather or a magic moment.
TSubclassOf< UCharacterAIState > FallbackTaskClass
 Task to do when the character is stuck or has no state anymore.
TMap< FName, FName > KnownPlaces
 Locations this character remembers by name, e.g. their bed or working place.
EDailyRoutineTeleportMode TeleportToCurrentTaskWhen
 When this DailyRoutine is entered (or for whatever other reason) and the character is found to be outside of this routines bounds, you may teleport them to somewhere within the bounds of their routines instead of having them walk there.
bool bSimulateRoutineTasksFromStartTime
 If true, when a Task is started, it's TimeStartedAt will be set to the one it was scheduled with (instead of current world time). The task will then fast-forward to the current time.
FBox CurrentMovementBoundsEstimation
 Current estimate on where we will be moving during this daily routine.
FInGameTime AutoSwitchAfterTime
 If set, the NPC will switch to AutoSwitchToRoutine after the given time has passed.
TSubclassOf< UAIState_DailyRoutine > AutoSwitchToRoutine
 NPC will switch to this after the time in AutoSwitchAfterTime has passed.
float32 ScheduleTimeOffsetMinutesMin
 Lower bound of the random offset to applied to each schedule entry to get some automatic variance (Can also be negative!).
TMap< TSubclassOf< UQuest >, TSubclassOf< UAIState_DailyRoutine > > SwitchToRoutineOnQuestFail
 Auto-switch to these routine if the given quest fails.
UAIAssessmentResponseModule PassiveAssessmentModule
 How to react to certain perception events that happen while the routine is not active but assigned to the character.
TArray< TSubclassOf< UActivePersonalRelationshipModifier > > RelationshipModifiersToApply
 Relationship modifiers to apply while this DailyRoutine is assigned. (Doesn't have to be active, just assigned to the NPC).
FGameplayTagContainer RolesWhileAssigned
 Assigned Role of the NPC during the Routine (will be on the character even if the routine is not active).
FPersonalAreaOwnershipSettings AreaOwnership
 Areas considered "personally owned" while this DailyRoutine is assigned (even when inactive) to a character.
FPersonalItemOwnershipSettings ItemOwnership
 Items considered "personally owned" while this DailyRoutine is assigned (even when inactive) to a character.
FInGameTime RestoreAttributesAfterTimespan
 If set, restores this NPCs attributes if at least this much time has passed while doing their daily routine. Only when in simulation and not actually spawned and visible to the player.
FInGameTime TryReviveAfterTimespan
 If set, revives and restores this NPCs attributes if at least this much time has passed after they were killed during an NPC-only fight.
FGameplayTagContainer TryReviveIfDeathMemoryHasAnyOf
 If TryReviveAfterTimespan is set, revive this character during simulation if it died with any of these tags in it's death LongTermMemory event.
bool bForceSimulationUpdateEveryTick
 If true, this DailyRoutine will request forced updates while in simulation, even when time is not advancing.
FGameplayTagContainer AssociatedCrimeAreas
Variables
const EWeather Weather
 Returns the current weather conditions for the characters location.
Public Attributes inherited from UCharacterAIState
FGameplayTagContainer OwnedGameplayTags
 Tags that are applied to the character while this state is active.
bool bShouldExitState
 Can be set from outside to signal to this state that it should gracefully end as soon as possible.
bool bSupportsSimulatedSteps
TSubclassOf< UAIAssessmentResponseModule > AssessmentModuleClass
 How to react to certain perception events.
UAIAssessmentResponseModule AssessmentModule
 Only populated when the character is spawned. Created from AssessmentModuleClass.
TSubclassOf< UAIWorldEventExplicit > WorldEventToActivate
 If set, this will start/end the given AIWorldEvent while the state is active.
FName IdleFocusSpotName
 Spot to look at while this AiState is active and the character is standing around.
FGameplayTagContainer GameplayTagEventSubscriptions
 Defines which gameplay events will cause OnGameplayTagEvent() to be called.
TArray< AGothicCharacter > Others
 List of other characters that are relevant to this state.
const AGothicCharacterState CharacterState
 Persistent state of this character.
const AGothicAIController Controller
 Controller this state belongs to.
const UCharacterAIState CurrentSubstate
 Returns the substate we're waiting for right now. (If there is one).
const AGothicNPCState NPCState
 Persistent state of this character (If this is an NPC).
AGothicCharacter Other
 Other character that is relevant to this state. (If Others contains more than one Character, the first one is returned).
const UCharacterAIState ParentState
 Returns the state that started us as a substate. Nullptr if we are the root state.
const AGothicCharacter Self
 Character this state belongs to.
const TArray< FName > SimulationPreferredLocationLoop
Public Attributes inherited from UAbilityTaskCoroutine
bool bIsHighPriorityBudget
 If true, will enqueue this task into the HighPriority budget system queue. Can be changed dynamically at runtime to affect the next enqueue.
FName BudgetWorkload
 If set, uses the BudgetSystem to continue execution after the coroutine was paused. Can be changed dynamically at runtime to affect the next enqueue.
Public Attributes inherited from UAbilityTaskGeneric
FAbilityTaskEndedAnyResultDelegate__AbilityTaskGeneric OnTaskEnded
 Task ended (always called, no matter what the result is).
EGenericTaskResult TaskResult
 Use EndTaskAsSuccess() or EndTaskAsFailure() or set this before calling EndTask() to signal the end result of this task.
FInGameTime TimeTaskActivated
 Ingame time this task was activated.
const AGothicCharacter AvatarCharacter
 If the avatar is a GothicCharacter, returns it. Nullptr otherwise.
const AGothicCharacterState AvatarCharacterState
 If the avatar is a GothicCharacter, returns its CharacterState. Nullptr otherwise.
const AGothicAIController AvatarAIController
 If the avatar is controlled by an AIController, returns it. Nullptr otherwise.
const AGothicNPCState AvatarNPCState
 If the avatar is a n NPC, returns its NPCState. Nullptr otherwise.
const APlayerController AvatarPlayerController
 If the avatar is controlled by a PlayerController, returns it. Nullptr otherwise.
const FInGameTime InGameTimeNow
 Returns the current InGame-Time (fast-forwarded when the player sleeps).
const FInGameTime RuntimeInGame
 How long this task has been running for (in InGame-time).
const float32 RuntimeSeconds
 How long this task has been running for (in seconds).
const float32 TimeRequestedToSkip
 Returns how many seconds we're supposed to skip.
Public Attributes inherited from UAngelscriptAbilityTask
const UGameplayAbility Ability
 GameplayAbility that created us.
UAbilitySystemComponent AbilitySystemComponent
const bool IsSimulating
bool IsPausable
bool IsSimulatedTask
bool IsTickingTask
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

Base-task for the daily routines the characters are supposed to have. The AI switches to Daily Routines, if there are no other things to do right now.

Member Function Documentation

◆ AddRoutineTaskEx()

void AddRoutineTaskEx ( FDailyRoutineTaskDescription TaskDesc)

◆ DoInterruptState()

void DoInterruptState ( UCharacterAIState StateTemplate)

Pauses the current task and does the given state instead (until it finishes).

◆ DoInterruptStateOfClass()

void DoInterruptStateOfClass ( TSubclassOf< UCharacterAIState > StateClass)

Pauses the current task and does the given state instead (until it finishes).

◆ GetScheduleSecondsRandomOffset()

int GetScheduleSecondsRandomOffset ( int Day) const

Each character can have some random offset to the times in their schedule, so they don't all start new tasks at exactly the same time.

◆ GetWeather()

EWeather GetWeather ( ) const

Returns the current weather conditions for the characters location.

◆ HandleWeatherChange()

void HandleWeatherChange ( EWeather PreviousWeather,
EWeather NewWeather )

Called when this routine would switch schedules because of a change in weather. Allows to put interrupt-states to react to the new weather.

◆ IsDoingInterruptState()

bool IsDoingInterruptState ( ) const

Returns true if an interrupt state is currently active.

◆ NeedsAttributeRestore()

bool NeedsAttributeRestore ( ) const

Returns true if this character has taken damage (or spent Mana, etc) and would need a restore.

◆ OverridePreferredLocationForRoutineTask()

bool OverridePreferredLocationForRoutineTask ( FDailyRoutineTaskDescription Desc,
UPreferredLocationComponent PreferredLocation ) const

Set a custom preferred location for the given routine task. Return true if you set anything.

◆ RequestDailyRoutineScheduleUpdate()

void RequestDailyRoutineScheduleUpdate ( )

Re-evaluates the daily routine schedule, e.g. when the weather changed.

◆ RequestDailyRoutineScheduleUpdateWithRandomTimeOffset()

void RequestDailyRoutineScheduleUpdateWithRandomTimeOffset ( )

Same as RequestDailyRoutineScheduleUpdate but will wait a random amount of time before doing the update. This is so not all characters will start moving at the exact same moment.

◆ RestoreAttributes()

void RestoreAttributes ( )

Will fully restore this NPCs health, mana, etc.

◆ Schedule()

void Schedule ( int StartHour,
int StartMinute,
UCharacterAIState Task,
FName AtWaypoint,
float32 WaypointRadius = 1000.000000,
TSubclassOf< UNavArea > InNavArea = nullptr,
UTerritoryConfig Territory = nullptr )

Add this task to Sunny weather.

◆ ScheduleAnyWeather()

void ScheduleAnyWeather ( int StartHour,
int StartMinute,
UCharacterAIState Task,
FName AtWaypoint,
float32 WaypointRadius = 1000.000000,
TSubclassOf< UNavArea > InNavArea = nullptr,
UTerritoryConfig Territory = nullptr )

Add this task to Cloudy weather.

◆ ScheduleDuringEvent()

void ScheduleDuringEvent ( TSubclassOf< UAIWorldEvent > EventClass,
int StartHour,
int StartMinute,
UCharacterAIState Task,
FName AtWaypoint,
float32 WaypointRadius = 1000.000000,
UTerritoryConfig Territory = nullptr )

Add this task to be done if a certain event is active.

◆ ScheduleIfCloudy()

void ScheduleIfCloudy ( int StartHour,
int StartMinute,
UCharacterAIState Task,
FName AtWaypoint,
float32 WaypointRadius = 1000.000000,
TSubclassOf< UNavArea > InNavArea = nullptr,
UTerritoryConfig Territory = nullptr )

Add this task to Cloudy weather.

◆ ScheduleIfRaining()

void ScheduleIfRaining ( int StartHour,
int StartMinute,
UCharacterAIState Task,
FName AtWaypoint,
float32 WaypointRadius = 1000.000000,
TSubclassOf< UNavArea > InNavArea = nullptr,
UTerritoryConfig Territory = nullptr )

Add this task to Raining weather.

◆ ScheduleIfRainingL2()

void ScheduleIfRainingL2 ( int StartHour,
int StartMinute,
UCharacterAIState Task,
FName AtWaypoint,
float32 WaypointRadius = 1000.000000,
TSubclassOf< UNavArea > InNavArea = nullptr,
UTerritoryConfig Territory = nullptr )

Add this task to Raining weather.

◆ ScheduleIfRainingL3()

void ScheduleIfRainingL3 ( int StartHour,
int StartMinute,
UCharacterAIState Task,
FName AtWaypoint,
float32 WaypointRadius = 1000.000000,
TSubclassOf< UNavArea > InNavArea = nullptr,
UTerritoryConfig Territory = nullptr )

Add this task to Raining weather.

◆ ScheduleRemoveAllForEvent()

void ScheduleRemoveAllForEvent ( TSubclassOf< UAIWorldEvent > EventClass)

Removes all ScheduleEntries that are for the given event class so you can override base behavior in a child class.

◆ StaticClass()

UClass StaticClass ( )
static

Member Data Documentation

◆ AreaOwnership

Areas considered "personally owned" while this DailyRoutine is assigned (even when inactive) to a character.

◆ AssociatedCrimeAreas

FGameplayTagContainer AssociatedCrimeAreas

◆ AutoSwitchAfterTime

FInGameTime AutoSwitchAfterTime

If set, the NPC will switch to AutoSwitchToRoutine after the given time has passed.

◆ AutoSwitchToRoutine

TSubclassOf<UAIState_DailyRoutine> AutoSwitchToRoutine

NPC will switch to this after the time in AutoSwitchAfterTime has passed.

◆ bForceSimulationUpdateEveryTick

bool bForceSimulationUpdateEveryTick

If true, this DailyRoutine will request forced updates while in simulation, even when time is not advancing.

◆ bSimulateRoutineTasksFromStartTime

bool bSimulateRoutineTasksFromStartTime

If true, when a Task is started, it's TimeStartedAt will be set to the one it was scheduled with (instead of current world time). The task will then fast-forward to the current time.

If false, the task will start and go from the current time (ie. not teleporting to the "would be here" spot)

◆ CurrentMovementBoundsEstimation

FBox CurrentMovementBoundsEstimation

Current estimate on where we will be moving during this daily routine.

◆ FallbackTaskClass

TSubclassOf<UCharacterAIState> FallbackTaskClass

Task to do when the character is stuck or has no state anymore.

◆ InterruptState

UCharacterAIState InterruptState

Something we might be doing out-of-order, like checking the weather or a magic moment.

◆ ItemOwnership

Items considered "personally owned" while this DailyRoutine is assigned (even when inactive) to a character.

◆ KnownPlaces

TMap<FName,FName> KnownPlaces

Locations this character remembers by name, e.g. their bed or working place.

◆ PassiveAssessmentModule

UAIAssessmentResponseModule PassiveAssessmentModule

How to react to certain perception events that happen while the routine is not active but assigned to the character.

◆ RelationshipModifiersToApply

TArray<TSubclassOf<UActivePersonalRelationshipModifier> > RelationshipModifiersToApply

Relationship modifiers to apply while this DailyRoutine is assigned. (Doesn't have to be active, just assigned to the NPC).

◆ RestoreAttributesAfterTimespan

FInGameTime RestoreAttributesAfterTimespan

If set, restores this NPCs attributes if at least this much time has passed while doing their daily routine. Only when in simulation and not actually spawned and visible to the player.

◆ RolesWhileAssigned

FGameplayTagContainer RolesWhileAssigned

Assigned Role of the NPC during the Routine (will be on the character even if the routine is not active).

◆ ScheduleTimeOffsetMinutesMax

float32 ScheduleTimeOffsetMinutesMax

Upper bound of the random offset to applied to each schedule entry to get some automatic variance.

◆ ScheduleTimeOffsetMinutesMin

float32 ScheduleTimeOffsetMinutesMin

Lower bound of the random offset to applied to each schedule entry to get some automatic variance (Can also be negative!).

◆ SortedTaskList

List of tasks to execute over the day, sorted by by clock time. If there are multiple tasks with the same time, the last one (with a true condition) of them will be executed. The rest will be skipped.

◆ SwitchToRoutineOnQuestFail

TMap<TSubclassOf<UQuest>,TSubclassOf<UAIState_DailyRoutine> > SwitchToRoutineOnQuestFail

Auto-switch to these routine if the given quest fails.

◆ SwitchToRoutineOnQuestSuccess

TMap<TSubclassOf<UQuest>,TSubclassOf<UAIState_DailyRoutine> > SwitchToRoutineOnQuestSuccess

Auto-switch to these routine if the given quest succeeds.

◆ TeleportToCurrentTaskWhen

EDailyRoutineTeleportMode TeleportToCurrentTaskWhen

When this DailyRoutine is entered (or for whatever other reason) and the character is found to be outside of this routines bounds, you may teleport them to somewhere within the bounds of their routines instead of having them walk there.

Example: After talking to Diego on GameStart, he could teleport straight to his Bench in the OldCamp after you ran so far that he unloaded.

If "Never", the character will always walk after switching daily routines, even when unloaded.

◆ TryReviveAfterTimespan

FInGameTime TryReviveAfterTimespan

If set, revives and restores this NPCs attributes if at least this much time has passed after they were killed during an NPC-only fight.

◆ TryReviveIfDeathMemoryHasAnyOf

FGameplayTagContainer TryReviveIfDeathMemoryHasAnyOf

If TryReviveAfterTimespan is set, revive this character during simulation if it died with any of these tags in it's death LongTermMemory event.

◆ Weather

const EWeather Weather

Returns the current weather conditions for the characters location.

◆ WeatherPerceptionDelay

float32 WeatherPerceptionDelay

How many seconds to wait until the character notices a change in weather.

◆ WeatherPerceptionDelayVariance

float32 WeatherPerceptionDelayVariance

Max. random amount of seconds added to the WeatherPerceptionDelay.