Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
BotStateBase Class Reference

represent weapon state base More...

Inheritance diagram for BotStateBase:
BotStateIdle BotTestSpamUserActions BotTestSwapG2H BotTestSwapInternal BotTestSwapInternalC2H BotTestSwapWithCorpse

Protected Member Functions

void BotTimedWait (Bot bot=NULL, BotStateBase parent=NULL, float timeout=3.0)
override void OnEntry (BotEventBase e)
override void OnExit (BotEventBase e)
void OnTimeout ()
override void OnUpdate (float dt)

Protected Attributes

bool m_Periodic = true
float m_Timeout = 3.0

Private Member Functions

void BotStateBase (Bot bot=NULL, BotStateBase parent=NULL)
 nested state machine (or null)
void AddTransition (FSMTransition< BotStateBase, BotEventBase, BotActionBase, BotGuardBase > t)
void Bot_TestSpawnOpen (Bot bot=NULL, BotStateBase parent=NULL, string new_type="")
void BotHunt (Bot bot=NULL, BotStateBase parent=NULL)
void BotSpawnEntityInHands (Bot bot=NULL, BotStateBase parent=NULL, string new_type="")
void BotStanceRandomizer (Bot bot=NULL, BotStateBase parent=NULL)
void BotTestAttachAndDropCycle (Bot bot=NULL, BotStateBase parent=NULL)
void BotTestItemMoveBackAndForth (Bot bot=NULL, BotStateBase parent=NULL)
BotFSM GetFSM ()
int GetNextSlot (int curr)
BotStateBase GetParentState ()
PlayerBase GetPlayerOwner ()
bool HasFSM ()
bool IsIdle ()
 idle state does not expect any animation events
bool IsWaitingForActionFinish ()
 waiting for active animation action/actionType finish
override void OnAbort (BotEventBase e)
override void OnAbort (BotEventBase e)
override void OnAbort (BotEventBase e)
override void OnAbort (BotEventBase e)
override void OnAbort (BotEventBase e)
override void OnAbort (BotEventBase e)
override void OnAbort (BotEventBase e)
void OnAbort (BotEventBase e)
override void OnEntry (BotEventBase e)
override void OnEntry (BotEventBase e)
override void OnEntry (BotEventBase e)
override void OnEntry (BotEventBase e)
override void OnEntry (BotEventBase e)
override void OnEntry (BotEventBase e)
override void OnEntry (BotEventBase e)
override void OnEntry (BotEventBase e)
override void OnEntry (BotEventBase e)
override void OnEntry (BotEventBase e)
override void OnEntry (BotEventBase e)
override void OnEntry (BotEventBase e)
override void OnEntry (BotEventBase e)
void OnEntry (BotEventBase e)
override void OnExit (BotEventBase e)
override void OnExit (BotEventBase e)
override void OnExit (BotEventBase e)
override void OnExit (BotEventBase e)
override void OnExit (BotEventBase e)
override void OnExit (BotEventBase e)
override void OnExit (BotEventBase e)
override void OnExit (BotEventBase e)
override void OnExit (BotEventBase e)
override void OnExit (BotEventBase e)
override void OnExit (BotEventBase e)
override void OnExit (BotEventBase e)
override void OnExit (BotEventBase e)
void OnExit (BotEventBase e)
void OnStateChanged (BotStateBase src, BotStateBase dst)
void OnSubMachineChanged (BotStateBase src, BotStateBase dst)
override void OnUpdate (float dt)
override void OnUpdate (float dt)
override void OnUpdate (float dt)
override void OnUpdate (float dt)
override void OnUpdate (float dt)
override void OnUpdate (float dt)
override void OnUpdate (float dt)
override void OnUpdate (float dt)
override void OnUpdate (float dt)
override void OnUpdate (float dt)
override void OnUpdate (float dt)
override void OnUpdate (float dt)
override void OnUpdate (float dt)
void OnUpdate (float dt)
bool ProcessEvent (BotEventBase e)
void SelectTarget ()
void SetParentState (BotStateBase parent)

