|
static float | GetDistanceFactor (Vector2 selfPos, Vector2 targetWorldPos, float factorAtMaxDistance, float verticalDistanceMultiplier=3, float maxDistance=10000.0f, float factorAtMinDistance=1.0f) |
| Get a normalized value representing how close the target position is. The value is a rough estimation, where vertical movement is assumed to be more costly than horizontal.
|
|
|
void | HandleDisallowed () |
|
virtual float | GetPriority () |
|
float | GetDistanceFactor (Vector2 targetWorldPos, float factorAtMaxDistance, float verticalDistanceMultiplier=3, float maxDistance=10000.0f, float factorAtMinDistance=1.0f) |
| Get a normalized value representing how close the target position is. The value is a rough estimation, where vertical movement is assumed to be more costly than horizontal.
|
|
virtual void | SyncRemovedObjectives< T1, T2 > (Dictionary< T1, T2 > dictionary, IEnumerable< T1 > collection) |
| Checks if the subobjectives in the given collection are removed from the subobjectives. And if so, removes it also from the dictionary.
|
|
bool | TryAddSubObjective< T > (ref T objective, Func< T > constructor, Action onCompleted=null, Action onAbandon=null) |
| Checks if the objective already is created and added in subobjectives. If not, creates it. Handles objectives that cannot be completed. If the objective has been removed form the subobjectives, a null value is assigned to the reference. Returns true if the objective was created and successfully added.
|
|
virtual void | OnCompleted () |
|
virtual void | OnAbandon () |
|
void | Act (float deltaTime) |
|
bool | CheckObjectiveSpecific () |
| Should return whether the objective is completed or not.
|
|
bool | CanEquip (Item item, bool allowWearing) |
|
|
virtual float | Devotion [get] |
|
Identifier | Identifier [get, set] |
|
virtual string | DebugTag [get] |
|
virtual bool | ForceRun [get] |
|
virtual bool | IgnoreUnsafeHulls [get] |
|
virtual bool | AbandonWhenCannotCompleteSubObjectives [get] |
|
virtual bool | AllowSubObjectiveSorting [get] |
| Should subobjectives be sorted according to their priority?
|
|
virtual bool | PrioritizeIfSubObjectivesActive [get] |
|
virtual bool | AllowMultipleInstances [get] |
| Can there be multiple objective instaces of the same type?
|
|
virtual bool | ConcurrentObjectives [get] |
| Run the main objective with all subobjectives concurrently? If false, the main objective will continue only when all the subobjectives have been removed (done).
|
|
virtual bool | KeepDivingGearOn [get] |
|
virtual bool | KeepDivingGearOnAlsoWhenInactive [get] |
|
virtual bool | AllowAutomaticItemUnequipping [get] |
| There's a separate property for diving suit and mask: KeepDivingGearOn.
|
|
virtual bool | AllowOutsideSubmarine [get] |
|
virtual bool | AllowInFriendlySubs [get] |
| When true, the objective is allowed in the player subs (when in the same team) and on friendly outposts (regardless of the alignment). Note: ignored when AllowInAnySub is true.
|
|
virtual bool | AllowInAnySub [get] |
|
virtual bool | AllowWhileHandcuffed [get] |
|
virtual bool | AbandonIfDisallowed [get] |
| Should the objective abandon when it's not allowed in the current context or should it just stay inactive with 0 priority? Abandoned automatic objectives are removed and recreated automatically (when new orders are assigned or after a cooldown period). Abandoned orders are removed, but the most recent order can be reissued by clicking the small order icon with the arrow in the crew manager panel.
|
|
virtual bool | CanBeCompleted [get] |
|
virtual float | MaxDevotion [get] |
|
float | CumulatedDevotion [get, set] |
|
float | Priority [get, set] |
| Final priority value after all calculations.
|
|
float | BasePriority [get, set] |
|
float | PriorityModifier = 1 [get] |
|
bool | ForceHighestPriority [get, set] |
|
bool | ForceWalk [get, set] |
|
bool | IgnoreAtOutpost [get, set] |
|
bool | Abandon [get, set] |
|
IEnumerable< AIObjective > | SubObjectives [get] |
|
AIObjective | CurrentSubObjective [get] |
|
HumanAIController | HumanAIController [get] |
|
IndoorsSteeringManager | PathSteering [get] |
|
SteeringManager | SteeringManager [get] |
|
bool | IsAllowed [get] |
|
bool | IsCompleted [get, protected set] |
|
|
Action | Completed |
| A single shot event. Automatically cleared after launching. Use OnCompleted method for implementing (internal) persistent behavior.
|
|
Action | Abandoned |
| A single shot event. Automatically cleared after launching. Use OnAbandoned method for implementing (internal) persistent behavior.
|
|
Action | Selected |
| A single shot event. Automatically cleared after launching. Use OnSelected method for implementing (internal) persistent behavior.
|
|
Action | Deselected |
| A single shot event. Automatically cleared after launching. Use OnDeselected method for implementing (internal) persistent behavior.
|
|
◆ AIObjective()
◆ Act()
void Barotrauma.AIObjective.Act |
( |
float | deltaTime | ) |
|
|
abstractprotected |
◆ AddSubObjective()
void Barotrauma.AIObjective.AddSubObjective |
( |
AIObjective | objective, |
|
|
bool | addFirst = false ) |
◆ CalculatePriority()
float Barotrauma.AIObjective.CalculatePriority |
( |
| ) |
|
Call this only when the priority needs to be recalculated. Use the cached Priority property when you don't need to recalculate.
◆ CanEquip()
bool Barotrauma.AIObjective.CanEquip |
( |
Item | item, |
|
|
bool | allowWearing ) |
|
protected |
◆ CanPutInInventory()
static bool Barotrauma.AIObjective.CanPutInInventory |
( |
Character | character, |
|
|
Item | item, |
|
|
bool | allowWearing ) |
|
staticprotected |
◆ CheckObjectiveSpecific()
bool Barotrauma.AIObjective.CheckObjectiveSpecific |
( |
| ) |
|
|
abstractprotected |
Should return whether the objective is completed or not.
◆ GetActiveObjective()
AIObjective Barotrauma.AIObjective.GetActiveObjective |
( |
| ) |
|
◆ GetDistanceFactor() [1/2]
static float Barotrauma.AIObjective.GetDistanceFactor |
( |
Vector2 | selfPos, |
|
|
Vector2 | targetWorldPos, |
|
|
float | factorAtMaxDistance, |
|
|
float | verticalDistanceMultiplier = 3, |
|
|
float | maxDistance = 10000::0f, |
|
|
float | factorAtMinDistance = 1::0f ) |
|
static |
Get a normalized value representing how close the target position is. The value is a rough estimation, where vertical movement is assumed to be more costly than horizontal.
- Parameters
-
targetWorldPos | Position of the target |
verticalDistanceMultiplier | How much more costly vertical movement is than horizontal |
maxDistance | Maximum distance, after which the factor will reach it's minimum value (= anything beyond this point is "as far as it can be"). |
factorAtMaxDistance | The factor at the maximum distance and beyond (= how "viable" very far-away targets should be considered). |
factorAtMinDistance | The factor at the minimum distance (= how viable a target that's 0 units a way is considered). |
◆ GetDistanceFactor() [2/2]
float Barotrauma.AIObjective.GetDistanceFactor |
( |
Vector2 | targetWorldPos, |
|
|
float | factorAtMaxDistance, |
|
|
float | verticalDistanceMultiplier = 3, |
|
|
float | maxDistance = 10000::0f, |
|
|
float | factorAtMinDistance = 1::0f ) |
|
protected |
Get a normalized value representing how close the target position is. The value is a rough estimation, where vertical movement is assumed to be more costly than horizontal.
- Parameters
-
targetWorldPos | Position of the target |
verticalDistanceMultiplier | How much more costly vertical movement is than horizontal |
maxDistance | Maximum distance, after which the factor will reach it's minimum value (= anything beyond this point is "as far as it can be"). |
factorAtMaxDistance | The factor at the maximum distance and beyond (= how "viable" very far-away targets should be considered). |
factorAtMinDistance | The factor at the minimum distance (= how viable a target that's 0 units a way is considered). |
◆ GetPriority()
virtual float Barotrauma.AIObjective.GetPriority |
( |
| ) |
|
|
protectedvirtual |
Reimplemented in Barotrauma.AIObjectiveCheckStolenItems, Barotrauma.AIObjectiveCleanupItem, Barotrauma.AIObjectiveCombat, Barotrauma.AIObjectiveEscapeHandcuffs, Barotrauma.AIObjectiveExtinguishFire, Barotrauma.AIObjectiveFindSafety, Barotrauma.AIObjectiveFixLeak, Barotrauma.AIObjectiveGoTo, Barotrauma.AIObjectiveIdle, Barotrauma.AIObjectiveInspectNoises, Barotrauma.AIObjectiveLoadItem, Barotrauma.AIObjectiveLoop< T >, Barotrauma.AIObjectiveOperateItem, Barotrauma.AIObjectivePrepare, Barotrauma.AIObjectiveRepairItem, Barotrauma.AIObjectiveRescue, and Barotrauma.AIObjectiveReturn.
◆ GetSubObjectivesRecursive()
IEnumerable< AIObjective > Barotrauma.AIObjective.GetSubObjectivesRecursive |
( |
bool | includingSelf = false | ) |
|
◆ HandleDisallowed()
void Barotrauma.AIObjective.HandleDisallowed |
( |
| ) |
|
|
protected |
◆ IsDuplicate< T >()
virtual bool Barotrauma.AIObjective.IsDuplicate< T > |
( |
T | otherObjective | ) |
|
|
virtual |
◆ IsIgnoredAtOutpost()
bool Barotrauma.AIObjective.IsIgnoredAtOutpost |
( |
| ) |
|
Returns true only when at a friendly outpost and when the order is set to be ignored there. Note that even if this returns false, the objective can be disallowed, because AllowInFriendlySubs is false.
◆ OnAbandon()
virtual void Barotrauma.AIObjective.OnAbandon |
( |
| ) |
|
|
protectedvirtual |
◆ OnCompleted()
virtual void Barotrauma.AIObjective.OnCompleted |
( |
| ) |
|
|
protectedvirtual |
◆ OnDeselected()
virtual void Barotrauma.AIObjective.OnDeselected |
( |
| ) |
|
|
virtual |
◆ OnSelected()
virtual void Barotrauma.AIObjective.OnSelected |
( |
| ) |
|
|
virtual |
◆ RemoveSubObjective< T >()
void Barotrauma.AIObjective.RemoveSubObjective< T > |
( |
ref T | objective | ) |
|
◆ Reset()
virtual void Barotrauma.AIObjective.Reset |
( |
| ) |
|
|
virtual |
Reimplemented in Barotrauma.AIObjectiveCheckStolenItems, Barotrauma.AIObjectiveCleanupItem, Barotrauma.AIObjectiveCombat, Barotrauma.AIObjectiveContainItem, Barotrauma.AIObjectiveDeconstructItem, Barotrauma.AIObjectiveDecontainItem, Barotrauma.AIObjectiveEscapeHandcuffs, Barotrauma.AIObjectiveExtinguishFire, Barotrauma.AIObjectiveFindDivingGear, Barotrauma.AIObjectiveFindSafety, Barotrauma.AIObjectiveFixLeak, Barotrauma.AIObjectiveGetItem, Barotrauma.AIObjectiveGetItems, Barotrauma.AIObjectiveGoTo, Barotrauma.AIObjectiveIdle, Barotrauma.AIObjectiveLoadItem, Barotrauma.AIObjectiveLoop< T >, Barotrauma.AIObjectiveOperateItem, Barotrauma.AIObjectivePrepare, Barotrauma.AIObjectiveRepairItem, Barotrauma.AIObjectiveRescue, and Barotrauma.AIObjectiveReturn.
◆ SortSubObjectives()
void Barotrauma.AIObjective.SortSubObjectives |
( |
| ) |
|
◆ SpeakAfterOrderReceived()
virtual void Barotrauma.AIObjective.SpeakAfterOrderReceived |
( |
| ) |
|
|
virtual |
◆ SyncRemovedObjectives< T1, T2 >()
virtual void Barotrauma.AIObjective.SyncRemovedObjectives< T1, T2 > |
( |
Dictionary< T1, T2 > | dictionary, |
|
|
IEnumerable< T1 > | collection ) |
|
protectedvirtual |
Checks if the subobjectives in the given collection are removed from the subobjectives. And if so, removes it also from the dictionary.
◆ TryAddSubObjective< T >()
bool Barotrauma.AIObjective.TryAddSubObjective< T > |
( |
ref T | objective, |
|
|
Func< T > | constructor, |
|
|
Action | onCompleted = null, |
|
|
Action | onAbandon = null ) |
|
protected |
Checks if the objective already is created and added in subobjectives. If not, creates it. Handles objectives that cannot be completed. If the objective has been removed form the subobjectives, a null value is assigned to the reference. Returns true if the objective was created and successfully added.
◆ TryComplete()
void Barotrauma.AIObjective.TryComplete |
( |
float | deltaTime | ) |
|
Makes the character act according to the objective, or according to any subobjectives that need to be completed before this one.
◆ Update()
virtual void Barotrauma.AIObjective.Update |
( |
float | deltaTime | ) |
|
|
virtual |
◆ AbortCondition
Func<AIObjective, bool> Barotrauma.AIObjective.AbortCondition |
Aborts the objective when this condition is true.
◆ character
readonly Character Barotrauma.AIObjective.character |
◆ objectiveManager
◆ Option
◆ SourceEventAction
Which event action (if any) created this objective.
◆ SourceObjective
Which objective (if any) created this objective. When this is a subobjective, the parent objective is used by default.
◆ subObjectives
◆ Abandon
bool Barotrauma.AIObjective.Abandon |
|
getset |
◆ AbandonIfDisallowed
virtual bool Barotrauma.AIObjective.AbandonIfDisallowed |
|
getprotected |
Should the objective abandon when it's not allowed in the current context or should it just stay inactive with 0 priority? Abandoned automatic objectives are removed and recreated automatically (when new orders are assigned or after a cooldown period). Abandoned orders are removed, but the most recent order can be reissued by clicking the small order icon with the arrow in the crew manager panel.
◆ AbandonWhenCannotCompleteSubObjectives
virtual bool Barotrauma.AIObjective.AbandonWhenCannotCompleteSubObjectives |
|
get |
◆ AllowAutomaticItemUnequipping
virtual bool Barotrauma.AIObjective.AllowAutomaticItemUnequipping |
|
get |
There's a separate property for diving suit and mask: KeepDivingGearOn.
◆ AllowInAnySub
virtual bool Barotrauma.AIObjective.AllowInAnySub |
|
getprotected |
◆ AllowInFriendlySubs
virtual bool Barotrauma.AIObjective.AllowInFriendlySubs |
|
getprotected |
When true, the objective is allowed in the player subs (when in the same team) and on friendly outposts (regardless of the alignment). Note: ignored when AllowInAnySub is true.
◆ AllowMultipleInstances
virtual bool Barotrauma.AIObjective.AllowMultipleInstances |
|
get |
Can there be multiple objective instaces of the same type?
◆ AllowOutsideSubmarine
virtual bool Barotrauma.AIObjective.AllowOutsideSubmarine |
|
getprotected |
◆ AllowSubObjectiveSorting
virtual bool Barotrauma.AIObjective.AllowSubObjectiveSorting |
|
get |
Should subobjectives be sorted according to their priority?
◆ AllowWhileHandcuffed
virtual bool Barotrauma.AIObjective.AllowWhileHandcuffed |
|
getprotected |
◆ BasePriority
float Barotrauma.AIObjective.BasePriority |
|
getset |
◆ CanBeCompleted
virtual bool Barotrauma.AIObjective.CanBeCompleted |
|
get |
◆ ConcurrentObjectives
virtual bool Barotrauma.AIObjective.ConcurrentObjectives |
|
getprotected |
Run the main objective with all subobjectives concurrently? If false, the main objective will continue only when all the subobjectives have been removed (done).
◆ CumulatedDevotion
float Barotrauma.AIObjective.CumulatedDevotion |
|
getsetprotected |
◆ CurrentSubObjective
◆ DebugTag
virtual string Barotrauma.AIObjective.DebugTag |
|
get |
◆ Devotion
virtual float Barotrauma.AIObjective.Devotion |
|
get |
◆ ForceHighestPriority
bool Barotrauma.AIObjective.ForceHighestPriority |
|
getset |
◆ ForceRun
virtual bool Barotrauma.AIObjective.ForceRun |
|
get |
◆ ForceWalk
bool Barotrauma.AIObjective.ForceWalk |
|
getset |
◆ HumanAIController
◆ Identifier
Identifier Barotrauma.AIObjective.Identifier |
|
getsetabstract |
◆ IgnoreAtOutpost
bool Barotrauma.AIObjective.IgnoreAtOutpost |
|
getset |
◆ IgnoreUnsafeHulls
virtual bool Barotrauma.AIObjective.IgnoreUnsafeHulls |
|
get |
◆ IsAllowed
bool Barotrauma.AIObjective.IsAllowed |
|
get |
◆ IsCompleted
bool Barotrauma.AIObjective.IsCompleted |
|
getprotected set |
◆ KeepDivingGearOn
virtual bool Barotrauma.AIObjective.KeepDivingGearOn |
|
get |
◆ KeepDivingGearOnAlsoWhenInactive
virtual bool Barotrauma.AIObjective.KeepDivingGearOnAlsoWhenInactive |
|
get |
◆ MaxDevotion
virtual float Barotrauma.AIObjective.MaxDevotion |
|
getprotected |
◆ PathSteering
◆ PrioritizeIfSubObjectivesActive
virtual bool Barotrauma.AIObjective.PrioritizeIfSubObjectivesActive |
|
get |
◆ Priority
float Barotrauma.AIObjective.Priority |
|
getset |
Final priority value after all calculations.
◆ PriorityModifier
float Barotrauma.AIObjective.PriorityModifier = 1 |
|
get |
◆ SteeringManager
◆ SubObjectives
IEnumerable<AIObjective> Barotrauma.AIObjective.SubObjectives |
|
get |
◆ Abandoned
Action Barotrauma.AIObjective.Abandoned |
A single shot event. Automatically cleared after launching. Use OnAbandoned method for implementing (internal) persistent behavior.
◆ Completed
Action Barotrauma.AIObjective.Completed |
A single shot event. Automatically cleared after launching. Use OnCompleted method for implementing (internal) persistent behavior.
◆ Deselected
Action Barotrauma.AIObjective.Deselected |
A single shot event. Automatically cleared after launching. Use OnDeselected method for implementing (internal) persistent behavior.
◆ Selected
Action Barotrauma.AIObjective.Selected |
A single shot event. Automatically cleared after launching. Use OnSelected method for implementing (internal) persistent behavior.
The documentation for this class was generated from the following file:
- /home/runner/work/Luatrauma.Docs/Luatrauma.Docs/libs/LuaCsForBarotrauma/Barotrauma/BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjective.cs