4 ref BotTestItemMoveBackAndForth_MoveFromSlotToSlot m_Move;
6 void BotTestItemMoveBackAndForth (Bot bot = NULL, BotStateBase parent = NULL)
9 m_FSM =
new BotFSM(
this);
11 m_Move =
new BotTestItemMoveBackAndForth_MoveFromSlotToSlot(m_Bot,
this);
14 BotEventBase __EntAtt__ =
new BotEventEntityAttached;
17 m_FSM.AddTransition(
new BotTransition( m_Move, __EntAtt__, m_Move));
19 m_FSM.SetInitialState(m_Move);
22 override void OnEntry (BotEventBase e)
26 GameInventory ownerInventory =
m_Owner.GetInventory();
36 InventoryLocation loc =
new InventoryLocation;
39 m_Move.m_WaitingForSlot = loc.GetSlot();
48 override void OnExit (BotEventBase e)
61class BotTestItemMoveBackAndForth_MoveFromSlotToSlot
extends BotStateBase
64 int m_WaitingForSlot = InventorySlots.INVALID;
65 int m_hgSlot = InventorySlots.GetSlotIdFromString(
"Headgear");
66 int m_mskSlot = InventorySlots.GetSlotIdFromString(
"Mask");
68 override void OnEntry (BotEventBase e)
73 override void OnAbort (BotEventBase e) { super.OnAbort(e); }
75 override void OnExit (BotEventBase e)
80 int GetNextSlot (
int curr)
84 if (curr == m_mskSlot)
87 return InventorySlots.INVALID;
96 InventoryLocation loc =
new InventoryLocation;
101 if (loc.GetSlot() == m_WaitingForSlot)
103 int nextSlot = GetNextSlot(m_WaitingForSlot);
106 m_WaitingForSlot = nextSlot;
void botDebugPrint(string s)
FSMTransition< BotStateBase, BotEventBase, BotActionBase, BotGuardBase > BotTransition
represent weapon state base
proto native GameInventory GetInventory()
proto native bool GetCurrentInventoryLocation(out notnull InventoryLocation loc)
returns information about current item location
proto native EntityAI FindAttachment(int slot)
Returns attached entity in slot (you can use InventorySlots.GetSlotIdFromString(name) to get slot id)...
void Error(string err)
Messagebox with error message.
HandStateEquipped OnEntry
InventoryLocationType
types of Inventory Location
enum ProcessDirectDamageFlags m_Owner
class WeaponChambering_Chamber_OnEntry extends WeaponChambering_Base OnExit