Private Attributes

ref BotTestAttachAndDropCycle_Attaching m_Attaching
Bot m_Bot
 man that this state belongs to
ref BotTestAttachAndDropCycle_Detaching m_Detaching
float m_dtAccumulator = 0.0
EntityAI m_Entity
ref BotFSM m_FSM
 hierarchical parent state of this state (or null)
int m_hgSlot = InventorySlots.GetSlotIdFromString("Headgear")
ref BotHunt_Hunting m_Hunting
ref BotTestItemMoveBackAndForth_MoveFromSlotToSlot m_Move
int m_mskSlot = InventorySlots.GetSlotIdFromString("Mask")
ref BotOpenEntityInHands m_Opening
PlayerBase m_Owner
BotStateBase m_ParentState
 bot that this state belongs to
ref BotSpawnEntityInHands m_Spawning
ref HumanMovementState m_State = new HumanMovementState()
EntityAI m_Target
Man m_Target
bool m_TargetInSight = false
bool m_TargetLost = false
bool m_Tracking = true
ref BotHunt_Tracking m_Tracking
string m_Type
int m_WaitingForSlot = InventorySlots.INVALID

Detailed Description

represent weapon state base

Class comes with entry/update/exit hooks that can be overriden in custom states

Class is ready for hierarchic composition, i.e. this state having a sub-machine running under hood. If no m_FSM member is configured, class acts as ordinary plain finite machine state.

Definition at line 15 of file bot_hunt.c.

Constructor & Destructor Documentation

◆ BotStateBase()

Member Function Documentation

◆ AddTransition()

void AddTransition ( FSMTransition< BotStateBase, BotEventBase, BotActionBase, BotGuardBase > t)
inlineprivate

Definition at line 43 of file botstates.c.

References Error(), HasFSM(), and m_FSM.

◆ Bot_TestSpawnOpen()

void Bot_TestSpawnOpen ( Bot bot = NULL,
BotStateBase parent = NULL,
string new_type = "" )
inlineprivate

◆ BotHunt()

void BotHunt ( Bot bot = NULL,
BotStateBase parent = NULL )
inlineprivate

Definition at line 23 of file bot_hunt.c.

References BotStateBase(), m_Bot, m_FSM, m_Hunting, and m_Tracking.

◆ BotSpawnEntityInHands()

void BotSpawnEntityInHands ( Bot bot = NULL,
BotStateBase parent = NULL,
string new_type = "" )
inlineprivate

Definition at line 7 of file bot_testspawnandopencan.c.

References BotStateBase(), Empty, and m_Type.

Referenced by Bot_TestSpawnOpen().

◆ BotStanceRandomizer()

void BotStanceRandomizer ( Bot bot = NULL,
BotStateBase parent = NULL )
inlineprivate

Definition at line 7 of file bot_stancerandomizer.c.

References BotStateBase().

◆ BotTestAttachAndDropCycle()

void BotTestAttachAndDropCycle ( Bot bot = NULL,
BotStateBase parent = NULL )
inlineprivate

Definition at line 11 of file bot_testattachanddropcycle.c.

References BotStateBase(), m_Attaching, m_Bot, m_Detaching, and m_FSM.

◆ BotTestItemMoveBackAndForth()

void BotTestItemMoveBackAndForth ( Bot bot = NULL,
BotStateBase parent = NULL )
inlineprivate

Definition at line 6 of file bot_testitemmovebackandforth.c.

References BotStateBase(), m_Bot, m_FSM, and m_Move.

◆ BotTimedWait()

void BotTimedWait ( Bot bot = NULL,
BotStateBase parent = NULL,
float timeout = 3.0 )
inlineprotected

Definition at line 10 of file bot_timedwait.c.

References BotStateBase(), and m_Timeout.

◆ GetFSM()

BotFSM GetFSM ( )
inlineprivate

Definition at line 31 of file botstates.c.

References m_FSM.

◆ GetNextSlot()

int GetNextSlot ( int curr)
inlineprivate

Definition at line 80 of file bot_testitemmovebackandforth.c.

