BVB Source Codes

CRYENGINE Show FlowNodeAIAction.h Source code

Return Download CRYENGINE: download FlowNodeAIAction.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. /********************************************************************
  4.    -------------------------------------------------------------------------
  5.    File name:   FlowNodeAIAction.h
  6.    $Id$
  7.    Description: place for miscellaneous AI related flow graph nodes
  8.  
  9.    -------------------------------------------------------------------------
  10.    History:
  11.    - 15:6:2005   15:24 : Created by Kirill Bulatsev
  12.  
  13.  *********************************************************************/
  14.  
  15. #pragma once
  16.  
  17. #include "IAnimationGraph.h"
  18. #include "Vehicle/FlowVehicleBase.h"
  19.  
  20. #include <CryFlowGraph/IFlowBaseNode.h>
  21.  
  22. //////////////////////////////////////////////////////////////////////////
  23. // base AI Flow node
  24. //////////////////////////////////////////////////////////////////////////
  25. template<bool TBlocking>
  26. class CFlowNode_AIBase : public CFlowBaseNode<eNCT_Instanced>, public IEntityEventListener, public IGoalPipeListener
  27. {
  28. public:
  29.         static const bool m_bBlocking = TBlocking;
  30.  
  31.         CFlowNode_AIBase(SActivationInfo* pActInfo);
  32.         virtual ~CFlowNode_AIBase();
  33.  
  34.         // Derived classes must re-implement this method!!!
  35.         virtual void GetConfiguration(SFlowNodeConfig& config) = 0;
  36.  
  37.         // Derived classes may re-implement this method!!!
  38.         // Default implementation creates new instance for each cloned node
  39.         // must be replicated to avoid derived template argument for this class
  40.         virtual IFlowNodePtr Clone(SActivationInfo* pActInfo) = 0;
  41.         virtual void         Serialize(SActivationInfo*, TSerialize ser);
  42.         // Derived classes normally shouldn't override this method!!!
  43.         virtual void         ProcessEvent(EFlowEvent event, SActivationInfo* pActInfo);
  44.         // Derived classes must implement this method!!!
  45.         virtual void         DoProcessEvent(EFlowEvent event, SActivationInfo* pActInfo) = 0;
  46.         // Derived classes may override this method to be notified when the action was restored
  47.         virtual void         OnResume(SActivationInfo* pActInfo = NULL) {}
  48.         // Derived classes may override this method to be notified when the action was canceled
  49.         virtual void         OnCancel()                                 {}
  50.         virtual void         OnFinish()                                 {};
  51.         // Derived classes may override this method to be updated each frame
  52.         virtual bool         OnUpdate(SActivationInfo* pActInfo)        { return false; }
  53.  
  54.         //////////////////////////////////////////////////////////////////////////
  55.         // IGoalPipeListener
  56.         virtual void OnGoalPipeEvent(IPipeUser* pPipeUser, EGoalPipeEvent event, int goalPipeId, bool& unregisterListenerAfterEvent);
  57.  
  58.         //////////////////////////////////////////////////////////////////////////
  59.         // IEntityEventListener
  60.         virtual void OnEntityEvent(IEntity* pEntity, SEntityEvent& event);
  61.  
  62.         void         RegisterEvents();
  63.         virtual void UnregisterEvents();
  64.  
  65.         IEntity*     GetEntity(SActivationInfo* pActInfo);
  66.  
  67.         bool         Execute(SActivationInfo* pActInfo, const char* pSignalText, IAISignalExtraData* pData = NULL, int senderId = 0);
  68.  
  69. protected:
  70.         virtual void OnCancelPortActivated(IPipeUser* pPipeUser, SActivationInfo* pActInfo);
  71.  
  72.         virtual void Cancel();
  73.         virtual void Finish();
  74.  
  75.         void         RegisterEntityEvents();
  76.         void         RegisterAIEvents();
  77.  
  78.         //TODO: should not store this - must be read from inPort
  79.         IFlowGraph* m_pGraph;
  80.         TFlowNodeId m_nodeID;
  81.  
  82.         int         m_GoalPipeId;
  83.         int         m_UnregisterGoalPipeId;
  84.         EntityId    m_EntityId;
  85.         EntityId    m_UnregisterEntityId;
  86.         bool        m_bExecuted;
  87.         bool        m_bSynchronized;
  88.         bool        m_bNeedsExec;
  89.         bool        m_bNeedsSink;
  90.         bool        m_bNeedsReset;
  91.  
  92.         // you might want to override this method
  93.         virtual bool ExecuteOnAI(SActivationInfo* pActInfo, const char* pSignalText,
  94.                                  IAISignalExtraData* pData, IEntity* pEntity, IEntity* pSender);
  95.  
  96.         // you might want to override this method
  97.         virtual bool ExecuteOnEntity(SActivationInfo* pActInfo, const char* pSignalText,
  98.                                      IAISignalExtraData* pData, IEntity* pEntity, IEntity* pSender);
  99.  
  100.         // Utility function to set an AI's speed.
  101.         void SetSpeed(IAIObject* pAI, int iSpeed);
  102.  
  103.         // Utility function to set an AI's stance.
  104.         void SetStance(IAIObject* pAI, int stance);
  105.  
  106.         // Utility function to set an AI's a.
  107.         void SetAllowStrafing(IAIObject* pAI, bool bAllowStrafing);
  108.  
  109.         // should call DoProcessEvent if owner is not too much alerted
  110.         virtual void TryExecute(IAIObject* pAI, IFlowNode::EFlowEvent event, IFlowNode::SActivationInfo* pActInfo);
  111.  
  112.         // this will be called when the node is activated, one update before calling ExecuteIfNotTooMuchAlerted
  113.         // use this if there's some data that needs to be initialized before execution
  114.         virtual void PreExecute(SActivationInfo* pActInfo) {}
  115. };
  116.  
  117. //---------------------------------------------------------------------------------------------------------------------------------
  118. //////////////////////////////////////////////////////////////////////////
  119. // base AI forceable
  120. //////////////////////////////////////////////////////////////////////////
  121. template<bool TBlocking>
  122. class CFlowNode_AIForceableBase
  123.         : public CFlowNode_AIBase<TBlocking>
  124. {
  125.         typedef CFlowNode_AIBase<TBlocking> TBase;
  126. public:
  127.         CFlowNode_AIForceableBase(IFlowNode::SActivationInfo* pActInfo)
  128.                 : CFlowNode_AIBase<TBlocking>(pActInfo)
  129.                 , m_LastForceMethod(eNoForce) {}
  130.  
  131.         virtual void ProcessEvent(IFlowNode::EFlowEvent event, IFlowNode::SActivationInfo* pActInfo);
  132.         virtual void Serialize(IFlowNode::SActivationInfo*, TSerialize ser);
  133.  
  134. protected:
  135.         enum EForceMethod
  136.         {
  137.                 eNoForce = 0,
  138.                 eKeepPerception,
  139.                 eIgnoreAll,
  140.         };
  141.  
  142.         virtual void         OnCancel();
  143.         virtual void         OnFinish();
  144.         virtual void         TryExecute(IAIObject* pAI, IFlowNode::EFlowEvent event, IFlowNode::SActivationInfo* pActInfo);
  145.         virtual EForceMethod GetForceMethod(IFlowNode::SActivationInfo* pActInfo) const
  146.         {
  147.                 assert(!"Must implement for derived classes!");
  148.                 return eNoForce;
  149.         }
  150.         virtual void SetForceMethod(IAIObject* pAI, EForceMethod method);
  151.  
  152.         EForceMethod m_LastForceMethod;
  153. };
  154.  
  155. //---------------------------------------------------------------------------------------------------------------------------------
  156. //////////////////////////////////////////////////////////////////////////
  157. // base AI Signal order
  158. //////////////////////////////////////////////////////////////////////////
  159. template<class TDerivedFromSignalBase>
  160. class CFlowNode_AISignalBase
  161.         : public CFlowNode_AIBase<false>
  162. {
  163.         typedef CFlowNode_AIBase<false> TBase;
  164. public:
  165.         CFlowNode_AISignalBase(IFlowNode::SActivationInfo* pActInfo)
  166.                 : CFlowNode_AIBase<false>(pActInfo)
  167.                 , m_SignalText(nullptr)
  168.         {
  169.         }
  170.  
  171.         virtual void         GetConfiguration(SFlowNodeConfig& config);
  172.         virtual void         DoProcessEvent(IFlowNode::EFlowEvent event, IFlowNode::SActivationInfo* pActInfo);
  173.         virtual IFlowNodePtr Clone(SActivationInfo* pActInfo);
  174.  
  175. protected:
  176.         virtual void Cancel();
  177.         virtual void Finish();
  178.  
  179.         virtual void TryExecute(IAIObject* pAI, IFlowNode::EFlowEvent event, IFlowNode::SActivationInfo* pActInfo);
  180.         virtual bool ShouldForce(IFlowNode::SActivationInfo* pActInfo) const;
  181.  
  182.         const char* m_SignalText;
  183.  
  184.         virtual IAISignalExtraData* GetExtraData(IFlowNode::SActivationInfo* pActInfo) const { return NULL; }
  185. };
  186.  
  187. //---------------------------------------------------------------------------------------------------------------------------------
  188. //////////////////////////////////////////////////////////////////////////
  189. // base AI Signal order
  190. //////////////////////////////////////////////////////////////////////////
  191. class CFlowNode_AISignalAlerted
  192.         : public CFlowNode_AISignalBase<CFlowNode_AISignalAlerted>
  193. {
  194. public:
  195.         CFlowNode_AISignalAlerted(IFlowNode::SActivationInfo* pActInfo)
  196.                 : CFlowNode_AISignalBase<CFlowNode_AISignalAlerted>(pActInfo) { m_SignalText = "ACT_ALERTED"; }
  197.  
  198.         virtual void GetMemoryUsage(ICrySizer* s) const
  199.         {
  200.                 s->Add(*this);
  201.         }
  202. };
  203.  
  204. //////////////////////////////////////////////////////////////////////////
  205. // prototyping AI orders
  206. //////////////////////////////////////////////////////////////////////////
  207. //---------------------------------------------------------------------------------------------------------------------------------
  208. //////////////////////////////////////////////////////////////////////////
  209. // generic AI order
  210. //////////////////////////////////////////////////////////////////////////
  211. class CFlowNode_AISignal
  212.         : public CFlowNode_AISignalBase<CFlowNode_AISignal>
  213. {
  214.         typedef CFlowNode_AISignalBase<CFlowNode_AISignal> TBase;
  215. public:
  216.         CFlowNode_AISignal(IFlowNode::SActivationInfo* pActInfo) : TBase(pActInfo) {}
  217.         virtual void         GetConfiguration(SFlowNodeConfig& config);
  218.         virtual void         DoProcessEvent(IFlowNode::EFlowEvent event, IFlowNode::SActivationInfo* pActInfo);
  219.         virtual IFlowNodePtr Clone(SActivationInfo* pActInfo);
  220.  
  221.         virtual void         OnCancel();
  222.         virtual void         OnFinish();
  223.  
  224.         virtual bool         ShouldForce(IFlowNode::SActivationInfo* pActInfo) const;
  225.  
  226.         virtual void         GetMemoryUsage(ICrySizer* s) const
  227.         {
  228.                 s->Add(*this);
  229.         }
  230. };
  231.  
  232. //////////////////////////////////////////////////////////////////////////
  233. // Executes an Action
  234. //////////////////////////////////////////////////////////////////////////
  235. class CFlowNode_AIExecute
  236.         : public CFlowNode_AIForceableBase<true>
  237. {
  238.         typedef CFlowNode_AIForceableBase<true> TBase;
  239. public:
  240.         CFlowNode_AIExecute(IFlowNode::SActivationInfo* pActInfo) : TBase(pActInfo), m_bCancel(false) {}
  241.         virtual void         GetConfiguration(SFlowNodeConfig& config);
  242.         virtual void         DoProcessEvent(IFlowNode::EFlowEvent event, IFlowNode::SActivationInfo* pActInfo);
  243.         virtual IFlowNodePtr Clone(SActivationInfo* pActInfo);
  244.         virtual EForceMethod GetForceMethod(IFlowNode::SActivationInfo* pActInfo) const;
  245.  
  246.         virtual void         GetMemoryUsage(ICrySizer* s) const
  247.         {
  248.                 s->Add(*this);
  249.         }
  250.  
  251. protected:
  252.         // should call DoProcessEvent if owner is not too much alerted
  253.         virtual void TryExecute(IAIObject* pAI, EFlowEvent event, SActivationInfo* pActInfo);
  254.  
  255.         bool m_bCancel;
  256.         virtual void OnCancelPortActivated(IPipeUser* pPipeUser, SActivationInfo* pActInfo);
  257.  
  258.         virtual void Cancel();
  259.         virtual void Finish();
  260. };
  261.  
  262. #ifdef USE_DEPRECATED_AI_CHARACTER_SYSTEM
  263. //////////////////////////////////////////////////////////////////////////
  264. // Set Character
  265. //////////////////////////////////////////////////////////////////////////
  266. class CFlowNode_AISetCharacter
  267.         : public CFlowNode_AIBase<false>
  268. {
  269.         typedef CFlowNode_AIBase<false> TBase;
  270. public:
  271.         CFlowNode_AISetCharacter(IFlowNode::SActivationInfo* pActInfo) : TBase(pActInfo) {}
  272.         virtual void         GetConfiguration(SFlowNodeConfig& config);
  273.         virtual void         DoProcessEvent(IFlowNode::EFlowEvent event, IFlowNode::SActivationInfo* pActInfo);
  274.         virtual IFlowNodePtr Clone(SActivationInfo* pActInfo);
  275.  
  276.         virtual void         GetMemoryUsage(ICrySizer* s) const
  277.         {
  278.                 s->Add(*this);
  279.         }
  280. };
  281. #endif
  282.  
  283. //////////////////////////////////////////////////////////////////////////
  284. // Set State
  285. //////////////////////////////////////////////////////////////////////////
  286. class CFlowNode_AISetState
  287.         : public CFlowNode_AIBase<false>
  288. {
  289.         typedef CFlowNode_AIBase<false> TBase;
  290. public:
  291.         CFlowNode_AISetState(IFlowNode::SActivationInfo* pActInfo) : TBase(pActInfo) {}
  292.         virtual void         GetConfiguration(SFlowNodeConfig& config);
  293.         virtual void         DoProcessEvent(IFlowNode::EFlowEvent event, IFlowNode::SActivationInfo* pActInfo);
  294.         virtual IFlowNodePtr Clone(SActivationInfo* pActInfo);
  295.  
  296.         virtual void         GetMemoryUsage(ICrySizer* s) const
  297.         {
  298.                 s->Add(*this);
  299.         }
  300. };
  301.  
  302. //////////////////////////////////////////////////////////////////////////
  303. // Vehicle Follow Path
  304. //////////////////////////////////////////////////////////////////////////
  305. class CFlowNode_AIVehicleFollowPath
  306.         : public CFlowNode_AIForceableBase<true>
  307. {
  308.         typedef CFlowNode_AIForceableBase<true> TBase;
  309. public:
  310.         CFlowNode_AIVehicleFollowPath(IFlowNode::SActivationInfo* pActInfo) : TBase(pActInfo) {}
  311.         virtual void         GetConfiguration(SFlowNodeConfig& config);
  312.         virtual void         DoProcessEvent(IFlowNode::EFlowEvent event, IFlowNode::SActivationInfo* pActInfo);
  313.         virtual void         ProcessEvent(IFlowNode::EFlowEvent event, IFlowNode::SActivationInfo* pActInfo);
  314.         virtual EForceMethod GetForceMethod(IFlowNode::SActivationInfo* pActInfo) const;
  315.  
  316.         virtual IFlowNodePtr Clone(SActivationInfo* pActInfo);
  317.  
  318.         virtual void         GetMemoryUsage(ICrySizer* s) const
  319.         {
  320.                 s->Add(*this);
  321.         }
  322. };
  323.  
  324. //////////////////////////////////////////////////////////////////////////
  325. // Vehicle Chase Target
  326. //////////////////////////////////////////////////////////////////////////
  327. class CFlowNode_AIVehicleChaseTarget
  328.         : public CFlowNode_AIForceableBase<true>
  329. {
  330.         typedef CFlowNode_AIForceableBase<true> TBase;
  331.  
  332.         enum Outputs
  333.         {
  334.                 eOut_Failed,
  335.         };
  336.  
  337.         TFlowNodeId m_ID;
  338.         Outputs     m_outputToActivate;
  339.         bool        m_activateOutput;
  340.  
  341. public:
  342.         CFlowNode_AIVehicleChaseTarget(IFlowNode::SActivationInfo* pActInfo) : TBase(pActInfo), m_outputToActivate(eOut_Failed), m_activateOutput(false) {}
  343.         virtual void         GetConfiguration(SFlowNodeConfig& config);
  344.         virtual void         DoProcessEvent(IFlowNode::EFlowEvent event, IFlowNode::SActivationInfo* pActInfo);
  345.         virtual void         ProcessEvent(IFlowNode::EFlowEvent event, IFlowNode::SActivationInfo* pActInfo);
  346.         virtual EForceMethod GetForceMethod(IFlowNode::SActivationInfo* pActInfo) const;
  347.         virtual void         PreExecute(SActivationInfo* pActInfo);
  348.  
  349.         void                 OnEntityEvent(IEntity* pEntity, SEntityEvent& event);
  350.  
  351.         virtual IFlowNodePtr Clone(SActivationInfo* pActInfo);
  352.  
  353.         virtual void         GetMemoryUsage(ICrySizer* s) const
  354.         {
  355.                 s->Add(*this);
  356.         }
  357. };
  358.  
  359. //////////////////////////////////////////////////////////////////////////
  360. // Vehicle Stick Path
  361. //////////////////////////////////////////////////////////////////////////
  362. class CFlowNode_AIVehicleStickPath
  363.         : public CFlowNode_AIForceableBase<true>
  364. {
  365.         typedef CFlowNode_AIForceableBase<true> TBase;
  366.  
  367.         enum Outputs
  368.         {
  369.                 eOut_Done = 0,
  370.                 eOut_Succeeded,
  371.                 eOut_Failed,
  372.                 eOut_Close,
  373.         };
  374.  
  375.         TFlowNodeId m_ID;
  376.         Outputs     m_outputToActivate;
  377.         EntityId    m_entityRegisteredToAsListener;
  378.         bool        m_activateOutput;
  379.  
  380. public:
  381.         ~CFlowNode_AIVehicleStickPath();
  382.         CFlowNode_AIVehicleStickPath(IFlowNode::SActivationInfo* pActInfo)
  383.                 : TBase(pActInfo)
  384.                 , m_activateOutput(false)
  385.                 , m_outputToActivate(eOut_Succeeded)
  386.                 , m_entityRegisteredToAsListener(0)
  387.         {
  388.         }
  389.         virtual void         GetConfiguration(SFlowNodeConfig& config);
  390.         virtual void         DoProcessEvent(IFlowNode::EFlowEvent event, IFlowNode::SActivationInfo* pActInfo);
  391.         virtual void         ProcessEvent(IFlowNode::EFlowEvent event, IFlowNode::SActivationInfo* pActInfo);
  392.         virtual EForceMethod GetForceMethod(IFlowNode::SActivationInfo* pActInfo) const;
  393.         virtual void         PreExecute(SActivationInfo* pActInfo);
  394.  
  395.         void                 OnEntityEvent(IEntity* pEntity, SEntityEvent& event);
  396.  
  397.         virtual IFlowNodePtr Clone(SActivationInfo* pActInfo);
  398.         virtual void         Serialize(SActivationInfo*, TSerialize ser);
  399.  
  400.         virtual void         GetMemoryUsage(ICrySizer* s) const
  401.         {
  402.                 s->Add(*this);
  403.         }
  404.  
  405. private:
  406.         void RegisterForScriptEvent();
  407.         void UnregisterFromScriptEvent();
  408. };
  409.  
  410. //////////////////////////////////////////////////////////////////////////
  411. // Look At
  412. //////////////////////////////////////////////////////////////////////////
  413. class CFlowNode_AILookAt
  414.         : public CFlowNode_AIForceableBase<true>
  415. {
  416.         typedef CFlowNode_AIForceableBase<true> TBase;
  417.         CTimeValue               m_startTime;
  418.         bool                     m_bExecuted;
  419.         IPipeUser::LookTargetPtr m_lookTarget;
  420.  
  421. public:
  422.         CFlowNode_AILookAt(IFlowNode::SActivationInfo* pActInfo) : TBase(pActInfo), m_bExecuted(false) {}
  423.         virtual void         GetConfiguration(SFlowNodeConfig& config);
  424.         virtual void         DoProcessEvent(IFlowNode::EFlowEvent event, IFlowNode::SActivationInfo* pActInfo);
  425.         virtual EForceMethod GetForceMethod(IFlowNode::SActivationInfo* pActInfo) const;
  426.         virtual void         OnCancel();
  427.         virtual void         OnFinish();
  428.         ;
  429.  
  430.         void                 ClearLookTarget();
  431.         virtual bool         OnUpdate(IFlowNode::SActivationInfo* pActInfo);
  432.  
  433.         void                 SetLookTarget(IAIObject* pAI, Vec3 pos);
  434.         virtual IFlowNodePtr Clone(SActivationInfo* pActInfo);
  435.  
  436.         virtual void         GetMemoryUsage(ICrySizer* s) const
  437.         {
  438.                 s->Add(*this);
  439.         }
  440.  
  441. private:
  442.         virtual void PreExecute(SActivationInfo* pActInfo) { m_bExecuted = false; }
  443. };
  444.  
  445. //////////////////////////////////////////////////////////////////////////
  446. // body stance controller
  447. //////////////////////////////////////////////////////////////////////////
  448. class CFlowNode_AIStance
  449.         : public CFlowNode_AIBase<false>
  450. {
  451.         typedef CFlowNode_AIBase<false> TBase;
  452. public:
  453.         CFlowNode_AIStance(IFlowNode::SActivationInfo* pActInfo) : TBase(pActInfo) {}
  454.         virtual void         GetConfiguration(SFlowNodeConfig& config);
  455.         virtual void         DoProcessEvent(IFlowNode::EFlowEvent event, IFlowNode::SActivationInfo* pActInfo);
  456.         virtual IFlowNodePtr Clone(SActivationInfo* pActInfo);
  457.  
  458.         virtual void         GetMemoryUsage(ICrySizer* s) const
  459.         {
  460.                 s->Add(*this);
  461.         }
  462. };
  463.  
  464. //////////////////////////////////////////////////////////////////////////
  465. // unload vehicle
  466. //////////////////////////////////////////////////////////////////////////
  467. class CFlowNode_AIUnload
  468.         : public CFlowNode_AIBase<true>
  469. {
  470.         typedef CFlowNode_AIBase<true> TBase;
  471.         // must implement this abstract function, not called
  472.         virtual void DoProcessEvent(IFlowNode::EFlowEvent event, IFlowNode::SActivationInfo* pActInfo);
  473.  
  474. protected:
  475.         int                     m_numPassengers;
  476.         std::map<int, EntityId> m_mapPassengers;
  477.  
  478.         void         UnloadSeat(IVehicle* pVehicle, int seatId);
  479.         virtual void OnGoalPipeEvent(IPipeUser* pPipeUser, EGoalPipeEvent event, int goalPipeId, bool& unregisterListenerAfterEvent);
  480.         virtual void UnregisterEvents();
  481.  
  482. public:
  483.         CFlowNode_AIUnload(IFlowNode::SActivationInfo* pActInfo) : TBase(pActInfo), m_numPassengers(0) {}
  484.         virtual ~CFlowNode_AIUnload() { UnregisterEvents(); }
  485.  
  486.         virtual void         GetConfiguration(SFlowNodeConfig& config);
  487.         virtual void         ProcessEvent(EFlowEvent event, SActivationInfo* pActInfo);
  488.         virtual IFlowNodePtr Clone(SActivationInfo* pActInfo);
  489.  
  490.         virtual void         GetMemoryUsage(ICrySizer* s) const
  491.         {
  492.                 s->Add(*this);
  493.         }
  494. };
  495.  
  496. //////////////////////////////////////////////////////////////////////////
  497. // drop object
  498. //////////////////////////////////////////////////////////////////////////
  499. class CFlowNode_AIDropObject
  500.         : public CFlowNode_AIForceableBase<true>
  501. {
  502.         typedef CFlowNode_AIForceableBase<true> TBase;
  503. public:
  504.         CFlowNode_AIDropObject(IFlowNode::SActivationInfo* pActInfo) : TBase(pActInfo) {}
  505.         virtual void         GetConfiguration(SFlowNodeConfig& config);
  506.         virtual void         DoProcessEvent(IFlowNode::EFlowEvent event, IFlowNode::SActivationInfo* pActInfo);
  507.         virtual EForceMethod GetForceMethod(IFlowNode::SActivationInfo* pActInfo) const;
  508.         virtual IFlowNodePtr Clone(SActivationInfo* pActInfo);
  509.  
  510.         virtual void         GetMemoryUsage(ICrySizer* s) const
  511.         {
  512.                 s->Add(*this);
  513.         }
  514. };
  515.  
  516. //////////////////////////////////////////////////////////////////////////
  517. // Uses an object
  518. //////////////////////////////////////////////////////////////////////////
  519. class CFlowNode_AIUseObject
  520.         : public CFlowNode_AIForceableBase<true>
  521. {
  522.         typedef CFlowNode_AIForceableBase<true> TBase;
  523. public:
  524.         CFlowNode_AIUseObject(IFlowNode::SActivationInfo* pActInfo) : TBase(pActInfo) {}
  525.         virtual void         GetConfiguration(SFlowNodeConfig& config);
  526.         virtual void         DoProcessEvent(IFlowNode::EFlowEvent event, IFlowNode::SActivationInfo* pActInfo);
  527.         virtual EForceMethod GetForceMethod(IFlowNode::SActivationInfo* pActInfo) const;
  528.         virtual IFlowNodePtr Clone(SActivationInfo* pActInfo);
  529.  
  530.         virtual void         GetMemoryUsage(ICrySizer* s) const
  531.         {
  532.                 s->Add(*this);
  533.         }
  534. };
  535.  
  536. //////////////////////////////////////////////////////////////////////////
  537. // Makes ai enter specifyed seat of specifyed vehicle
  538. //////////////////////////////////////////////////////////////////////////
  539. class CFlowNode_AIEnterVehicle : public CFlowNode_AIForceableBase<true>
  540. {
  541.         typedef CFlowNode_AIForceableBase<true> TBase;
  542. public:
  543.         enum EInputs
  544.         {
  545.                 eIn_Sync,
  546.                 eIn_Cancel,
  547.                 eIn_VehicleId,
  548.                 eIn_Seat,
  549.                 eIn_Fast,
  550.                 eIn_ForceMethod,
  551.         };
  552.         enum EOutputs
  553.         {
  554.                 eOut_Done,
  555.                 eOut_Success,
  556.                 eOut_Fail
  557.         };
  558.  
  559.         CFlowNode_AIEnterVehicle(IFlowNode::SActivationInfo* pActInfo) : CFlowNode_AIForceableBase<true>(pActInfo) {}
  560.         virtual void         GetConfiguration(SFlowNodeConfig& config);
  561.         virtual void         DoProcessEvent(IFlowNode::EFlowEvent event, IFlowNode::SActivationInfo* pActInfo);
  562.         virtual EForceMethod GetForceMethod(IFlowNode::SActivationInfo* pActInfo) const;
  563.         virtual IFlowNodePtr Clone(SActivationInfo* pActInfo);
  564.  
  565.         virtual void         GetMemoryUsage(ICrySizer* s) const
  566.         {
  567.                 s->Add(*this);
  568.         }
  569. };
  570.  
  571. //////////////////////////////////////////////////////////////////////////
  572. // Gets vehicle seat helper positions
  573. //////////////////////////////////////////////////////////////////////////
  574. class CFlowNode_GetSeatHelperVehicle : public CFlowVehicleBase
  575. {
  576. public:
  577.         enum EInputs
  578.         {
  579.                 eIn_Get,
  580.                 eIn_Seat,
  581.         };
  582.         enum EOutputs
  583.         {
  584.                 eOut_Pos,
  585.                 eOut_Dir,
  586.         };
  587.  
  588.         CFlowNode_GetSeatHelperVehicle(SActivationInfo* pActivationInfo)
  589.         {
  590.                 Init(pActivationInfo);
  591.         }
  592.         ~CFlowNode_GetSeatHelperVehicle() { Delete(); }
  593.         IFlowNodePtr Clone(SActivationInfo* pActInfo)
  594.         {
  595.                 IFlowNode* pNode = new CFlowNode_GetSeatHelperVehicle(pActInfo);
  596.                 return pNode;
  597.         }
  598.         virtual void GetConfiguration(SFlowNodeConfig& config);
  599.         virtual void ProcessEvent(IFlowNode::EFlowEvent event, IFlowNode::SActivationInfo* pActInfo);
  600.  
  601.         virtual void GetMemoryUsage(ICrySizer* s) const
  602.         {
  603.                 s->Add(*this);
  604.         }
  605. };
  606.  
downloadFlowNodeAIAction.h Source code - Download CRYENGINE Source code
Related Source Codes/Software:
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top