4 protected CharacterControllerComponent m_ControlComp;
5 protected BaseWeaponManagerComponent m_WeaponMgrComp;
6 protected SCR_InventoryStorageManagerComponent m_InventoryMgr;
7 protected CompartmentAccessComponent m_CompartmentAccessComp;
10 override void OnInit(AIAgent owner)
12 IEntity controlledEnt = owner.GetControlledEntity();
14 m_WeaponMgrComp = BaseWeaponManagerComponent.Cast(controlledEnt.FindComponent(BaseWeaponManagerComponent));
15 m_ControlComp = CharacterControllerComponent.Cast(controlledEnt.FindComponent(CharacterControllerComponent));
16 m_InventoryMgr = SCR_InventoryStorageManagerComponent.Cast(controlledEnt.FindComponent(SCR_InventoryStorageManagerComponent));
17 m_CompartmentAccessComp = CompartmentAccessComponent.Cast(controlledEnt.FindComponent(CompartmentAccessComponent));
19 if (!m_WeaponMgrComp || !m_ControlComp || !m_InventoryMgr)
21 NodeError(
this, owner,
"SCR_AIWeaponHandlingBase didn't find necessary components!");
28 protected SCR_AIInfoBaseComponent m_InfoComp;
29 protected void AddDebugMessage(
string str, LogLevel logLevel = LogLevel.NORMAL)
33 IEntity owner = m_ControlComp.GetOwner();
34 AIControlComponent controlComp = AIControlComponent.Cast(owner.FindComponent(AIControlComponent));
35 AIAgent agent = controlComp.GetAIAgent();
36 SCR_AIInfoBaseComponent infoComp = SCR_AIInfoBaseComponent.Cast(agent.FindComponent(SCR_AIInfoBaseComponent));
37 m_InfoComp = infoComp;
40 m_InfoComp.AddDebugMessage(str, msgType:
EAIDebugMsgType.WEAPON, logLevel);