References Error(), InventorySlots::INVALID, m_hgSlot, and m_mskSlot.

Referenced by OnUpdate().

◆ GetParentState()

BotStateBase GetParentState ( )
inlineprivate
Returns
state that owns this sub-state (or null if plain state)

Definition at line 28 of file botstates.c.

References BotStateBase(), and m_ParentState.

◆ GetPlayerOwner()

PlayerBase GetPlayerOwner ( )
inlineprivate

Definition at line 19 of file botstates.c.

References m_Owner.

Referenced by OnUpdate(), and SelectTarget().

◆ HasFSM()

bool HasFSM ( )
inlineprivate

Definition at line 30 of file botstates.c.

References m_FSM.

Referenced by AddTransition(), IsWaitingForActionFinish(), OnAbort(), OnEntry(), OnUpdate(), and ProcessEvent().

◆ IsIdle()

bool IsIdle ( )
inlineprivate

idle state does not expect any animation events

Returns
true if this state is idle

Definition at line 112 of file botstates.c.

◆ IsWaitingForActionFinish()

bool IsWaitingForActionFinish ( )
inlineprivate

waiting for active animation action/actionType finish

Returns
true if this state or active substate is waiting for finish signal

Definition at line 106 of file botstates.c.

References HasFSM(), and m_FSM.

◆ OnAbort() [1/8]

override void OnAbort ( BotEventBase e)
inlineprivate

Definition at line 183 of file bot_hunt.c.

◆ OnAbort() [2/8]

override void OnAbort ( BotEventBase e)
inlineprivate

Definition at line 105 of file bot_hunt.c.

References m_TargetInSight, m_TargetLost, and m_Tracking.

◆ OnAbort() [3/8]

override void OnAbort ( BotEventBase e)
inlineprivate

Definition at line 97 of file bot_testattachanddropcycle.c.

◆ OnAbort() [4/8]

override void OnAbort ( BotEventBase e)
inlineprivate

Definition at line 61 of file bot_testattachanddropcycle.c.

◆ OnAbort() [5/8]

override void OnAbort ( BotEventBase e)
inlineprivate

Definition at line 73 of file bot_testitemmovebackandforth.c.

◆ OnAbort() [6/8]

override void OnAbort ( BotEventBase e)
inlineprivate

Definition at line 131 of file bot_testspawnandopencan.c.

◆ OnAbort() [7/8]

override void OnAbort ( BotEventBase e)
inlineprivate

Definition at line 66 of file bot_testspawnandopencan.c.

◆ OnAbort() [8/8]

void OnAbort ( BotEventBase e)
inlineprivate

Definition at line 83 of file botstates.c.

References botDebugPrint(), HasFSM(), m_FSM, ToString(), and Type.

◆ OnEntry() [1/15]

override void OnEntry ( BotEventBase e)
inlineprivate

Definition at line 178 of file bot_hunt.c.

◆ OnEntry() [2/15]

override void OnEntry ( BotEventBase e)
inlineprivate

Definition at line 96 of file bot_hunt.c.

References m_TargetInSight, m_TargetLost, and m_Tracking.

◆ OnEntry() [3/15]

override void OnEntry ( BotEventBase e)
inlineprivate

Definition at line 50 of file bot_hunt.c.

References m_dtAccumulator, and SelectTarget().

◆ OnEntry() [4/15]

override void OnEntry ( BotEventBase e)
inlineprivate

Definition at line 11 of file bot_stancerandomizer.c.

References m_dtAccumulator.

◆ OnEntry() [5/15]

override void OnEntry ( BotEventBase e)
inlineprivate

Definition at line 92 of file bot_testattachanddropcycle.c.

◆ OnEntry() [6/15]

override void OnEntry ( BotEventBase e)
inlineprivate

Definition at line 56 of file bot_testattachanddropcycle.c.

◆ OnEntry() [7/15]

override void OnEntry ( BotEventBase e)
inlineprivate

Definition at line 30 of file bot_testattachanddropcycle.c.

