2class BotTestItemMoveBackAndForth
extends BotStateBase
5 ref BotTestItemMoveBackAndForth_MoveFromSlotToSlot m_Move;
7 void BotTestItemMoveBackAndForth (Bot bot = NULL, BotStateBase parent = NULL)
10 m_FSM =
new BotFSM(
this);
12 m_Move =
new BotTestItemMoveBackAndForth_MoveFromSlotToSlot(m_Bot,
this);
15 BotEventBase __EntAtt__ =
new BotEventEntityAttached;
18 m_FSM.AddTransition(
new BotTransition( m_Move, __EntAtt__, m_Move));
20 m_FSM.SetInitialState(m_Move);
23 override void OnEntry (BotEventBase e)
27 GameInventory ownerInventory =
m_Owner.GetInventory();
37 InventoryLocation loc =
new InventoryLocation;
40 m_Move.m_WaitingForSlot = loc.
GetSlot();
49 override void OnExit (BotEventBase e)
62class BotTestItemMoveBackAndForth_MoveFromSlotToSlot
extends BotStateBase
65 int m_WaitingForSlot = InventorySlots.INVALID;
66 int m_hgSlot = InventorySlots.GetSlotIdFromString(
"Headgear");
67 int m_mskSlot = InventorySlots.GetSlotIdFromString(
"Mask");
69 override void OnEntry (BotEventBase e)
74 override void OnAbort (BotEventBase e) { super.OnAbort(e); }
76 override void OnExit (BotEventBase e)
81 int GetNextSlot (
int curr)
85 if (curr == m_mskSlot)
88 return InventorySlots.INVALID;
97 InventoryLocation loc =
new InventoryLocation;
102 if (loc.
GetSlot() == m_WaitingForSlot)
104 int nextSlot = GetNextSlot(m_WaitingForSlot);
105 botDebugPrint(
"[bot] + " +
m_Owner +
" will switch slot=" + nextSlot +
" for item=" +
m_Entity);
107 m_WaitingForSlot = nextSlot;
HandStateEquipped OnEntry
InventoryLocationType
types of Inventory Location
enum ProcessDirectDamageFlags m_Owner
class WeaponChambering_Chamber_OnEntry extends WeaponChambering_Base OnExit
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)
override void OnEntry(HandEventBase e)
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetType()
returns type of InventoryLocation
override void OnExit(WeaponEventBase e)
void Error(string err)
Messagebox with error message.