M&B: Bannerlord 1.2.7
The horns sound, the ravens gather.
Loading...
Searching...
No Matches
SandBox.AgentNavigator Class Reference

Public Types

enum  NavigationState {
  NoTarget ,
  GoToTarget ,
  AtTargetPosition ,
  UseMachine
}
 

Public Member Functions

 AgentNavigator (Agent agent, LocationCharacter locationCharacter)
 
 AgentNavigator (Agent agent)
 
void OnStopUsingGameObject ()
 
void OnAgentRemoved (Agent agent)
 
void SetTarget (UsableMachine usableMachine, bool isInitialTarget=false)
 
void SetTargetFrame (WorldPosition position, float rotation, float rangeThreshold=1.0f, float rotationThreshold=-10.0f, Agent.AIScriptedFrameFlags flags=Agent.AIScriptedFrameFlags.None, bool disableClearTargetWhenTargetIsReached=false)
 
void ClearTarget ()
 
void Tick (float dt, bool isSimulation=false)
 
float GetDistanceToTarget (UsableMachine target)
 
bool IsTargetReached ()
 
void HoldAndHideRecentlyUsedMeshes ()
 
void RecoverRecentlyUsedMeshes ()
 
bool CanSeeAgent (Agent otherAgent)
 
bool IsCarryingSomething ()
 
void SetPrefabVisibility (sbyte realBoneIndex, string prefabName, bool isVisible)
 
bool GetPrefabVisibility (sbyte realBoneIndex, string prefabName)
 
void SetSpecialItem ()
 
void SetItemsVisibility (bool isVisible)
 
void SetCommonArea (Alley alley)
 
void ForceThink (float inSeconds)
 
AddBehaviorGroup< T > ()
 
GetBehaviorGroup< T > ()
 
AgentBehavior GetBehavior< T > ()
 
bool HasBehaviorGroup< T > ()
 
void RemoveBehaviorGroup< T > ()
 
void RefreshBehaviorGroups (bool isSimulation)
 
AgentBehavior GetActiveBehavior ()
 
AgentBehaviorGroup GetActiveBehaviorGroup ()
 

Public Attributes

readonly Agent OwnerAgent
 

Properties

UsableMachine TargetUsableMachine [get]
 
WorldPosition TargetPosition [get]
 
Vec2 TargetDirection [get]
 
GameEntity TargetEntity [get]
 
Alley MemberOfAlley [get]
 
string SpecialTargetTag [get, set]
 
NavigationState _agentState [get]
 
bool CharacterHasVisiblePrefabs [get]
 

Member Enumeration Documentation

◆ NavigationState

Enumerator
NoTarget 
GoToTarget 
AtTargetPosition 
UseMachine 

Constructor & Destructor Documentation

◆ AgentNavigator() [1/2]

SandBox.AgentNavigator.AgentNavigator ( Agent  agent,
LocationCharacter  locationCharacter 
)

◆ AgentNavigator() [2/2]

SandBox.AgentNavigator.AgentNavigator ( Agent  agent)

Member Function Documentation

◆ OnStopUsingGameObject()

void SandBox.AgentNavigator.OnStopUsingGameObject ( )

◆ OnAgentRemoved()

void SandBox.AgentNavigator.OnAgentRemoved ( Agent  agent)

◆ SetTarget()

void SandBox.AgentNavigator.SetTarget ( UsableMachine  usableMachine,
bool  isInitialTarget = false 
)

◆ SetTargetFrame()

void SandBox.AgentNavigator.SetTargetFrame ( WorldPosition  position,
float  rotation,
float  rangeThreshold = 1::0f,
float  rotationThreshold = -10::0f,
Agent::AIScriptedFrameFlags  flags = Agent::AIScriptedFrameFlags::None,
bool  disableClearTargetWhenTargetIsReached = false 
)

◆ ClearTarget()

void SandBox.AgentNavigator.ClearTarget ( )

◆ Tick()

void SandBox.AgentNavigator.Tick ( float  dt,
bool  isSimulation = false 
)

◆ GetDistanceToTarget()

float SandBox.AgentNavigator.GetDistanceToTarget ( UsableMachine  target)

◆ IsTargetReached()

bool SandBox.AgentNavigator.IsTargetReached ( )

◆ HoldAndHideRecentlyUsedMeshes()

void SandBox.AgentNavigator.HoldAndHideRecentlyUsedMeshes ( )

◆ RecoverRecentlyUsedMeshes()

void SandBox.AgentNavigator.RecoverRecentlyUsedMeshes ( )

◆ CanSeeAgent()

bool SandBox.AgentNavigator.CanSeeAgent ( Agent  otherAgent)

◆ IsCarryingSomething()

bool SandBox.AgentNavigator.IsCarryingSomething ( )

◆ SetPrefabVisibility()

void SandBox.AgentNavigator.SetPrefabVisibility ( sbyte  realBoneIndex,
string  prefabName,
bool  isVisible 
)

◆ GetPrefabVisibility()

bool SandBox.AgentNavigator.GetPrefabVisibility ( sbyte  realBoneIndex,
string  prefabName 
)

◆ SetSpecialItem()

void SandBox.AgentNavigator.SetSpecialItem ( )

◆ SetItemsVisibility()

void SandBox.AgentNavigator.SetItemsVisibility ( bool  isVisible)

◆ SetCommonArea()

void SandBox.AgentNavigator.SetCommonArea ( Alley  alley)

◆ ForceThink()

void SandBox.AgentNavigator.ForceThink ( float  inSeconds)

◆ AddBehaviorGroup< T >()

T SandBox.AgentNavigator.AddBehaviorGroup< T > ( )
Type Constraints
T :AgentBehaviorGroup 

◆ GetBehaviorGroup< T >()

T SandBox.AgentNavigator.GetBehaviorGroup< T > ( )
Type Constraints
T :AgentBehaviorGroup 

◆ GetBehavior< T >()

AgentBehavior SandBox.AgentNavigator.GetBehavior< T > ( )
Type Constraints
T :AgentBehavior 

◆ HasBehaviorGroup< T >()

bool SandBox.AgentNavigator.HasBehaviorGroup< T > ( )

◆ RemoveBehaviorGroup< T >()

void SandBox.AgentNavigator.RemoveBehaviorGroup< T > ( )
Type Constraints
T :AgentBehaviorGroup 

◆ RefreshBehaviorGroups()

void SandBox.AgentNavigator.RefreshBehaviorGroups ( bool  isSimulation)

◆ GetActiveBehavior()

AgentBehavior SandBox.AgentNavigator.GetActiveBehavior ( )

◆ GetActiveBehaviorGroup()

AgentBehaviorGroup SandBox.AgentNavigator.GetActiveBehaviorGroup ( )

Member Data Documentation

◆ OwnerAgent

readonly Agent SandBox.AgentNavigator.OwnerAgent

Property Documentation

◆ TargetUsableMachine

UsableMachine SandBox.AgentNavigator.TargetUsableMachine
get

◆ TargetPosition

WorldPosition SandBox.AgentNavigator.TargetPosition
get

◆ TargetDirection

Vec2 SandBox.AgentNavigator.TargetDirection
get

◆ TargetEntity

GameEntity SandBox.AgentNavigator.TargetEntity
get

◆ MemberOfAlley

Alley SandBox.AgentNavigator.MemberOfAlley
get

◆ SpecialTargetTag

string SandBox.AgentNavigator.SpecialTargetTag
getset

◆ _agentState

NavigationState SandBox.AgentNavigator._agentState
get

◆ CharacterHasVisiblePrefabs

bool SandBox.AgentNavigator.CharacterHasVisiblePrefabs
get