References m_Attaching, m_Detaching, m_Entity, and m_Owner.

◆ OnEntry() [8/15]

override void OnEntry ( BotEventBase e)
inlineprivate

Definition at line 68 of file bot_testitemmovebackandforth.c.

◆ OnEntry() [9/15]

◆ OnEntry() [10/15]

override void OnEntry ( BotEventBase e)
inlineprivate

Definition at line 130 of file bot_testspawnandopencan.c.

◆ OnEntry() [11/15]

override void OnEntry ( BotEventBase e)
inlineprivate

Definition at line 120 of file bot_testspawnandopencan.c.

◆ OnEntry() [12/15]

override void OnEntry ( BotEventBase e)
inlineprivate

Definition at line 46 of file bot_testspawnandopencan.c.

References botDebugPrint(), BotEventBase::m_Entity, m_Entity, and m_Owner.

◆ OnEntry() [13/15]

override void OnEntry ( BotEventBase e)
inlineprivate

Definition at line 15 of file bot_testspawnandopencan.c.

References m_Owner, and m_Type.

◆ OnEntry() [14/15]

override void OnEntry ( BotEventBase e)
inlineprotected

Definition at line 15 of file bot_timedwait.c.

References m_dtAccumulator.

◆ OnEntry() [15/15]

void OnEntry ( BotEventBase e)
inlineprivate

Definition at line 57 of file botstates.c.

References botDebugPrint(), HasFSM(), m_FSM, ToString(), and Type.

◆ OnExit() [1/15]

override void OnExit ( BotEventBase e)
inlineprivate

Definition at line 185 of file bot_hunt.c.

◆ OnExit() [2/15]

override void OnExit ( BotEventBase e)
inlineprivate

Definition at line 114 of file bot_hunt.c.

References m_TargetInSight, m_TargetLost, and m_Tracking.

◆ OnExit() [3/15]

override void OnExit ( BotEventBase e)
inlineprivate

Definition at line 58 of file bot_hunt.c.

References m_dtAccumulator, and m_Target.

◆ OnExit() [4/15]

override void OnExit ( BotEventBase e)
inlineprivate

Definition at line 18 of file bot_stancerandomizer.c.

References m_dtAccumulator.

◆ OnExit() [5/15]

override void OnExit ( BotEventBase e)
inlineprivate

Definition at line 99 of file bot_testattachanddropcycle.c.

◆ OnExit() [6/15]

override void OnExit ( BotEventBase e)
inlineprivate

Definition at line 63 of file bot_testattachanddropcycle.c.

◆ OnExit() [7/15]

override void OnExit ( BotEventBase e)
inlineprivate

Definition at line 39 of file bot_testattachanddropcycle.c.

References m_Entity.

◆ OnExit() [8/15]

override void OnExit ( BotEventBase e)
inlineprivate

Definition at line 75 of file bot_testitemmovebackandforth.c.

◆ OnExit() [9/15]

override void OnExit ( BotEventBase e)
inlineprivate

Definition at line 48 of file bot_testitemmovebackandforth.c.

References m_Entity.

◆ OnExit() [10/15]

override void OnExit ( BotEventBase e)
inlineprivate

Definition at line 132 of file bot_testspawnandopencan.c.

◆ OnExit() [11/15]

override void OnExit ( BotEventBase e)
inlineprivate

Definition at line 121 of file bot_testspawnandopencan.c.

◆ OnExit() [12/15]

override void OnExit ( BotEventBase e)
inlineprivate

Definition at line 68 of file bot_testspawnandopencan.c.

◆ OnExit() [13/15]

override void OnExit ( BotEventBase e)
inlineprivate

Definition at line 25 of file bot_testspawnandopencan.c.

◆ OnExit() [14/15]

override void OnExit ( BotEventBase e)
inlineprotected

Definition at line 22 of file bot_timedwait.c.

References m_dtAccumulator.

◆ OnExit() [15/15]

void OnExit ( BotEventBase e)
inlineprivate

Definition at line 97 of file botstates.c.

References botDebugPrint(), ToString(), and Type.

◆ OnStateChanged()

void OnStateChanged ( BotStateBase src,
BotStateBase dst )
inlineprivate

Definition at line 126 of file botstates.c.

References BotStateBase().

◆ OnSubMachineChanged()

void OnSubMachineChanged ( BotStateBase src,
BotStateBase dst )
inlineprivate

Definition at line 119 of file botstates.c.

References BotStateBase().

◆ OnTimeout()

void OnTimeout ( )
inlineprotected

Definition at line 47 of file bot_timedwait.c.

References botDebugSpam(), m_Bot, and m_Owner.

◆ OnUpdate() [1/15]

override void OnUpdate ( float dt)
inlineprivate

Definition at line 190 of file bot_hunt.c.

◆ OnUpdate() [2/15]

override void OnUpdate ( float dt)
inlineprivate

◆ OnUpdate() [3/15]

override void OnUpdate ( float dt)
inlineprivate

Definition at line 66 of file bot_hunt.c.

References m_dtAccumulator, m_Target, Print(), and SelectTarget().

◆ OnUpdate() [4/15]

override void OnUpdate ( float dt)
inlineprivate

◆ OnUpdate() [5/15]

override void OnUpdate ( float dt)
inlineprivate

◆ OnUpdate() [6/15]

override void OnUpdate ( float dt)
inlineprivate

◆ OnUpdate() [7/15]

override void OnUpdate ( float dt)
inlineprivate

Definition at line 46 of file bot_testattachanddropcycle.c.

◆ OnUpdate() [8/15]

override void OnUpdate ( float dt)
inlineprivate

◆ OnUpdate() [9/15]

override void OnUpdate ( float dt)
inlineprivate

Definition at line 55 of file bot_testitemmovebackandforth.c.

◆ OnUpdate() [10/15]

override void OnUpdate ( float dt)
inlineprivate

Definition at line 134 of file bot_testspawnandopencan.c.

References botDebugPrint(), botDebugSpam(), m_Bot, and m_Owner.

◆ OnUpdate() [11/15]

override void OnUpdate ( float dt)
inlineprivate

Definition at line 122 of file bot_testspawnandopencan.c.

◆ OnUpdate() [12/15]

override void OnUpdate ( float dt)
inlineprivate

◆ OnUpdate() [13/15]

override void OnUpdate ( float dt)
inlineprivate

Definition at line 27 of file bot_testspawnandopencan.c.

References botDebugPrint(), m_Bot, and m_Owner.

◆ OnUpdate() [14/15]

override void OnUpdate ( float dt)
inlineprotected

Definition at line 29 of file bot_timedwait.c.

References m_dtAccumulator, m_Periodic, m_Timeout, and OnTimeout().

◆ OnUpdate() [15/15]

void OnUpdate ( float dt)
inlineprivate

Definition at line 73 of file botstates.c.

References HasFSM(), and m_FSM.

◆ ProcessEvent()

bool ProcessEvent ( BotEventBase e)
inlineprivate

Definition at line 33 of file botstates.c.

References HasFSM(), and m_FSM.

◆ SelectTarget()

void SelectTarget ( )
inlineprivate

Definition at line 42 of file bot_hunt.c.

References botDebugPrint(), BotSelectNearestTarget(), GetPlayerOwner(), m_Hunting, m_Owner, m_Target, and m_Tracking.

Referenced by OnEntry(), and OnUpdate().

◆ SetParentState()

void SetParentState ( BotStateBase parent)
inlineprivate

Definition at line 24 of file botstates.c.

References BotStateBase(), and m_ParentState.

Field Documentation

◆ m_Attaching

ref BotTestAttachAndDropCycle_Attaching m_Attaching
private

Definition at line 9 of file bot_testattachanddropcycle.c.

Referenced by BotTestAttachAndDropCycle(), and OnEntry().

◆ m_Bot

◆ m_Detaching

ref BotTestAttachAndDropCycle_Detaching m_Detaching
private

Definition at line 8 of file bot_testattachanddropcycle.c.

Referenced by BotTestAttachAndDropCycle(), and OnEntry().

◆ m_dtAccumulator

float m_dtAccumulator = 0.0
private

Definition at line 18 of file bot_hunt.c.

Referenced by OnEntry(), OnExit(), and OnUpdate().

◆ m_Entity

EntityAI m_Entity
private

Definition at line 7 of file bot_testattachanddropcycle.c.

Referenced by OnEntry(), OnExit(), and OnUpdate().

◆ m_FSM

◆ m_hgSlot

int m_hgSlot = InventorySlots.GetSlotIdFromString("Headgear")
private

Definition at line 65 of file bot_testitemmovebackandforth.c.

Referenced by GetNextSlot().

◆ m_Hunting

ref BotHunt_Hunting m_Hunting
private

Definition at line 21 of file bot_hunt.c.

Referenced by BotHunt(), and SelectTarget().

◆ m_Move

ref BotTestItemMoveBackAndForth_MoveFromSlotToSlot m_Move
private

Definition at line 4 of file bot_testitemmovebackandforth.c.

Referenced by BotTestItemMoveBackAndForth(), and OnEntry().

◆ m_mskSlot

int m_mskSlot = InventorySlots.GetSlotIdFromString("Mask")
private

Definition at line 66 of file bot_testitemmovebackandforth.c.

Referenced by GetNextSlot().

◆ m_Opening

ref BotOpenEntityInHands m_Opening
private

Definition at line 97 of file bot_testspawnandopencan.c.

Referenced by Bot_TestSpawnOpen().

◆ m_Owner

◆ m_ParentState

BotStateBase m_ParentState
private

bot that this state belongs to

Definition at line 14 of file botstates.c.

Referenced by BotStateBase(), BotStateIdle::BotStateIdle(), GetParentState(), and SetParentState().

◆ m_Periodic

bool m_Periodic = true
protected

Definition at line 8 of file bot_timedwait.c.

Referenced by OnUpdate().

◆ m_Spawning

ref BotSpawnEntityInHands m_Spawning
private

Definition at line 96 of file bot_testspawnandopencan.c.

Referenced by Bot_TestSpawnOpen().

◆ m_State

ref HumanMovementState m_State = new HumanMovementState()
private

Definition at line 3 of file bot_stancerandomizer.c.

Referenced by OnUpdate().

◆ m_Target [1/2]

EntityAI m_Target
private

Definition at line 91 of file bot_hunt.c.

◆ m_Target [2/2]

EntityAI m_Target
private

Definition at line 17 of file bot_hunt.c.

Referenced by OnExit(), OnUpdate(), and SelectTarget().

◆ m_TargetInSight

bool m_TargetInSight = false
private

Definition at line 92 of file bot_hunt.c.

Referenced by OnAbort(), OnEntry(), OnExit(), and OnUpdate().

◆ m_TargetLost

bool m_TargetLost = false
private

Definition at line 93 of file bot_hunt.c.

Referenced by OnAbort(), OnEntry(), OnExit(), and OnUpdate().

◆ m_Timeout

float m_Timeout = 3.0
protected

Definition at line 7 of file bot_timedwait.c.

Referenced by BotTimedWait(), and OnUpdate().

◆ m_Tracking [1/2]

bool m_Tracking = true
private

Definition at line 94 of file bot_hunt.c.

◆ m_Tracking [2/2]

ref BotHunt_Tracking m_Tracking
private

Definition at line 20 of file bot_hunt.c.

Referenced by BotHunt(), OnAbort(), OnEntry(), OnExit(), OnUpdate(), and SelectTarget().

◆ m_Type

string m_Type
private

Definition at line 5 of file bot_testspawnandopencan.c.

Referenced by Bot_TestSpawnOpen(), BotSpawnEntityInHands(), and OnEntry().

◆ m_WaitingForSlot

int m_WaitingForSlot = InventorySlots.INVALID
private

Definition at line 64 of file bot_testitemmovebackandforth.c.

Referenced by OnUpdate().


The documentation for this class was generated from the following files: