BVB Source Codes

CRYENGINE Show ScriptBind_AI.h Source code

Return Download CRYENGINE: download ScriptBind_AI.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:   ScriptBind_AI.h
  6.    Version:     v1.00
  7.    Description: Core scriptbinds for the AI system
  8.  
  9.    -------------------------------------------------------------------------
  10.    History:
  11.    - 3:11:2004   - Created by Kirill Bulatsev
  12.    -13:02:2008   - Moved into AI system by Matthew
  13.  
  14.  *********************************************************************/
  15.  
  16. #ifndef __ScriptBind_AI_H__
  17. #define __ScriptBind_AI_H__
  18.  
  19. #pragma once
  20.  
  21. #include <CryScriptSystem/IScriptSystem.h>
  22. #include <CryScriptSystem/ScriptHelpers.h>
  23.  
  24. // These numerical values are deprecated; use the strings instead
  25. enum EAIPathType
  26. {
  27.         AIPATH_DEFAULT,
  28.         AIPATH_HUMAN,
  29.         AIPATH_HUMAN_COVER,
  30.         AIPATH_CAR,
  31.         AIPATH_TANK,
  32.         AIPATH_BOAT,
  33.         AIPATH_HELI,
  34.         AIPATH_3D,
  35.         AIPATH_SCOUT,
  36.         AIPATH_TROOPER,
  37.         AIPATH_HUNTER,
  38. };
  39.  
  40. struct IAISystem;
  41. struct ISystem;
  42. struct AgentMovementAbility;
  43.  
  44. class CScriptBind_AI :
  45.         public CScriptableBase
  46. {
  47. public:
  48.  
  49.         CScriptBind_AI();
  50.         virtual ~CScriptBind_AI();
  51.  
  52.         enum EEncloseDistanceCheckType
  53.         {
  54.                 CHECKTYPE_MIN_DISTANCE,
  55.                 CHECKTYPE_MIN_ROOMSIZE
  56.         };
  57.  
  58.         void Release() { delete this; };
  59.  
  60.         void RunStartupScript();
  61.  
  62.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  63.         // Log functions
  64.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  65.  
  66.         //! <code>AI.LogProgress( szMessage )</code>
  67.         //! <description>Used to indicate "progress markers"">e.g. during loading.</description>
  68.         //!             <param name="szMessage">message line to be displayed in log</param>
  69.         int LogProgress(IFunctionHandler* pH);
  70.  
  71.         //! <code>AI.LogEvent( szMessage )</code>
  72.         //! <description>
  73.         //!             Used to indicate event-driven info that would be useful for debugging
  74.         //!             (may occur on a per-frame or even per-AI-update basis).
  75.         //!     </description>
  76.         //!             <param name="szMessage">message line to be displayed in log</param>
  77.         int LogEvent(IFunctionHandler* pH);
  78.  
  79.         //! <code>AI.LogComment( szMessage )</code>
  80.         //! <description>Used to indicate info that would be useful for debugging,
  81.         //!                             but there's too much of it for it to be enabled all the time.</description>
  82.         //!             <param name="szMessage">message line to be displayed in log</param>
  83.         int LogComment(IFunctionHandler* pH);
  84.  
  85.         //! <code>AI.Warning( szMessage )</code>
  86.         //! <description>Used for warnings about data/script errors.</description>
  87.         //!             <param name="szMessage">message line to be displayed in log</param>
  88.         int Warning(IFunctionHandler* pH);
  89.  
  90.         //! <code>AI.Error( szMessage )</code>
  91.         //! <description>
  92.         //!             Used when we really can't handle some data/situation.
  93.         //!             The code following this should struggle on so that the original cause (e.g. data)
  94.         //!             of the problem can be fixed in the editor, but in game this would halt execution.
  95.         //! </description>
  96.         //!             <param name="szMessage">message line to be displayed in log</param>
  97.         int Error(IFunctionHandler* pH);
  98.  
  99.         //! <code>AI.RecComment( szMessage )</code>
  100.         //! <description>Record comment with AIRecorder.</description>
  101.         //!             <param name="szMessage">message line to be displayed in recorder view</param>
  102.         int RecComment(IFunctionHandler* pH);
  103.  
  104.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  105.         // General AI System functions
  106.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  107.  
  108.         //! <code>AI.ResetParameters( entityId, bProcessMovement, PropertiesTable, PropertiesInstanceTable )</code>
  109.         //! <description>Resets all the AI parameters.</description>
  110.         //!             <param name="entityId">entity id</param>
  111.         //!             <param name="bProcessMovement">reset movement data as well</param>
  112.         //!             <param name="PropertiesTable">Lua table containing the entity properties like groupid, sightrange, sound range etc (editable in editor, usually defined as "Properties")</param>
  113.         //!             <param name="PropertiesInstanceTable">another properties table, same as PropertiesTable (editable in editor, usually defined as "PropertiesInstance")</param>
  114.         int ResetParameters(IFunctionHandler* pH);
  115.  
  116.         //! <code>AI.ChangeParameter( entityId, paramEnum, paramValue )</code>
  117.         //! <description>Changes an enumerated AI parameter.</description>
  118.         //!             <param name="entityId - entity id</param>
  119.         //!             <param name="paramEnum - the parameter to change, should be one of the following:
  120.         //!                     AIPARAM_SIGHTRANGE - sight range in (meters).
  121.         //!                     AIPARAM_ATTACKRANGE     - attack range in (meters).
  122.         //!                     AIPARAM_ACCURACY - firing accuracy (real [0..1]).
  123.         //!                     AIPARAM_AGGRESION - aggression (real [0..1]).
  124.         //!                     AIPARAM_GROUPID - group id (integer).
  125.         //!                     AIPARAM_FOV_PRIMARY - primary field of vision (degrees).
  126.         //!                     AIPARAM_FOV_SECONDARY - pheripheral field of vision (degrees).
  127.         //!                     AIPARAM_COMMRANGE - communication range (meters).
  128.         //!                     AIPARAM_FWDSPEED - forward speed (vehicles only).
  129.         //!                     AIPARAM_RESPONSIVENESS - responsiveness (real).
  130.         //!                     AIPARAM_SPECIES - entity species (integer).
  131.         //!                     AIPARAM_TRACKPATTERN - track pattern name (string).
  132.         //!                     AIPARAM_TRACKPATTERN_ADVANCE - track pattern advancing (0 = stop, 1 = advance).</param>
  133.         //!             <param name="paramValue">new parameter value, see above for type and meaning.</param>
  134.         int ChangeParameter(IFunctionHandler* pH);
  135.  
  136.         //! <code>AI.IsEnabled( entityId )</code>
  137.         //! <description>Returns true if entity's AI is enabled.</description>
  138.         //!             <param name="entityId">entity id</param>
  139.         int IsEnabled(IFunctionHandler* pH);
  140.  
  141.         //! <code>AI.GetTypeOf( entityId )</code>
  142.         //! <description>returns the given entity's type.</description>
  143.         //!             <param name="entityId">AI's entity id</param>
  144.         //! <returns>type of given entity (as defined in IAgent.h)</returns>
  145.         int GetTypeOf(IFunctionHandler* pH);
  146.  
  147.         //! <code>AI.GetSubTypeOf( entityId )</code>
  148.         //! <description>returns the given entity's sub type.</description>
  149.         //!             <param name="entityId">AI's entity id</param>
  150.         //! <returns>sub type of given entity (as defined in IAgent.h).</returns>
  151.         // TODO : only returns subtypes below 26/06/2006
  152.         // AIOBJECT_CAR
  153.         // AIOBJECT_BOAT
  154.         // AIOBJECT_HELICOPTER
  155.         int GetSubTypeOf(IFunctionHandler* pH);
  156.  
  157.         //! <code>AI.GetParameter( entityId, paramEnum )</code>
  158.         //! <description>Changes an enumerated AI parameter.</description>
  159.         //!             <param name="entityId">entity id</param>
  160.         //!             <param name="paramEnum">index of the parameter to get, see AI.ChangeParameter() for complete list</param>
  161.         //! <returns>parameter value</returns>
  162.         // INTEGRATION : (MATT) GetAIParameter will appear from main branch and is duplicate {2007/08/03:11:00:39}
  163.         // Embracing and extending their code whilst keeping the old name - wish to remain consistent with ChangeParameter above
  164.         int GetParameter(IFunctionHandler* pH);
  165.  
  166.         //! <code>AI.ChangeMovementAbility( entityId, paramEnum, paramValue )</code>
  167.         //! <description>Changes an enumerated AI movement ability parameter.</description>
  168.         //!             <param name="entityId">entity id</param>
  169.         //!             <param name="paramEnum">the parameter to change, should be one of the following:
  170.         //!                     AIMOVEABILITY_OPTIMALFLIGHTHEIGHT - optimal flight height while finding path (meters).
  171.         //!                     AIMOVEABILITY_MINFLIGHTHEIGHT - minimum flight height while finding path (meters).
  172.         //!                     AIMOVEABILITY_MAXFLIGHTHEIGHT - maximum flight height while finding path (meters).</param>
  173.         //!             <param name="paramValue">new parameter value, see above for type and meaning.</param>
  174.         int ChangeMovementAbility(IFunctionHandler* pH);
  175.  
  176.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  177.         // Smart Object functions
  178.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  179.  
  180.         /*
  181.            //! <code>AI.AddSmartObjectCondition( smartObjectTable )</code>
  182.            //! <description>Registers the given smartObjectTable to AI System.</description>
  183.            //!          <param name="smartObjectTable">a table defining conditions on which specified Smart Object could be used
  184.            int AddSmartObjectCondition(IFunctionHandler *pH);
  185.          */
  186.  
  187.         //! <code>AI.ExecuteAction( action, participant1 [, participant2 [, ... , participantN ] ] )</code>
  188.         //! <description>Executes an Action on a set of Participants.</description>
  189.         //!             <param name="action">Smart Object Action name or id</param>
  190.         //!             <param name="participant1">entity id of the first Participant in the Action</param>
  191.         //!             <param name="(optional) participant2..N">entity ids of other participants</param>
  192.         int ExecuteAction(IFunctionHandler* pH);
  193.  
  194.         //! <code>AI.AbortAction( userId [, actionId ] )</code>
  195.         //! <description>Aborts execution of an action if actionId is specified, or aborts execution of all actions if actionId is nil or 0</description>
  196.         //!             <param name="userId">entity id of the user which AI action is aborted</param>
  197.         //!             <param name="actionId (optional)">id of action to be aborted or 0 (or nil) to abort all actions on specified entity</param>
  198.         int AbortAction(IFunctionHandler* pH);
  199.  
  200.         //! <code>AI.SetSmartObjectState( entityId, stateName )</code>
  201.         //! <description>Sets only one single smart object state replacing all other states.</description>
  202.         //!             <param name="entityId">entity id</param>
  203.         //!             <param name="stateName">name of the new state (i.e. "Idle")</param>
  204.         int SetSmartObjectState(IFunctionHandler* pH);
  205.  
  206.         //! <code>AI.ModifySmartObjectStates( entityId, listStates )</code>
  207.         //! <description>Adds/Removes smart object states of a given entity.</description>
  208.         //!             <param name="entityId">entity id</param>
  209.         //!             <param name="listStates">names of the states to be added and removed (i.e. "Closed, Locked">Open, Unlocked, Busy")</param>
  210.         int ModifySmartObjectStates(IFunctionHandler* pH);
  211.  
  212.         //! <code>AI.SmartObjectEvent( actionName, userEntityId, objectEntityId [, vRefPoint] )</code>
  213.         //! <description>Executes a smart action.</description>
  214.         //!             <param name="actionName">smart action name</param>
  215.         //!             <param name="usedEntityId">entity id of the user who needs to execute the smart action or a nil if user is unknown</param>
  216.         //!             <param name="objectEntityId">entity id of the object on which the smart action needs to be executed or a nil if objects is unknown</param>
  217.         //!             <param name="vRefPoint">(optional) point to be used instead of user's attention target position</param>
  218.         //! <returns>0 if smart object rule wasn't found or a non-zero unique id of the goal pipe inserted to execute the action.</returns>
  219.         int SmartObjectEvent(IFunctionHandler* pH);
  220.  
  221.         //! <code>AI.GetLastUsedSmartObject( userEntityId )</code>
  222.         //! <description>Returns the last used smart object.</description>
  223.         //!             <param name="usedEntityId">entity id of the user for which its last used smart object is needed</param>
  224.         //! <returns>
  225.         //!             nil if there's no last used smart object (or if an error has occurred)
  226.         //!             or the script table of the entity which is the last used smart object
  227.         //! </returns>
  228.         int GetLastUsedSmartObject(IFunctionHandler* pH);
  229.  
  230.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  231.         // GoalPipe functions
  232.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  233.  
  234.         //! <code>AI.CreateGoalPipe( szPipeName )</code>
  235.         //! <description>Used for warnings about data/script errors.</description>
  236.         //!             <param name="szPipeName">goal pipe name</param>
  237.         int CreateGoalPipe(IFunctionHandler* pH);
  238.  
  239.         //! <code>AI.BeginGoalPipe( szPipeName )</code>
  240.         //! <description>Creates a goal pipe and allows to start filling it.</description>
  241.         //!             <param name="szPipeName">goal pipe name</param>
  242.         int BeginGoalPipe(IFunctionHandler* pH);
  243.  
  244.         //! <code>AI.EndGoalPipe()</code>
  245.         //! <description>Ends creating a goal pipe.</description>
  246.         int EndGoalPipe(IFunctionHandler* pH);
  247.  
  248.         //! <code>AI.BeginGroup()</code>
  249.         //! <description>to define group of goals.</description>
  250.         int BeginGroup(IFunctionHandler* pH);
  251.  
  252.         //! <code>AI.EndGroup()</code>
  253.         //! <description>Defines the end of a group of goals.</description>
  254.         int EndGroup(IFunctionHandler* pH);
  255.  
  256.         //! <code>AI.PushGoal( szPipeName, goalName, blocking [,{params}] )</code>
  257.         //! <description>Used for warnings about data/script errors.</description>
  258.         //!             <param name="szPipeName">goal pipe name</param>
  259.         //!             <param name="szGoalName">goal name - see AI Manual for a complete list of goals</param>
  260.         //!             <param name="blocking">used to mark the goal as blocking (goal pipe execution will stop here</param>
  261.         //!             <param name="until the goal has finished) 0: not blocking, 1: blocking</param>
  262.         //!             <param name="(optional) params">set of parameters depending on the goal selected; see the AI Manual for a complete list of the parameters for each goal</param>
  263.         int PushGoal(IFunctionHandler* pH);
  264.  
  265.         //! <code>AI.PushLabel( szPipeName, szLabelName )</code>
  266.         //! <description>Used in combination with "branch" goal operation to identify jump destination.</description>
  267.         //!             <param name="szPipeName">goalpipe name</param>
  268.         //!             <param name="szLabelName">label name</param>
  269.         int PushLabel(IFunctionHandler* pH);
  270.  
  271.         //! <code>AI.IsGoalPipe( szPipeName )</code>
  272.         //! <description>Checks is a goalpipe of certain name exists already, returns true if pipe exists.</description>
  273.         //!             <param name="szPipeName">goalpipe name</param>
  274.         int IsGoalPipe(IFunctionHandler* pH);
  275.  
  276.         //! <code>AI.ClearForReload( szPipeName )</code>
  277.         //! <description>Clears all goalpipes from the system.</description>
  278.         int ClearForReload(IFunctionHandler* pH);
  279.  
  280.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  281.         // Signal functions
  282.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  283.  
  284.         //! <code>AI.Signal(signalFilter, signalType, SignalText, senderId [, signalExtraData] )</code>
  285.         //! <description>Sends a signal to an entity or a group of entities.</description>
  286.         //!             <param name="sender Id: sender's entity id; despite the name, sender may not be necessarily the actual AI.Signal function caller
  287.         //!             <param name="signalFilter - filter which defines the subset of AIobjects which will receive the signal:
  288.         //!                     SIGNALFILTER_SENDER: signal is sent to the sender only (may be not the caller itself in this case)
  289.         //!                     SIGNALFILTER_GROUPONLY: signal is sent to all the AIObjects in the same sender's group, within its communication range
  290.         //!                     SIGNALFILTER_GROUPONLY_EXCEPT: signal is sent to all the AIObjects in the same sender's group, within its communication range, except the sender itself
  291.         //!                     SIGNALFILTER_SUPERGROUP: signal is sent signal is sent to all the AIObjects in the same sender's group
  292.         //!                     SIGNALFILTER_SPECIESONLY: signal is sent to all the AIObjects in the same sender's species, in his comm range
  293.         //!                     SIGNALFILTER_SUPERSPECIES: signal is sent to all AIObjects in the same sender's species
  294.         //!                     SIGNALFILTER_ANYONEINCOMM: signal is sent to all the AIObjects in sender's communication range
  295.         //!                     SIGNALFILTER_NEARESTGROUP: signal is sent to the nearest AIObject in the sender's group
  296.         //!                     SIGNALFILTER_NEARESTINCOMM: signal is sent to the nearest AIObject, in the sender's group, within sender's communication range
  297.         //!                     SIGNALFILTER_NEARESTINCOMM_SPECIES: signal is sent to the nearest AIObject, in the sender's species, within sender's communication range
  298.         //!                     SIGNALFILTER_HALFOFGROUP: signal is sent to the first half of the AI Objects in the sender's group
  299.         //!                     SIGNALFILTER_LEADER: signal is sent to the sender's group CLeader Object
  300.         //!                     SIGNALFILTER_LEADERENTITY: signal is sent to the sender's group leader AIObject (which has the CLeader associated)</param>
  301.         //!             <param name="signalType -
  302.         //!                     -1: signal is processed by all entities, even if they're disabled/sleeping
  303.         //!                      0: signal is processed by all entities which are enabled
  304.         //!                      1: signal is processed by all entities which are enabled and not sleeping</param>
  305.         //!                     10: signal is added in the sender's signal queue even if another signal with same text is present (normally it's not)
  306.         //!             <param name="signalText: signal text which will be processed by the receivers (in a Lua callback with the same name as the text, or directly by the CAIObject)</param>
  307.         //!             <param name="(optional) signalExtraData: lua table which can be used to send extra data. It can contains the following values:
  308.         //!                     point: a vector in format {x,y,z}
  309.         //!                     point2: a vector in format {x,y,z}
  310.         //!                     ObjectName: a string
  311.         //!                     id: an entity id
  312.         //!                     fValue: a float value
  313.         //!                     iValue: an integer value
  314.         //!                     iValue2: a second integer value</param>
  315.         int Signal(IFunctionHandler* pH);
  316.  
  317.         int NotifyGroup(IFunctionHandler* pH, int groupID, ScriptHandle sender, const char* notification);
  318.  
  319.         //! <code>AI.FreeSignal( signalType, SignalText, position, radius [, entityID [,signalExtraData]] )</code>
  320.         //! <description>Sends a signal to anyone in a given radius around a position.</description>
  321.         //!             <param name="signalType">see AI.Signal</param>
  322.         //!             <param name="signalText">See AI.Signal</param>
  323.         //!             <param name="position">center position {x,y,z}around which the signal is sent</param>
  324.         //!             <param name="radius">radius inside which the signal is sent</param>
  325.         //!             <param name="(optional) entityID">signal is NOT sent to entities which groupID is same as the entity's one</param>
  326.         //!             <param name="(optional) signalExtraData">See AI.Signal</param>
  327.         int FreeSignal(IFunctionHandler* pH);
  328.  
  329.         //! <code>AI.SetIgnorant( entityId, ignorant )</code>
  330.         //! <description>makes an AI ignore system signals, visual stimuli and sound stimuli.</description>
  331.         //!             <param name="entityId">AI's entity id</param>
  332.         //!             <param name="ignorant">0: not ignorant, 1: ignorant</param>
  333.         int SetIgnorant(IFunctionHandler* pH);
  334.  
  335.         int BreakEvent(IFunctionHandler* pH, ScriptHandle entityID, Vec3 pos, float radius);
  336.         int AddCoverEntity(IFunctionHandler* pH, ScriptHandle entityID);
  337.         int RemoveCoverEntity(IFunctionHandler* pH, ScriptHandle entityID);
  338.  
  339.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  340.         //// Group-Species functions
  341.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  342.  
  343.         //! <code>AI.GetGroupCount( entityId, flags, type )</code>
  344.         //! <description>returns the given entity's group members count.</description>
  345.         //!             <param name="entityId">AI's entity id or groupId - AI's group id</param>
  346.         //!             <param name="flags">combination of following flags:
  347.         //!                     GROUP_ALL - Returns all agents in the group (default).
  348.         //!                     GROUP_ENABLED - Returns only the count of enabled agents (exclusive with all).
  349.         //!                     GROUP_MAX - Returns the maximum number of agents during the game (can be combined with all or enabled).</param>
  350.         //!             <param name="type">allows to filter to return only specific AI objects by type (cannot be used in together with GROUP_MAX flag).</param>
  351.         //! <returns>group members count</returns>
  352.         int GetGroupCount(IFunctionHandler* pH);
  353.  
  354.         //! <code>AI.GetGroupMember( entityId|groupId, idx, flags, type)</code>
  355.         //! <description>returns the idx-th entity in the given group.</description>
  356.         //!             <param name="entityId|groupId">AI's entity id \ group id</param>
  357.         //!             <param name="idx">index  (1..N)</param>
  358.         //!             <param name="flags">combination of following flags:
  359.         //!                     GROUP_ALL - Returns all agents in the group (default).
  360.         //!                     GROUP_ENABLED - Returns only the count of enabled agents (exclusive with all).</param>
  361.         //!             <param name="type">allows to filter to return only specific AI objects by type (cannot be used in together with GROUP_MAX flag).</param>
  362.         //! <returns>script handler of idx-th entity (null if idx is out of range)</returns>
  363.         int GetGroupMember(IFunctionHandler* pH);
  364.  
  365.         //! <code>AI.GetGroupOf( entityId )</code>
  366.         //! <description>returns the given entity's group id.</description>
  367.         //!             <param name="entityId">AI's entity id</param>
  368.         //! <returns>group id of given entity</returns>
  369.         int GetGroupOf(IFunctionHandler* pH);
  370.  
  371.         //! <code>AI.GetFactionOf( entityID )</code>
  372.         //! <returns>The faction of the specified entity.</returns>
  373.         int GetFactionOf(IFunctionHandler* pH, ScriptHandle entityID);
  374.  
  375.         //! <code>AI.SetFactionOf( entityID, factionName )</code>
  376.         //! <description>Make the specified entity a member of the named faction.</description>
  377.         int SetFactionOf(IFunctionHandler* pH, ScriptHandle entityID, const char* factionName);
  378.  
  379.         int GetReactionOf(IFunctionHandler* pH);
  380.         int SetReactionOf(IFunctionHandler* pH, const char* factionOne, const char* factionTwo, int reaction);
  381.  
  382.         //! <code>AI.GetUnitInRank( groupID [,rank] )</code>
  383.         //! <description>Returns the entity in the group  id in the given rank position, or the highest if rank == nil or rank <=0
  384.         //!     the rank is specified in entity.Properties.nRank
  385.         //! </description>
  386.         //!             <param name="rank">rank position (the highest (1) if rank == nil or rank <=0)</param>
  387.         //! <returns>entity script table of the ranked unit</returns>
  388.         int GetUnitInRank(IFunctionHandler* pH);
  389.  
  390.         //! <code>AI.SetUnitProperties( entityId, unitProperties )</code>
  391.         //! <description>Sets the leader knowledge about the units combat capabilities.
  392.         //!             The leader will be found based on the group id of the entity.
  393.         //! </description>
  394.         //!             <param name="entityId">AI's entity id</param>
  395.         //!             <param name="unitProperties">binary mask of unit properties type for which the attack is requested
  396.         //!                     (in the form of UPR_* + UPR* i.e. UPR_COMBAT_GROUND + UPR_COMBAT_FLIGHT)
  397.         //!                     see IAgent.h for definition of unit properties UPR_*</param>
  398.         int SetUnitProperties(IFunctionHandler* pH);
  399.  
  400.         //! <code>AI.GetUnitCount( entityId, unitProperties )</code>
  401.         //! <description>Gets the number of units the leader knows about.
  402.         //!     The leader will be found based on the group id of the entity.
  403.         //! </description>
  404.         //!             <param name="entityId">AI's entity id</param>
  405.         //!             <param name="unitProperties">binary mask of the returned unit properties type
  406.         //!                     (in the form of UPR_* + UPR* i.e. UPR_COMBAT_GROUND + UPR_COMBAT_FLIGHT)
  407.         //!                     see IAgent.h for definition of unit properties UPR_*</param>
  408.         int GetUnitCount(IFunctionHandler* pH);
  409.  
  410.         //! <code>AI.Hostile( entityId, entity2Id|AIObjectName )</code>
  411.         //! <description>returns true if the two entities are hostile.</description>
  412.         //!             <param name="entityId">1st AI's entity id</param>
  413.         //!             <param name="entity2Id | AIObjectName">2nd AI's entity id | 2nd AIobject's name</param>
  414.         //! <returns>true if the entities are hostile</returns>
  415.         int Hostile(IFunctionHandler* pH);
  416.  
  417.         //! <code>AI.GetLeader( groupID | entityID )</code>
  418.         //! <returns>the leader's name of the given groupID / entity</returns>
  419.         //!             <param name="groupID">group id</param>
  420.         //!             <param name="entityID">entity (id) of which we want to find the leader</param>
  421.         int GetLeader(IFunctionHandler* pH);
  422.  
  423.         //! <code>AI.SetLeader( entityID )</code>
  424.         //! <description>
  425.         //!             Set the given entity as Leader (associating a CLeader object to it and creating it if it doesn't exist)
  426.         //!             Only one leader can be set per group.
  427.         //! </description>
  428.         //!             <param name="entityID">entity (id) of which to which we want to associate a leader class</param>
  429.         //! <returns>true if the leader creation/association has been successful</returns>
  430.         int SetLeader(IFunctionHandler* pH);
  431.  
  432.         //! <code>AI.GetBeaconPosition( entityId | AIObjectName, returnPos )</code>
  433.         //! <description>get the beacon's position for the given entity/object's group.</description>
  434.         //!             <param name="entityId | AIObjectName">AI's entity id | AI object name</param>
  435.         //!             <param name="returnPos">vector {x,y,z} where the beacon position will be set</param>
  436.         //! <returns>true if the beacon has been found and the position set</returns>
  437.         int GetBeaconPosition(IFunctionHandler* pH);
  438.  
  439.         //! <code>AI.SetBeaconPosition( entityId | AIObjectName, pos )</code>
  440.         //! <description>Set the beacon's position for the given entity/object's group.</description>
  441.         //!             <param name="entityId | AIObjectName">AI's entity id | AI object name</param>
  442.         //!             <param name="pos">beacon position vector {x,y,z}</param>
  443.         int SetBeaconPosition(IFunctionHandler* pH);
  444.  
  445.         //! <code>AI.RequestAttack( entityId, unitProperties, attackTypeList [,duration] )</code>
  446.         //! <description>in a group with leader, the entity requests for a group attack behavior against the enemy
  447.         //!             The Cleader later will possibly create an attack leader action (CLeaderAction_Attack_*)
  448.         //! </description>
  449.         //!             <param name="entityId">AI's entity id which group/leader is determined</param>
  450.         //!             <param name="unitProperties">binary mask of unit properties type for which the attack is requested
  451.         //!                     (in the form of UPR_* + UPR* i.e. UPR_COMBAT_GROUND + UPR_COMBAT_FLIGHT)
  452.         //!                     see IAgent.h for definition of unit properties UPR_*</param>
  453.         //!             <param name="attackTypeList">a lua table which contains the list of preferred attack strategies (Leader action subtypes),
  454.         //!                     sorted by priority (most preferred first)
  455.         //!                     the list must be in the format {LAS_*, LAS_*,..} i.e. (LAS_ATTACK_ROW,LAS_ATTACK_FLANK} means that first an Attack_row
  456.         //!                     action will be tried, then an attack_flank if the first ends/fails.
  457.         //!                     see IAgent.h for definition of LeaderActionSubtype (LAS_*) action types</param>
  458.         //!             <param name="duration">(optional) max duration in sec (default = 0)</param>
  459.         int RequestAttack(IFunctionHandler* pH);
  460.  
  461.         //! <code>AI.GetGroupTarget( entityId [,bHostileOnly [,bLiveOnly]] )</code>
  462.         //! <description>Returns the most threatening attention target amongst the agents in the given entity's group. (see IAgent.h for definition of alert status)</description>
  463.         //!             <param name="entityId">AI's entity id which group is determined</param>
  464.         //!             <param name="bHostileOnly (optional)">filter only hostile targets in group</param>
  465.         //!             <param name="bLiveOnly (optional)">filter only live targets in group (entities)</param>
  466.         int GetGroupTarget(IFunctionHandler* pH);
  467.  
  468.         //! <code>AI.GetGroupTargetType( groupID )</code>
  469.         int GetGroupTargetType(IFunctionHandler* pH, int groupID);
  470.  
  471.         //! <code>AI.GetGroupTargetThreat( groupID )</code>
  472.         int GetGroupTargetThreat(IFunctionHandler* pH, int groupID);
  473.  
  474.         //! <code>AI.GetGroupTargetEntity( groupID )</code>
  475.         int GetGroupTargetEntity(IFunctionHandler* pH, int groupID);
  476.  
  477.         //! <code>AI.GetGroupScriptTable( groupID )</code>
  478.         int GetGroupScriptTable(IFunctionHandler* pH, int groupID);
  479.  
  480.         //! <code>AI.GetGroupTargetCount( entityId [,bHostileOnly [,bLiveOnly]] )</code>
  481.         //! <description>Returns the number of attention targets amongst the agents in the given entity's group.</description>
  482.         //!             <param name="entityId">AI's entity id which group is determined</param>
  483.         //!             <param name="bHostileOnly (optional)">filter only hostile targets in group</param>
  484.         //!             <param name="bLiveOnly (optional)">filter only live targets in group (entities)</param>
  485.         int GetGroupTargetCount(IFunctionHandler* pH);
  486.  
  487.         //! <code>AI.GetGroupAveragePosition( entityId, properties, returnPos )</code>
  488.         //! <description>gets the average position of the (leader's) group members</description>
  489.         //!             <param name="entityId">AI's entity id which group/leader is determined</param>
  490.         //!             <param name="unitProperties">binary mask of unit properties type for which the attack is requested
  491.         //!                     (in the form of UPR_* + UPR* i.e. UPR_COMBAT_GROUND + UPR_COMBAT_FLIGHT)
  492.         //!                     see IAgent.h for definition of unit properties UPR_*</param>
  493.         //! <returns>Pos returned average position</returns>
  494.         int GetGroupAveragePosition(IFunctionHandler* pH);
  495.  
  496.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  497.         /// Object finding
  498.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  499.  
  500.         //! <code>AI.FindObjectOfType( entityId, radius, AIObjectType, flags [,returnPosition [,returnDirection]] )
  501.         //!               AI.FindObjectOfType( position, radius, AIObjectType, [,returnPosition [,returnDirection]] )
  502.         //! </code>
  503.         //! <description>returns the closest AIObject of a given type around a given entity/position;
  504.         //!                             once an AIObject is found, it's devalued and can't be found again for some seconds (unless specified in flags).
  505.         //! </description>
  506.         //!             <param name="entityId">AI's entity id as a center position of the search (if 1st parameter is not a vector)</param>
  507.         //!             <param name="position">center position of the search (if 1st parameter is not an entity id)</param>
  508.         //!             <param name="radius">radius inside which the object must be found</param>
  509.         //!             <param name="AIObjectType">AIObject type; see ScriptBindAI.cpp and Scripts/AIAnchor.lua for a complete list of AIObject types available</param>
  510.         //!             <param name="flags">filter for AI Objects to search, which can be the sum of one or more of the following values:
  511.         //!                     AIFAF_VISIBLE_FROM_REQUESTER: Requires whoever is requesting the anchor to also have a line of sight to it
  512.         //!     AIFAF_VISIBLE_TARGET: Requires that there is a line of sight between target and anchor
  513.         //!     AIFAF_INCLUDE_DEVALUED: don't care if the object is devalued
  514.         //!                     AIFAF_INCLUDE_DISABLED: don't care if the object is disabled</param>
  515.         //!             <param name="(optional) returnPosition">position of the found object</param>
  516.         //!             <param name="(optional) returnDirection">direction of the found object</param>
  517.         //! <returns>the found AIObject's name (nil if not found)</returns>
  518.         int FindObjectOfType(IFunctionHandler* pH);
  519.  
  520.         //! <code>AI.GetAnchor( entityId, radius, AIAnchorType, searchType [,returnPosition [,returnDirection]] )</code>
  521.         //! <description>returns the closest Anchor of a given type around a given entity;
  522.         //!                             once an Anchor is found, it's devalued and can't be found again for some seconds (unless specified in flags).
  523.         //! </description>
  524.         //!             <param name="entityId">AI's entity id as a center position of the search</param>
  525.         //!             <param name="radius">radius inside which the object must be found. Alternatively a search range can be specified {min=minRad,max=maxRad}.</param>
  526.         //!             <param name="AIAnchorType">Anchor type; see Scripts/AIAnchor.lua for a complete list of Anchor types available</param>
  527.         //!             <param name="searchType">search type filter, which can be one of the following values:
  528.         //!                     AIANCHOR_NEAREST: (default) the nearest anchor of the given type
  529.         //!                     AIANCHOR_NEAREST_IN_FRONT: the nearest anchor inside the front cone of entity
  530.         //!                     AIANCHOR_NEAREST_FACING_AT: the nearest anchor of given type which is oriented towards entity's attention target (...Dejan? )
  531.         //!                     AIANCHOR_RANDOM_IN_RANGE: a random anchor of the given type
  532.         //!                     AIANCHOR_NEAREST_TO_REFPOINT: the nearest anchor of given type to the entity's reference point</param>
  533.         //!             <param name="(optional) returnPosition">position of the found object</param>
  534.         //!             <param name="(optional) returnDirection">direction of the found object</param>
  535.         //! <returns>the found Anchor's name (nil if not found)</returns>
  536.         int GetAnchor(IFunctionHandler* pH);
  537.  
  538.         //! <code>AI.GetNearestEntitiesOfType( entityId|objectname|position, AIObjectType, maxObjects, returnList [,objectFilter [,radius]] )</code>
  539.         //! <description>returns a list of the closest N entities of a given AIObjkect type associated the found objects are then devalued.</description>
  540.         //!             <param name="entityId | objectname |position">AI's entity id | name| position as a center position of the search</param>
  541.         //!             <param name="radius">radius inside which the entities must be found</param>
  542.         //!             <param name="AIObjectType">AIObject type; see ScriptBindAI.cpp and Scripts/AIAnchor.lua for a complete list of AIObject types available</param>
  543.         //!             <param name="maxObjects">maximum number of objects to find</param>
  544.         //!             <param name="return list">Lua table which will be filled up with the list of the found entities (Lua handlers)</param>
  545.         //!             <param name="(optional) objectFilter">search type filter, which can be the sum of one or more of the following values:
  546.         //!                     AIOBJECTFILTER_SAMEFACTION: AI objects of the same species of the querying object
  547.         //!                     AIOBJECTFILTER_SAMEGROUP: AI objects of the same group of the querying object or with no group
  548.         //!                     AIOBJECTFILTER_NOGROUP :AI objects with Group ID ==AI_NOGROUP
  549.         //!                     AIOBJECTFILTER_INCLUDEINACTIVE :Includes objects which are inactivated.</param>
  550.         //!             <param name="(optional) radius - serch range( default 30m )</param>
  551.         //! <returns>the number of found entities</returns>
  552.         int GetNearestEntitiesOfType(IFunctionHandler* pH);
  553.  
  554.         //! <code>AI.GetAIObjectPosition( entityId | AIObjectName )</code>
  555.         //! <description>get the given AIObject's position.</description>
  556.         //!             <param name="entityId | AIObjectName">AI's entity id | AI object name</param>
  557.         //! <returns>AI Object position vector {x,y,z}</returns>
  558.         int GetAIObjectPosition(IFunctionHandler* pH);
  559.  
  560.         //! <code>AI.IgnoreCurrentHideObject( entityId )</code>
  561.         //! <description>Marks the current hideobject unreachable (will be omitted from future hidespot selections).</description>
  562.         //!             <param name="entityId">AI's entity id</param>
  563.         int IgnoreCurrentHideObject(IFunctionHandler* pH);
  564.  
  565.         //! <code>AI.GetCurrentHideAnchor( entityId )</code>
  566.         //! <description>Returns the name of the current anchor the entity is using for cover.</description>
  567.         //!             <param name="entityId">AI's entity id</param>
  568.         int GetCurrentHideAnchor(IFunctionHandler* pH);
  569.  
  570.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  571.         /// Attention Target / perception related functions
  572.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  573.  
  574.         int GetForwardDir(IFunctionHandler* pH);
  575.  
  576.         //! <code>AI.GetAttentionTargetOf( entityId )</code>
  577.         //! <description>returns the given entity's attention target.</description>
  578.         //!             <param name="entityId">AI's entity id</param>
  579.         //! <returns>attention target's name (nil if no target)</returns>
  580.         int GetAttentionTargetOf(IFunctionHandler* pH);
  581.  
  582.         //! <code>AI.GetAttentionTargetAIType( entityId )</code>
  583.         //! <description>returns the given entity's attention target AI type (AIOBJECT_*).</description>
  584.         //!             <param name="entityId">AI's entity id</param>
  585.         //! <returns>attention target's type (AIOBJECT_NONE if no target)</returns>
  586.         int GetAttentionTargetAIType(IFunctionHandler* pH);
  587.  
  588.         //! <code>AI.GetAttentionTargetType( entityId )</code>
  589.         //! <description>returns the given entity's attention target type (AITARGET_*).</description>
  590.         //!             <param name="entityId">AI's entity id</param>
  591.         //! <returns>attention target's type (AITARGET_NONE if no target)</returns>
  592.         int GetAttentionTargetType(IFunctionHandler* pH);
  593.  
  594.         //! <code>AI.GetAttentionTargetEntity( entityId )</code>
  595.         //! <description>returns the given entity's attention target entity (if it is an entity) or
  596.         //!   the owner entity of the attention target if it is a dummy object (if there is an owner entity).
  597.         //! </description>
  598.         //!             <param name="entityId">AI's entity id</param>
  599.         //! <returns>attention target's entity</returns>
  600.         int GetAttentionTargetEntity(IFunctionHandler* pH, ScriptHandle entityID);
  601.  
  602.         //! <code>AI.GetAttentionTargetPosition( entityId, returnPos )</code>
  603.         //! <description>returns the given entity's attention target's position.</description>
  604.         //!             <param name="entityId">AI's entity id</param>
  605.         //! <returns>Pos - vector {x,y,z} passed as a return value (attention target 's position)</returns>
  606.         int GetAttentionTargetPosition(IFunctionHandler* pH);
  607.  
  608.         //! <code>AI.GetAttentionTargetDirection( entityId, returnDir )</code>
  609.         //! <description>returns the given entity's attention target's direction.</description>
  610.         //!             <param name="entityId">AI's entity id</param>
  611.         //! <returns>Dir - vector {x,y,z} passed as a return value (attention target 's direction)</returns>
  612.         int GetAttentionTargetDirection(IFunctionHandler* pH);
  613.  
  614.         //! <code>AI.GetAttentionTargetViewDirection( entityId, returnDir )</code>
  615.         //! <description>returns the given entity's attention target's view direction.</description>
  616.         //!             <param name="entityId">AI's entity id</param>
  617.         //! <returns>Dir - vector {x,y,z} passed as a return value (attention target 's direction)</returns>
  618.         int GetAttentionTargetViewDirection(IFunctionHandler* pH);
  619.  
  620.         //! <code>AI.GetAttentionTargetDistance( entityId )</code>
  621.         //! <description>returns the given entity's attention target's distance to the entity.</description>
  622.         //!             <param name="entityId">AI's entity id</param>
  623.         //! <returns>distance to the attention target (nil if no target)</returns>
  624.         int GetAttentionTargetDistance(IFunctionHandler* pH);
  625.  
  626.         //! <code>AI.GetAttentionTargetThreat( entityID )</code>
  627.         int GetAttentionTargetThreat(IFunctionHandler* pH, ScriptHandle entityID);
  628.  
  629.         //! <code>AI.UpTargetPriority( entityId, targetId, increment )</code>
  630.         //! <description>modifies the current entity's target priority for the given target if the given target is among the entity's target list.</description>
  631.         //!             <param name="entityId">AI's entity id</param>
  632.         //!             <param name="targetId">target's entity id</param>
  633.         //!             <param name="increment">value to modify the target's priority</param>
  634.         int UpTargetPriority(IFunctionHandler* pH);
  635.  
  636.         //! <code>AI.DropTarget( entityId, targetId )</code>
  637.         //! <description>Clears the target from the AI's perception handler.</description>
  638.         //!             <param name="entityId">AI's entity id</param>
  639.         //!             <param name="targetId">target's entity id</param>
  640.         int DropTarget(IFunctionHandler* pH);
  641.  
  642.         //! <code>AI.ClearPotentialTargets( entityId )</code>
  643.         //! <description>Clears all the potential targets from the AI's perception handler.</description>
  644.         //!             <param name="entityId">AI's entity id</param>
  645.         int ClearPotentialTargets(IFunctionHandler* pH);
  646.  
  647.         //! <code>AI.SetTempTargetPriority( entityId, priority )</code>
  648.         //! <description>Set the selection priority of the temp target over other potential targets.</description>
  649.         //!             <param name="entityId">AI's entity id</param>
  650.         //!             <param name=" priority">New priority value</param>
  651.         //! <returns>true if updated</returns>
  652.         int SetTempTargetPriority(IFunctionHandler* pH);
  653.  
  654.         //! <code>AI.AddAggressiveTarget( entityId, targetId )</code>
  655.         //! <description>Add the target Id as an aggressive potential target to the entity's list.</description>
  656.         //!             <param name="entityId">AI's entity id</param>
  657.         //!             <param name="targetId">Target to add to the list</param>
  658.         //! <returns>true if updated</returns>
  659.         int AddAggressiveTarget(IFunctionHandler* pH);
  660.  
  661.         //! <code>AI.UpdateTempTarget( entityId, vPos )</code>
  662.         //! <description>Updates the entity's temporary potential target to the given position.</description>
  663.         //!             <param name="entityId">AI's entity id</param>
  664.         //!             <param name="vPos">New position of the temporary target</param>
  665.         //! <returns>true if updated</returns>
  666.         int UpdateTempTarget(IFunctionHandler* pH);
  667.  
  668.         //! <code>AI.ClearTempTarget( entityId )</code>
  669.         //! <description>Removes the entity's temporary potential target, so it is no longer considered for target selection.</description>
  670.         //!             <param name="entityId">AI's entity id</param>
  671.         //! <returns>true if cleared</returns>
  672.         int ClearTempTarget(IFunctionHandler* pH);
  673.  
  674.         //! <code>AI.SetExtraPriority( enemyEntityId, increment )</code>
  675.         //! <description>Set a extra priority value to the entity which is given by enemyEntityId.</description>
  676.         //!             <param name="enemyEntityId">AI's entity id</param>
  677.         //!             <param name="float increment">value to add to the target's priority</param>
  678.         int SetExtraPriority(IFunctionHandler* pH);
  679.  
  680.         //! <code>AI.GetExtraPriority( enemyEntityId )</code>
  681.         //! <description>get an extra priority value to the entity which is given by enemyEntityId.</description>
  682.         //!             <param name="enemyEntityId">AI's entity id</param>
  683.         int GetExtraPriority(IFunctionHandler* pH);
  684.  
  685.         //! <code>AI.GetTargetType(entityId)</code>
  686.         //! <description>Returns the type of current entity's attention target (memory, human, none etc).</description>
  687.         //!             <param name="entityId">AI's entity id</param>
  688.         //! <returns>Target type value (AITARGET_NONE,AITARGET_MEMORY,AITARGET_BEACON,AITARGET_ENEMY etc) -
  689.         //!             see IAgent.h for all definitions of target types.
  690.         //! </returns>
  691.         int GetTargetType(IFunctionHandler* pH);
  692.  
  693.         //! <code>AI.GetTargetSubType(entityId)</code>
  694.         //! <description>Returns the subtype of current entity's attention target.</description>
  695.         //!             <param name="entityId">AI's entity id</param>
  696.         //! <returns>Target subtype value - see IAgent.h for all definitions of target types</returns>
  697.         int GetTargetSubType(IFunctionHandler* pH);
  698.  
  699.         //! <code>AI.RegisterTargetTrack(entityId, configuration, targetLimit, classThreat)</code>
  700.         //! <description>Registers the AI object to use the given target track configuration for target selection.</description>
  701.         //!             <param name="entityId">AI's entity id</param>
  702.         //!             <param name="configuration">Target stimulus configuration to use</param>
  703.         //!             <param name="targetLimit">Number of agents who can target the AI at any given time (0 for infinite)</param>
  704.         //!             <param name="classThreat">(Optional) Initial class threat value for the user</param>
  705.         //! <returns>True if registration was successful. Note that this does nothing if 'ai_TargetTracking' is not set to '2'</returns>
  706.         int RegisterTargetTrack(IFunctionHandler* pH);
  707.  
  708.         //! <code>AI.UnregisterTargetTrack(entityId)</code>
  709.         //! <description>Unregisters the AI object with the target track manager.</description>
  710.         //!             <param name="entityId">AI's entity id</param>
  711.         //! <returns>True if unregistration was successful. Note that this does nothing if 'ai_TargetTracking' is not set to '2'.</returns>
  712.         int UnregisterTargetTrack(IFunctionHandler* pH);
  713.  
  714.         //! <code>AI.SetTargetTrackClassThreat(entityId, classThreat)</code>
  715.         //! <description>Sets the class threat for the entity for target track usage.</description>
  716.         //!             <param name="entityId">AI's entity id</param>
  717.         //!             <param name="classThreat">Class threat value for the user</param>
  718.         int SetTargetTrackClassThreat(IFunctionHandler* pH);
  719.  
  720.         int TriggerCurrentTargetTrackPulse(IFunctionHandler* pH, ScriptHandle entityID, const char* stimulusName,
  721.                                            const char* pulseName);
  722.  
  723.         //! <code>AI.CreateStimulusEvent(entityId, targetId, stimulusName, pData)</code>
  724.         //! <description>Creates a target track stimulus event for the entity using the specified data.</description>
  725.         //!             <param name="ownerId">Owner's entity id (who owns and is receiving the event)</param>
  726.         //!             <param name="targetId">Target's entity id (who sent the event, and becomes owner's perceived target)</param>
  727.         //!             <param name="stimulusName">Name of the stimulus event</param>
  728.         //!             <param name="pData">Data about the event (see TargetTrackHelpers::SStimulusEvent)</param>
  729.         int CreateStimulusEvent(IFunctionHandler* pH, ScriptHandle ownerId, ScriptHandle targetId, const char* stimulusName, SmartScriptTable pData);
  730.         int CreateStimulusEventInRange(IFunctionHandler* pH, ScriptHandle targetId, const char* stimulusName, SmartScriptTable dataScriptTable);
  731.  
  732.         //! <code>AI.SoundEvent(position, radius, threat, interest, entityId)</code>
  733.         //! <description>Generates a sound event in the AI system with the given parameters.</description>
  734.         //!             <param name="position">of the origin of the sound event</param>
  735.         //!             <param name="radius">in which this sound event should be heard</param>
  736.         //!             <param name="threat">value of the sound event </param>
  737.         //!             <param name="interest">value of the sound event</param>
  738.         //!             <param name="entityId">of the entity who generated this sound event</param>
  739.         int SoundEvent(IFunctionHandler* pH);
  740.  
  741.         //! <code>AI.VisualEvent(entityId, targetId)</code>
  742.         //! <description>Generates a visual event in the AI system with the given parameters.</description>
  743.         //!             <param name="entityId">who receives the visual event</param>
  744.         //!             <param name="targetId">who the receiver is seeing</param>
  745.         int VisualEvent(IFunctionHandler* pH);
  746.  
  747.         //! <code>AI.GetSoundPerceptionDescriptor(entityId, soundType, descriptorTable)</code>
  748.         //! <description>Fills descriptorTable with info about how perception works for the entity dealing with soundType.</description>
  749.         //!             <param name="entityId">who to get the info from</param>
  750.         //!             <param name="soundType">what type of sound stimulus to get the info for</param>
  751.         //!             <param name="descriptorTable">where to store the info once retrieved</param>
  752.         //! <returns>True if info was returned</returns>
  753.         int GetSoundPerceptionDescriptor(IFunctionHandler* pH);
  754.  
  755.         //! <code>AI.SetSoundPerceptionDescriptor(entityId, soundType, descriptorTable)</code>
  756.         //! <description>Sets data on how perception works for the entity dealing with soundType.</description>
  757.         //!             <param name="entityId">who to set the info for</param>
  758.         //!             <param name="soundType">what type of sound stimulus to set the info for</param>
  759.         //!             <param name="descriptorTable">info to be set</param>
  760.         //! <returns>True if info was saved</returns>
  761.         int SetSoundPerceptionDescriptor(IFunctionHandler* pH);
  762.  
  763.         //! <code>AI.SetAssesmentMultiplier(AIObjectType, multiplier)</code>
  764.         //! <description>set the assesment multiplier factor for the given AIObject type.</description>
  765.         //!             <param name="AIObjectType">AIObject type; see ScriptBindAI.cpp for a complete list of AIObject types available</param>
  766.         //!             <param name="multiplier">assesment multiplication factor</param>
  767.         int SetAssesmentMultiplier(IFunctionHandler* pH);
  768.  
  769.         //! <code>AI.SetFactionThreatMultiplier(nSpecies, multiplier)</code>
  770.         //! <description>set the threat multiplier factor for the given species (if 0, species is not hostile to any other).</description>
  771.         //!             <param name="factionID: factionID</param>
  772.         //!             <param name="multiplier">Threat multiplication factor</param>
  773.         int SetFactionThreatMultiplier(IFunctionHandler* pH);
  774.  
  775.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  776.         // Reference point script methods
  777.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  778.  
  779.         //! <code>AI.GetRefPointPosition(entityId)</code>
  780.         //! <description>Get the entity's reference point World position.</description>
  781.         //!             <param name="entityId">AI's entity id</param>
  782.         //! <returns>(script)vector (x,y,z) reference point position</returns>
  783.         int GetRefPointPosition(IFunctionHandler* pH);
  784.  
  785.         //! <code>AI.GetRefPointDirection(entityId)</code>
  786.         //! <description>Get the entity's reference point direction.</description>
  787.         //!             <param name="entityId">AI's entity id</param>
  788.         //! <returns>(script)vector (x,y,z) reference point direction</returns>
  789.         int GetRefPointDirection(IFunctionHandler* pH);
  790.  
  791.         //! <code>AI.SetRefPointPosition(entityId, vRefPointPos)</code>
  792.         //! <description>Sets the reference point's World position of an entity</description>
  793.         //!             <param name="entityId">AI's entity id</param>
  794.         //!             <param name="vRefPointPos">(script)vector (x,y,z) value</param>
  795.         int SetRefPointPosition(IFunctionHandler* pH);
  796.  
  797.         //! <code>AI.SetRefPointDirection( vRefPointDir )</code>
  798.         //! <description>Sets the reference point's World position of an entity</description>
  799.         //!             <param name="vRefPointDir">(script)vector (x,y,z) value</param>
  800.         int SetRefPointDirection(IFunctionHandler* pH);
  801.  
  802.         //! <code>AI.SetRefPointRadius(entityId, radius)</code>
  803.         //! <description>Sets the reference point's radius.</description>
  804.         //!             <param name="entityId">AI's entity id</param>
  805.         //!             <param name="radius">the radius to set.</param>
  806.         int SetRefPointRadius(IFunctionHandler* pH);
  807.  
  808.         //! <code>AI.SetRefShapeName(entityId, name)</code>
  809.         //! <description>Sets the reference shape name.</description>
  810.         //!             <param name="entityId">AI's entity id</param>
  811.         //!             <param name="name">the name of the reference shape.</param>
  812.         int SetRefShapeName(IFunctionHandler* pH);
  813.  
  814.         //! <code>AI.GetRefShapeName(entityId)</code>
  815.         //! <returns>reference shape name.</returns>
  816.         //!             <param name="entityId">AI's entity id</param>
  817.         int GetRefShapeName(IFunctionHandler* pH);
  818.  
  819.         int SetVehicleStickTarget(IFunctionHandler* pH);
  820.  
  821.         //! <code>AI.SetTerritoryShapeName(entityId, shapeName)</code>
  822.         //! <description>Sets the territory of the AI Actor.</description>
  823.         //!             <param name="entityId">AI's entity id</param>
  824.         //!             <param name="shapeName">name of the shape to set</param>
  825.         int SetTerritoryShapeName(IFunctionHandler* pH);
  826.  
  827. #ifdef USE_DEPRECATED_AI_CHARACTER_SYSTEM
  828.         //! <code>AI.SetCharacter(entityId, newCharater)</code>
  829.         //! <description>Sets the AI character of the entity.</description>
  830.         //!             <param name="entityId">AI's entity id</param>
  831.         //!             <param name="newCharacter">name of the new character to set.</param>
  832.         int SetCharacter(IFunctionHandler* pH);
  833. #endif
  834.  
  835.         //! <code>AI.SetRefPointAtDefensePos(entityId, point2defend, distance)</code>
  836.         //! <description>Set the entity refpoint position in an intermediate distance between the entity's att target and the given point.</description>
  837.         //!             <param name="entityId">AI's entity id</param>
  838.         //!             <param name="point2defend">point to defend</param>
  839.         //!             <param name="distance">max distance to keep from the point</param>
  840.         int SetRefPointAtDefensePos(IFunctionHandler* pH);
  841.  
  842.         //! <code>AI.SetPathToFollow(entityId, pathName)</code>
  843.         //! <description>Set the name of the path to be used in 'followpath' goal operation.</description>
  844.         //!             <param name="entityId">AI's entity id</param>
  845.         //!             <param name="pathName">(string) name of the path to set to be followed.</param>
  846.         int SetPathToFollow(IFunctionHandler* pH);
  847.  
  848.         //! <code>AI.SetPathAttributeToFollow(entityId, flag)</code>
  849.         //! <description>Set the attribute of the path to be used in 'followpath' goal operation.</description>
  850.         //!             <param name="entityId">AI's entity id</param>
  851.         //!             <param name="flag">.</param>
  852.         int SetPathAttributeToFollow(IFunctionHandler* pH);
  853.  
  854.         //! <code>AI.GetNearestPathOfTypeInRange(entityId, pos, range, type [, devalue, useStartNode])</code>
  855.         //! <description>
  856.         //!             Queries a nearest path of specified type. The type uses same types as anchors and is specified in the path properties.
  857.         //!             The function will only return paths that match the requesters (entityId) navigation caps. The nav type is also
  858.         //!             specified in the path properties.
  859.         //!     </description>
  860.         //!             <param name="entityId">AI's entity id</param>
  861.         //!             <param name="pos">a vector specifying to the point of interest. Path nearest to this position is returned.</param>
  862.         //!             <param name="range">search range. If useStartNode=1, paths whose start point are within this range are returned or
  863.         //!         if useStartNode=0 nearest distance to the path is calculated and compared against the range.</param>
  864.         //!             <param name="type">type of path to return.</param>
  865.         //!             <param name="devalue">(optional) specifies the time the returned path is marked as occupied.</param>
  866.         //!             <param name="useStartNode">(optional) if set to 1 the range check will use distance to the start node on the path,
  867.         //!             else nearest distance to the path is used.</param>
  868.         int GetNearestPathOfTypeInRange(IFunctionHandler* pH);
  869.  
  870.         //! <code>AI.GetTotalLengthOfPath( entityId, pathname )</code>
  871.         //! <returns>a total length of the path</returns>
  872.         //!             <param name="entityId">AI's entity id</param>
  873.         //!             <param name="pathname">designers path name</param>
  874.         int GetTotalLengthOfPath(IFunctionHandler* pH);
  875.  
  876.         //! <code>AI.GetNearestPointOnPath( entityId, pathname, vPos )</code>
  877.         //! <returns> a nearest point on the path from vPos</returns>
  878.         //!             <param name="entityId">AI's entity id</param>
  879.         //!             <param name="pathname">designers path name</param>
  880.         //!             <param name="vPos">.</param>
  881.         int GetNearestPointOnPath(IFunctionHandler* pH);
  882.  
  883.         //! <code>AI.GetPathSegNoOnPath( entityId, pathname, vPos )</code>
  884.         //! <returns>segment ratio ( 0.0 start point 100.0 end point )</returns>
  885.         //!             <param name="entityId">AI's entity id</param>
  886.         //!             <param name="pathname">designer's path name</param>
  887.         //!             <param name="vPos">.</param>
  888.         int GetPathSegNoOnPath(IFunctionHandler* pH);
  889.  
  890.         //! <code>AI.GetPathSegNoOnPath( entityId, pathname, segNo )</code>
  891.         //! <returns>returns point by segment ratio ( 0.0 start point 100.0 end point )</returns>
  892.         //!             <param name="entityId">AI's entity id</param>
  893.         //!             <param name="pathname">designer's path name</param>
  894.         //!             <param name="segNo">segment ratio</param>
  895.         int GetPointOnPathBySegNo(IFunctionHandler* pH);
  896.  
  897.         //! <code>AI.GetPathSegNoOnPath( entityId, pathname )</code>
  898.         //! <returns>returns true if the path is looped</returns>
  899.         //!             <param name="entityId">AI's entity id</param>
  900.         //!             <param name="pathname">designer's path name</param>
  901.         int GetPathLoop(IFunctionHandler* pH);
  902.  
  903.         //! <code>AI.GetPredictedPosAlongPath( entityId, time, retPos )</code>
  904.         //! <description>Gets the agent predicted position along his path at a given time</description>
  905.         //!             <param name="entityId">AI's entity id</param>
  906.         //!             <param name="time">prediction time (sec)</param>
  907.         //!             <param name="retPos">return point value</param>
  908.         //! <returns>true if successful</returns>
  909.         int GetPredictedPosAlongPath(IFunctionHandler* pH);
  910.  
  911.         //! <code>AI.SetPointListToFollow(entityId, pointlist, howmanypoints, bspline [, navtype])</code>
  912.         //! <description>Set a point list for followpath goal op</description>
  913.         //!             <param name="entityId">AI's entity id</param>
  914.         //!             <param name="pointList">should be like below
  915.         //!                                     local   vectors = {
  916.         //!                                             { x = 0.0, y = 0.0, z = 0.0 }, -- vectors[1].(x,y,z)
  917.         //!                                             { x = 0.0, y = 0.0, z = 0.0 }, -- vectors[2].(x,y,z)
  918.         //!                                             { x = 0.0, y = 0.0, z = 0.0 }, -- vectors[3].(x,y,z)
  919.         //!                                             { x = 0.0, y = 0.0, z = 0.0 }, -- vectors[4].(x,y,z)
  920.         //!                                             { x = 0.0, y = 0.0, z = 0.0 }, -- vectors[5].(x,y,z)
  921.         //!                                             { x = 0.0, y = 0.0, z = 0.0 }, -- vectors[6].(x,y,z)
  922.         //!                                             { x = 0.0, y = 0.0, z = 0.0 }, -- vectors[7].(x,y,z)
  923.         //!                                             { x = 0.0, y = 0.0, z = 0.0 }, -- vectors[8].(x,y,z)
  924.         //!                                     }</param>
  925.         //!             <param name="howmanypoints">.</param>
  926.         //!             <param name="bspline">if true, the line is recalcurated by spline interpolation.</param>
  927.         //!             <param name="navtype">(optional) specify a navigation type ( default = IAISystem::NAV_FLIGHT )</param>
  928.         int SetPointListToFollow(IFunctionHandler* pH);
  929.  
  930.         //! <code>AI.CanMoveStraightToPoint(entityId, position)</code>
  931.         //! <returns>true if the entity can move to the specified position in a straight line (no multiple segment path necessary)</returns>
  932.         //!             <param name="entityId">AI's entity id</param>
  933.         //!             <param name="position">the position to check</param>
  934.         //! <returns>true if the position can be reached in a straight line</returns>
  935.         int CanMoveStraightToPoint(IFunctionHandler* pH);
  936.  
  937.         //! <code>AI.GetNearestHidespot(entityId, rangeMin, rangeMax [, center])</code>
  938.         //! <returns>position of a nearest hidepoint within specified range, returns nil if no hidepoint is found.</returns>
  939.         //!             <param name="entityId">AI's entity id</param>
  940.         //!             <param name="rangeMin">specifies the min range where the hidepoints are looked for.</param>
  941.         //!             <param name="rangeMax">specifies the max range where the hidepoints are looked for.</param>
  942.         //!             <param name="centre">(optional) specifies the centre of search. If not specified, the entity position is used.</param>
  943.         int GetNearestHidespot(IFunctionHandler* pH);
  944.  
  945.         //! <code>AI.GetEnclosingGenericShapeOfType(position, type[, checkHeight])</code>
  946.         //! <returns>the name of the first shape that is enclosing the specified point and is of specified type</returns>
  947.         //!             <param name="position">the position to check</param>
  948.         //!             <param name="type">the type of the shapes to check against (uses anchor types).</param>
  949.         //!             <param name="checkHeight">(optional) Default=false, if the flag is set the height of the shape is tested too.
  950.         //!                     The test will check space between the shape.aabb.min.z and shape.aabb.min.z+shape.height.</param>
  951.         int GetEnclosingGenericShapeOfType(IFunctionHandler* pH);
  952.  
  953.         //! <code>AI.IsPointInsideGenericShape(position, shapeName[, checkHeight])</code>
  954.         //! <returns>true if the point is inside the specified shape.</returns>
  955.         //!             <param name="position">the position to check</param>
  956.         //!             <param name="shapeName">the name of the shape to test (returned by AI.GetEnclosingGenericShapeOfType)</param>
  957.         //!             <param name="checkHeight">(optional) Default=false, if the flag is set the height of the shape is tested too.
  958.         //!                     The test will check space between the shape.aabb.min.z and shape.aabb.min.z+shape.height.</param>
  959.         int IsPointInsideGenericShape(IFunctionHandler* pH);
  960.  
  961.         //! <code>AI.ConstrainPointInsideGenericShape(position, shapeName[, checkHeight])</code>
  962.         //! <returns>the nearest point inside specified shape.</returns>
  963.         //!             <param name="position">the position to check</param>
  964.         //!             <param name="shapeName">the name of the shape to use as constraint.</param>
  965.         //!             <param name="checkHeight">(optional) Default=false, if the flag is set the height should be constrained too.</param>
  966.         int ConstrainPointInsideGenericShape(IFunctionHandler* pH);
  967.  
  968.         //! <code>AI.DistanceToGenericShape(position, shapeName[, checkHeight])</code>
  969.         //! <returns>true if the point is inside the specified shape.</returns>
  970.         //!             <param name="position">the position to check</param>
  971.         //!             <param name="shapeName">the name of the shape to test (returned by AI.GetEnclosingGenericShapeOfType)</param>
  972.         //!             <param name="checkHeight">(optional) if the flag is set the height of the shape is tested too.
  973.         //!                     The test will check space between the shape.aabb.min.z and shape.aabb.min.z+shape.height.</param>
  974.         int DistanceToGenericShape(IFunctionHandler* pH);
  975.  
  976.         //! <code>AI.CreateTempGenericShapeBox(center, radius, height, type)</code>
  977.         //! <description>Creates a temporary box shaped generic shape (will be destroyed upon AIsystem reset).</description>
  978.         //! <returns>the name of the shape.</returns>
  979.         //!             <param name="center">the center of the box</param>
  980.         //!             <param name="radius">the extend of the box in x and y directions.</param>
  981.         //!             <param name="height">the height of the box.</param>
  982.         //!             <param name="type">the AIanchor type of the shape.</param>
  983.         int CreateTempGenericShapeBox(IFunctionHandler* pH);
  984.  
  985.         //! <code>AI.GetObjectRadius(entityId)</code>
  986.         //! <returns>the radius of specified AI object.</returns>
  987.         //!             <param name="entityId">AI's entity id</param>
  988.         int GetObjectRadius(IFunctionHandler* pH);
  989.  
  990.         //! <code>AI.GetProbableTargetPosition(entityId)</code>
  991.         //! <returns>the probable target position of the AI.</returns>
  992.         //!             <param name="entityId">AI's entity id</param>
  993.         int GetProbableTargetPosition(IFunctionHandler* pH);
  994.  
  995.         int NotifyReinfDone(IFunctionHandler* pH);
  996.  
  997.         int BehaviorEvent(IFunctionHandler* pH);
  998.  
  999.         int NotifySurpriseEntityAction(IFunctionHandler* pH);
  1000.  
  1001.         int InvalidateHidespot(IFunctionHandler* pH);
  1002.         int EvalHidespot(IFunctionHandler* pH);
  1003.  
  1004.         //! <code>AI.EvalPeek(entityId [, bGetOptimalSide])</code>
  1005.         //! <description>Evaluates if an AI object can peek from his current position.</description>
  1006.         //!             <param name="entityId">AI's entity id</param>
  1007.         //!             <param name="bGetOptimalSide (optional)">If TRUE, and AI object can peek from both sides, will return the
  1008.         //!                     side that best fits where the attention target currently is</param>
  1009.         //! <returns>
  1010.         //!             -1 - don't need to peek
  1011.         //!             0 - cannot peek
  1012.         //!             1 - can peek from left
  1013.         //!             2 - can peek from right
  1014.         //!             3 - can peek from left & right
  1015.         //! </returns>
  1016.         int EvalPeek(IFunctionHandler* pH);
  1017.  
  1018.         //! <code>AI.AddPersonallyHostile(entityID, hostileID)</code>
  1019.         int AddPersonallyHostile(IFunctionHandler* pH, ScriptHandle entityID, ScriptHandle hostileID);
  1020.  
  1021.         //! <code>AI.RemovePersonallyHostile(entityID, hostileID)</code>
  1022.         int RemovePersonallyHostile(IFunctionHandler* pH, ScriptHandle entityID, ScriptHandle hostileID);
  1023.  
  1024.         //! <code>AI.ResetPersonallyHostiles(entityID, hostileID)</code>
  1025.         int ResetPersonallyHostiles(IFunctionHandler* pH, ScriptHandle entityID, ScriptHandle hostileID);
  1026.  
  1027.         //! <code>AI.IsPersonallyHostile(entityID, hostileID)</code>
  1028.         int IsPersonallyHostile(IFunctionHandler* pH, ScriptHandle entityID, ScriptHandle hostileID);
  1029.  
  1030.         //! <code>AI.GetDirectAttackPos(entityId, searchRange, minAttackRange)</code>
  1031.         //! <description>Useful for choosing attack position for RPGs and such.</description>
  1032.         //! <returns>a cover point which can be used to directly attack the attention target, nil if no attack point is available.</returns>
  1033.         //! <remarks>Calling the function is quite heavy since it does raycasting.</remarks>
  1034.         //!             <param name="entityId">AI's entity id</param>
  1035.         //!             <param name="AIAnchorType">Anchor type; see Scripts/AIAnchor.lua for a complete list of Anchor types available</param>
  1036.         //!             <param name="maxDist">search range</param>
  1037.         int GetDirectAnchorPos(IFunctionHandler* pH);
  1038.  
  1039.         int GetGroupAlertness(IFunctionHandler* pH);
  1040.  
  1041.         int GetAlertness(IFunctionHandler* pH);
  1042.  
  1043.         //! <returns>the estimated surrounding navigable space in meters.</returns>
  1044.         int GetEnclosingSpace(IFunctionHandler* pH);
  1045.  
  1046.         int Event(IFunctionHandler* pH);
  1047.  
  1048.         //! <code>AI.GetPotentialTargetCountFromFaction( entityID, name )</code>
  1049.         //! <description>Retrieves the number of potential targets for an entity from a specified factions.</description>
  1050.         //!             <param name="entityId">id handle of entity to match against.</param>
  1051.         //!             <param name="name">name of specified faction.</param>
  1052.         int GetPotentialTargetCountFromFaction(IFunctionHandler* pH, ScriptHandle entityID, const char* factionName);
  1053.  
  1054.         //! <code>AI.GetPotentialTargetCount( entityID )</code>
  1055.         //! <description>Retrieves the number of potential targets for an entity from a specified factions.</description>
  1056.         //!             <param name="entityId">id handle of entity to match against.</param>
  1057.         int GetPotentialTargetCount(IFunctionHandler* pH, ScriptHandle entityID);
  1058.  
  1059.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  1060.         // Formation related functions
  1061.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  1062.  
  1063.         //! <code>AI.CreateFormation( name )</code>
  1064.         //! <description>Creates a formation descriptor and adds a fixed node at 0,0,0 (owner's node).</description>
  1065.         //!             <param name="name">name of the new formation descriptor.</param>
  1066.         int CreateFormation(IFunctionHandler* pH);
  1067.  
  1068.         //! <code>AI.AddFormationPointFixed(name, sightangle, x, y, z [,unit_class])</code>
  1069.         //! <description>Adds a node with a fixed offset to a formation descriptor.</description>
  1070.         //!             <param name="name">name of the formation descriptor</param>
  1071.         //!             <param name="sightangle">angle of sight of the node (-180,180; 0 = the guy looks forward)</param>
  1072.         //!             <param name="x, y, z">offset from formation owner</param>
  1073.         //!             <param name="unit_class">class of soldier (see eSoldierClass definition in IAgent.h)</param>
  1074.         int AddFormationPointFixed(IFunctionHandler* pH);
  1075.  
  1076.         //! <code>AI.AddFormationPoint(name, sightangle, distance, offset, [unit_class [,distanceAlt, offsetAlt]] )</code>
  1077.         //! <description>Adds a follow-type node to a formation descriptor.</description>
  1078.         //!             <param name="name">name of the formation descriptor</param>
  1079.         //!             <param name="sightangle">angle of sight of the node (-180,180; 0 = the guy looks forward)</param>
  1080.         //!             <param name="distance">distance from the formation's owner</param>
  1081.         //!             <param name="offset">X offset along the following line (negative = left, positive = right)</param>
  1082.         //!             <param name="unit_class">class of soldier (see eSoldierClass definition in IAgent.h)</param>
  1083.         //!             <param name="distanceAlt (optional)- alternative distance from the formation owner (if 0, distanceAlt and offsetAlt will be set respectively to distance and offset)</param>
  1084.         //!             <param name="offsetAlt (optional)">alternative X offset</param>
  1085.         int AddFormationPoint(IFunctionHandler* pH);
  1086.  
  1087.         //! <code>AI.AddFormationPoint(name, position )</code>
  1088.         //! <description>Adds a follow-type node to a formation descriptor.</description>
  1089.         //!             <param name="name">name of the formation descriptor</param>
  1090.         //!             <param name="position">point index in the formation (1..N)</param>
  1091.         //! <returns>class of specified formation point (-1 if not found)</returns>
  1092.         int GetFormationPointClass(IFunctionHandler* pH);
  1093.  
  1094.         //! <code>AI.GetFormationPointPosition(entityId, pos)</code>
  1095.         //! <description>Gets the AI's formation point position.</description>
  1096.         //!             <param name="entityId">AI's entity id</param>
  1097.         //!             <param name="pos">return value- position of entity AI's current formation point if there is</param>
  1098.         //! <returns>true if the formation point has been found</returns>
  1099.         int GetFormationPointPosition(IFunctionHandler* pH);
  1100.  
  1101.         //! <code>AI.BeginTrackPattern( patternName, flags, validationRadius, [stateTresholdMin],</code>
  1102.         //              [stateTresholdMax], [globalDeformTreshold], [localDeformTreshold], [exposureMod], [randomRotAng] )
  1103.         //! <example>AI.BeginTrackPattern( "mypattern", AITRACKPAT_VALIDATE_SWEPTSPHERE, 1.0 )</example>
  1104.         //! <description>
  1105.         //!             Begins definition of a new track pattern descriptor. The pattern is created bu calling
  1106.         //!             the AI.AddPatternPoint() and AI.AddPatternBranch() functions, and finalised by calling
  1107.         //!             the AI.EndTrackPattern().
  1108.         //! </description>
  1109.         //!             <param name="patternName">name of the new track pattern descriptor</param>
  1110.         //!             <param name="flags">The functionality flags of the track pattern.
  1111.         //!                     Validation:
  1112.         //!                             The validation method describes how the pattern is validated to fit the physical world.
  1113.         //!                             Should be one of:
  1114.         //!                             AITRACKPAT_VALIDATE_NONE - no validation at all.
  1115.         //!                             AITRACKPAT_VALIDATE_SWEPTSPHERE - validate using swept sphere tests, the spehre radius is validation
  1116.         //!                                     radius plus the entity pass radius.
  1117.         //!                             AITRACKPAT_VALIDATE_RAYCAST - validate using raycasting, the hit position is pulled back by the amount
  1118.         //!                                     of validation radius plus the entity pass radius.
  1119.         //!                     Aligning:
  1120.         //!                             When the pattern is selected to be used the alignment of the patter ncan be changed.
  1121.         //!                             The alignment can be combination of the following. The descriptions are in order they are evaluated.
  1122.         //!                             AITRACKPAT_ALIGN_TO_TARGET - Align the pattern so that the y-axis will
  1123.         //!                                     point towards the target each time it is set. If the agent does not have valid attention target
  1124.         //!                                     at the time the pattern is set the pattern will be aligned to the world.
  1125.         //!                             AITRACKPAT_ALIGN_RANDOM - Align the pattern randonly each time it is set.
  1126.         //!                                     The rotation ranges are set using SetRandomRotation().
  1127.         //!             </param>
  1128.         //!             <param name="validationRadius">the validation radius is added to the entity pass radius when validating
  1129.         //!                             the pattern along the offsets.</param>
  1130.         //!             <param name="stateTresholdMin (optional)">If the state of the pattern is 'enclosed' (high deformation) and
  1131.         //!                             the global deformation < stateTresholdMin, the state becomes exposed. Default 0.35.</param>
  1132.         //!             <param name="stateTresholdMax (optional)">If the state of the pattern is 'exposed' (low deformation) and
  1133.         //!                             the global deformation > stateTresholdMax, the state becomes enclosed. Default 0.4.</param>
  1134.         //!             <param name="globalDeformTreshold (optional)">the deformation of the whole pattern is tracked in range [0..1].
  1135.         //!                             This treshold value can be used to clamp the bottom range, so that values in range [trhd..1] becomes [0..1], default 0.0.</param>
  1136.         //!             <param name="localDeformTreshold (optional)">the deformation of the each node is tracked in range [0..1].
  1137.         //!                             This treshold value can be used to clamp the bottom range, so that values in range [trhd..1] becomes [0..1], default 0.0.</param>
  1138.         //!             <param name="exposureMod (optional)">the exposure modifier allows to take the node exposure (how much it is seen by
  1139.         //!                             the tracked target) into account when branching. The modifier should be in range [-1..1], -1 means to
  1140.         //!                             favor unseen nodes, and 1 means to favor seen, exposed node. Default 0 (no effect).</param>
  1141.         //!             <param name="randomRotAng (optional)">each time the pattern is set, it can be optionally rotated randomly.
  1142.         //!                             This parameter allows to define angles (in degrees) around each axis. The rotation is performed in XYZ order.</param>
  1143.         int BeginTrackPattern(IFunctionHandler* pH);
  1144.  
  1145.         //! <code>AI.AddPatternNode( nodeName, offsetx, offsety, offsetz, flags, [parent], [signalValue] )</code>
  1146.         //! <example>AI.AddPatternNode( "point1", 1.0, 0, 0, AITRACKPAT_NODE_START+AITRACKPAT_NODE_SIGNAL, "root" )</example>
  1147.         //! <description>
  1148.         //!             Adds point to the track pattern. When validating the points test is made from the start position to the end position.
  1149.         //!             Start position is either the pattern origin or in case the parent is provided, the parent position. The end position
  1150.         //!             is either relative offset from the start position or offset from the pattern origin, this is chosen based on the node flag.
  1151.         //!             The offset is clamped to the physical world based on the test method.
  1152.         //!             The points will be evaluated in the same oder they are added to the descriptor, and hte system does not try to correct the
  1153.         //!             evaluation order. In case hierarchies are used (parent name is defined) it is up to the pattern creator to make sure the
  1154.         //!             nodes are created in such order that the parent is added before it is referenced.
  1155.         //! </description>
  1156.         //!             <param name="nodeName">name of the new point, the point names are local to the pattern that is currently being specified.</param>
  1157.         //!             <param name="offsetx, offsety, offsetz">The offset from the start position or from the pattern center, see AITRACKPAT_NODE_ABSOLUTE.</param>
  1158.         //!                             If zero offset is used, the node will become an alias, that is it will not be validated and the parent position and deformation value is used directly.</param>
  1159.         //!             <param name="flags">Defines the node evaluation flags, the flags are as follows and can be combined:
  1160.         //!                             AITRACKPAT_NODE_START - If this flag is set, this node can be used as the first node in the pattern. There can be multiple start nodes. In that case the closest one is chosen.
  1161.         //!                             AITRACKPAT_NODE_ABSOLUTE - If this flag is set, the offset is interpret as an offset from the pattern center, otherwise the offset is offset from the start position.
  1162.         //!                             AITRACKPAT_NODE_SIGNAL - If this flag is set, a signal "OnReachedTrackPatternNode" will be send when the node is reached.
  1163.         //!                             AITRACKPAT_NODE_STOP - If this flag is set, the advancing will be stopped, it can be continue by calling entity:ChangeAIParameter( AIPARAM_TRACKPATTERN_ADVANCE, 1 ).
  1164.         //!                             AITRACKPAT_NODE_DIRBRANCH - The default direction at each pattern node is direction from the node position to the center of the pattern
  1165.         //!                                                                                     If this flag is set, the direction will be average direction to the branch nodes.</param>
  1166.         //!             <param name="parent (optional)">If this parameter is set, the start position is considered to be the parent node position instead of the pattern center.</param>
  1167.         //!             <param name="signalValue (optional)">If the signal flag is set, this value will be passed as signal parameter, it is accessible from the signal handler in data.iValue.</param>
  1168.         int AddPatternNode(IFunctionHandler* pH);
  1169.  
  1170.         //! <code>AI.AddPatternBranch( nodeName, method, branchNode1, branchNode2, ..., branchNodeN  )</code>
  1171.         //!     <example>AI.AddPatternBranch( "point1", AITRACKPAT_CHOOSE_ALWAYS, "point2" )</example>
  1172.         //! <description>
  1173.         //!             Creates a branch pattern at the specified node. When the entity has approached the specified node (nodeName),
  1174.         //!             and it is time to choose a new point, the rules defined by this function will be used to select the new point.
  1175.         //!             This function allows to associate multiple target points and an evaluation rule.
  1176.         //! </description>
  1177.         //!             <param name="nodeName">name of the node to add the branches.</param>
  1178.         //!             <param name="method">The method to choose the next node when the node is reached. Should be one of the following:
  1179.         //!                             AITRACKPAT_CHOOSE_ALWAYS - Chooses on node from the list in linear sequence.
  1180.         //!                             AITRACKPAT_CHOOSE_LESS_DEFORMED - Chooses the least deformed point in the list. Each node is associated with a deformation value
  1181.         //!                                     (percentage) which describes how much it was required to move in order to stay within the physical world. These deformation values
  1182.         //!                                     are summed down to the parent nodes so that deformation at the end of the hierarchy will be caught down the hierarchy.
  1183.         //!                             AITRACKPAT_CHOOSE_RANDOM - Chooses one point in the list randomly.</param>
  1184.         int AddPatternBranch(IFunctionHandler* pH);
  1185.  
  1186.         //! <code>AI.EndTrackPattern()</code>
  1187.         //! <description>
  1188.         //!             Finalizes the track pattern definition. This function should always called to finalize the pattern.
  1189.         //!             Failing to do so will cause erratic behavior.
  1190.         //! </description>
  1191.         int EndTrackPattern(IFunctionHandler* pH);
  1192.  
  1193.         //! <code>AI.ChangeFormation(entityId, name [,scale] )</code>
  1194.         //! <description>Changes the formation descriptor for the current formation of given entity's group (if there is a formation).</description>
  1195.         //!             <param name="entityId">entity id of which group the formation is changed</param>
  1196.         //!             <param name="name">name of the formation descriptor</param>
  1197.         //!             <param name="scale (optional)">scale factor (1 = default)</param>
  1198.         //! <returns>true if the formation change was successful</returns>
  1199.         int ChangeFormation(IFunctionHandler* pH);
  1200.  
  1201.         //! <code>AI.ScaleFormation(entityId, scale)</code>
  1202.         //! <description>changes the scale factor of the given entity's formation (if there is).</description>
  1203.         //!             <param name="entityId">entity id of which group the formation is scaled</param>
  1204.         //!             <param name="scale">scale factor</param>
  1205.         //! <returns>true if the formation scaling was successful</returns>
  1206.         int ScaleFormation(IFunctionHandler* pH);
  1207.  
  1208.         //! <code>AI.SetFormationUpdate(entityId, update)</code>
  1209.         //! <description>
  1210.         //!             Changes the update flag of the given entity's formation (if there is) -
  1211.         //!             the formation is no more updated if the flag is false.
  1212.         //! </description>
  1213.         //!             <param name="entityId">entity id of which group the formation is scaled</param>
  1214.         //!             <param name="update">update flag (true/false)</param>
  1215.         //! <returns>true if the formation update setting was successful</returns>
  1216.         int SetFormationUpdate(IFunctionHandler* pH);
  1217.  
  1218.         //! <code>AI.SetFormationUpdateSight(entityId, range, minTime, maxTime )</code>
  1219.         //! <description>Sets a random angle rotation for the given entity's formation sight directions.</description>
  1220.         //!             <param name="entityId">entity id owner of the formation </param>
  1221.         //!             <param name="range">angle (0,360) of rotation around the default sight direction</param>
  1222.         //!             <param name="minTime (optional)">minimum timespan for changing the direction (default = 2)</param>
  1223.         //!             <param name="maxTime (optional)">minimum timespan for changing the direction (default = minTime)</param>
  1224.         int SetFormationUpdateSight(IFunctionHandler* pH);
  1225.  
  1226.         ////////////////////////////////////////////////////////////////////
  1227.         /// Navigation/pathfind related functions
  1228.         ////////////////////////////////////////////////////////////////////
  1229.  
  1230.         //! <code>AI.GetNavigationType(entityId)</code>
  1231.         //! <description>returns the navigation type value at the specified entity's position, given the entity navigation properties.</description>
  1232.         //!             <param name="entityId">AI's entity id</param>
  1233.         //! <returns>
  1234.         //!             navigation type at the entity's position (NAV_TRIANGULAR,NAV_WAYPOINT_HUMAN,NAV_ROAD,NAV_VOLUME,NAV_WAYPOINT_3DSURFACE,
  1235.         //!             NAV_FLIGHT,NAV_SMARTOBJECT) see IAISystem::ENavigationType definition
  1236.         //! </returns>
  1237.         int GetNavigationType(IFunctionHandler* pH);
  1238.  
  1239.         //! <code>AI.GetDistanceAlongPath(entityId1, entityid2)</code>
  1240.         //! <description>returns the distance between entity1 and entity2, along entity1's path.</description>
  1241.         //!             <param name="entityId1">AI's entity1 id</param>
  1242.         //!             <param name="entityId2">AI's entity2 id</param>
  1243.         //! <returns>distance along entity1 path; distance value would be negative if the entity2 is ahead along the path</returns>
  1244.         int GetDistanceAlongPath(IFunctionHandler* pH);
  1245.  
  1246.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  1247.         // tank/warrior related functions
  1248.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  1249.  
  1250.         //! <code>AI.IsPointInFlightRegion(start, end)</code>
  1251.         //! <description>check if the line is in a Forbidden Region.</description>
  1252.         //!             <param name="start">a vector in format {x,y,z}</param>
  1253.         //!             <param name="end">a vector in format {x,y,z}</param>
  1254.         //! <returns>intersected position or end (if there is no intersection)</returns>
  1255.         int IntersectsForbidden(IFunctionHandler* pH);
  1256.  
  1257.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  1258.         // Helicopter/VTOL related functions
  1259.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  1260.  
  1261.         //Helicopter combat, should be merged with GetAlienApproachParams
  1262.  
  1263.         int GetHeliAdvancePoint(IFunctionHandler* pH);
  1264.  
  1265.         int GetFlyingVehicleFlockingPos(IFunctionHandler* pH);
  1266.  
  1267.         int CheckVehicleColision(IFunctionHandler* pH);
  1268.  
  1269.         int SetForcedNavigation(IFunctionHandler* pH);
  1270.  
  1271.         int SetAdjustPath(IFunctionHandler* pH);
  1272.  
  1273.         //! <code>AI.IsPointInFlightRegion(point)</code>
  1274.         //! <description>Check if the point is in the Flight Region.</description>
  1275.         //!             <param name="point: a vector in format {x,y,z}
  1276.         //! <returns>true if the point is in the Flight Region</returns>
  1277.         int IsPointInFlightRegion(IFunctionHandler* pH);
  1278.  
  1279.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  1280.         // Boat related functions
  1281.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  1282.  
  1283.         //! <code>AI.IsPointInFlightRegion(point)</code>
  1284.         //! <description>Check if the point is in the Flight Region.</description>
  1285.         //!             <param name="point: a vector in format {x,y,z}
  1286.         //! <returns>water level - ground level, values greater than 0 mean there is water.</returns>
  1287.         int IsPointInWaterRegion(IFunctionHandler* pH);
  1288.  
  1289.         ////////////////////////////////////////////////////////////////////
  1290.         /// Miscellaneous
  1291.         ////////////////////////////////////////////////////////////////////
  1292.  
  1293.         //! <code>AI.SetFireMode(entityId, mode)</code>
  1294.         //! <description>Immediately sets firemode.</description>
  1295.         //!             <param name="entityId">AI's entity id</param>
  1296.         //!             <param name="firemode">new firemode</param>
  1297.         int SetFireMode(IFunctionHandler* pH);
  1298.  
  1299.         //! <code>AI.SetMemoryFireType(entityId, type)</code>
  1300.         //! <description>Sets how the puppet handles firing at its memory target.</description>
  1301.         //!             <param name="entityId">AI's entity id</param>
  1302.         //!             <param name="type">Memory fire type (see EMemoryFireType)</param>
  1303.         int SetMemoryFireType(IFunctionHandler* pH);
  1304.  
  1305.         //! <code>AI.GetMemoryFireType(entityId)</code>
  1306.         //! <returns>How the puppet handles firing at its memory target.</returns>
  1307.         //!             <param name="entityId">AI's entity id</param>
  1308.         //! <returns>Memory fire type (see EMemoryFireType)</returns>
  1309.         int GetMemoryFireType(IFunctionHandler* pH);
  1310.  
  1311.         //! <code>AI.ThrowGrenade(entityId, grenadeType, regTargetType)</code>
  1312.         //! <description>Throws a specified grenade at target type without interrupting fire mode.</description>
  1313.         //!             <param name="entityId">AI's entity id</param>
  1314.         //!             <param name="grenadeType">Requested grenade type (see ERequestedGrenadeType)</param>
  1315.         //!             <param name="regTargetType">Who to throw at (see AI_REG_*)</param>
  1316.         int ThrowGrenade(IFunctionHandler* pH);
  1317.  
  1318.         //! <code>AI.EnableCoverFire(entityId, enable)</code>
  1319.         //! <description>Enables/disables fire when the FIREMODE_COVER is selected.</description>
  1320.         //!             <param name="entityId">AI's entity id</param>
  1321.         //!             <param name="enable">boolean</param>
  1322.         int EnableCoverFire(IFunctionHandler* pH);
  1323.  
  1324.         //! <code>AI.EnableFire(entityId, enable)</code>
  1325.         //! <description>Enables/disables fire.</description>
  1326.         //!             <param name="entityId">AI's entity id</param>
  1327.         //!             <param name="enable">boolean</param>
  1328.         int EnableFire(IFunctionHandler* pH);
  1329.  
  1330.         //! <code>AI.IsFireEnabled(entityId)</code>
  1331.         //! <description>Checks if AI is allowed to fire or not.</description>
  1332.         //!             <param name="entityId">AI's entity id</param>
  1333.         //! <returns>True if AI is enabled to fire</returns>
  1334.         int IsFireEnabled(IFunctionHandler* pH);
  1335.  
  1336.         //! <code>AI.CanFireInStance(entityId, stance)</code>
  1337.         //! <returns>true if AI can fire at his target in the given stance at his current position</returns>
  1338.         //!             <param name="entityId">AI's entity id</param>
  1339.         //!             <param name="stance">Stance Id (STANCE_*)</param>
  1340.         int CanFireInStance(IFunctionHandler* pH);
  1341.  
  1342.         //! <code>AI.SetUseSecondaryVehicleWeapon(entityId, bUseSecondary)</code>
  1343.         //! <description>Sets if the AI should use the secondary weapon when firing from a vehicle gunner seat if possible.</description>
  1344.         //!             <param name="entityId">AI's entity id</param>
  1345.         //!             <param name="bUseSecondary">TRUE to use the secondary weapon</param>
  1346.         int SetUseSecondaryVehicleWeapon(IFunctionHandler* pH);
  1347.  
  1348.         //! <description>Assign AgentPathfindingProperties to the given path type.</description>
  1349.         int AssignPFPropertiesToPathType(IFunctionHandler* pH);
  1350.  
  1351.         int AssignPathTypeToSOUser(IFunctionHandler* pH);
  1352.  
  1353.         //! <description>Set agent's pathfinder properties, (normal, road, cover, ....).</description>
  1354.         int SetPFProperties(IFunctionHandler* pH);
  1355.  
  1356.         //! <code>AI.SetPFBlockerRadius(entityId, blocker, radius)</code>
  1357.         //!             <param name="entityId">AI's entity id</param>
  1358.         int SetPFBlockerRadius(IFunctionHandler* pH);
  1359.  
  1360.         int SetRefPointToGrenadeAvoidTarget(IFunctionHandler* pH);
  1361.  
  1362.         //! <code>AI.IsAgentInTargetFOV(entityId, fov)</code>
  1363.         //! <description>Checks if the entity is in the FOV of the attention target.</description>
  1364.         //!             <param name="entityId">AI's entity id.</param>
  1365.         //!             <param name="fov">FOV of the enemy in degrees.</param>
  1366.         //! <returns>true if in the FOV of the attention target else false.</returns>
  1367.         int IsAgentInTargetFOV(IFunctionHandler* pH);
  1368.  
  1369.         //! <code>AI.AgentLookAtPos(entityId, pos)</code>
  1370.         //! <description>Makes the entityId look at certain position.</description>
  1371.         //!             <param name="entityId">AI's entity id.</param>
  1372.         //!             <param name="fov">vec3 to look at</param>
  1373.         int AgentLookAtPos(IFunctionHandler* pH);
  1374.  
  1375.         //! <code>AI.ResetAgentLookAtPos(entityId)</code>
  1376.         //! <description>Makes the entityId resets a previous call to AgentLookAtPos().</description>
  1377.         //!             <param name="entityId">AI's entity id.</param>
  1378.         int ResetAgentLookAtPos(IFunctionHandler* pH);
  1379.  
  1380.         //! <code>AI.IsAgentInAgentFOV(entityId, entityId2)</code>
  1381.         //! <description>Check if the entity2 is within the entity FOV.</description>
  1382.         //!             <param name="entityId">AI's entity who's FOV is checked</param>
  1383.         //!             <param name="entityId2">that's entity is looking for ;)</param>
  1384.         //! <returns>
  1385.         //!             1st value - TRUE if the agent is within the entity FOV
  1386.         //!             2nd value - TRUE if the agent is within the entity's primary FOV or FALSE if within secondary FOV
  1387.         //! </returns>
  1388.         int IsAgentInAgentFOV(IFunctionHandler* pH);
  1389.  
  1390.         //! <code>AI.CreateGroupFormation(entityId, leaderId)</code>
  1391.         //! <description>Creates a group formation with leader (or updates leader).</description>
  1392.         //!             <param name="entityId">AI's entity</param>
  1393.         //!             <param name="leaderId">New leader</param>
  1394.         int CreateGroupFormation(IFunctionHandler* pH);
  1395.  
  1396.         //! <code>AI.SetFormationPosition(entityId, v2RelativePosition )</code>
  1397.         //! <description>Sets the Relative position inside the formation.</description>
  1398.         //!             <param name="entityId">AI's entity</param>
  1399.         //!             <param name="v2RelativePosition">Table with format {x,y} storing the new relative position</param>
  1400.         int SetFormationPosition(IFunctionHandler* pH);
  1401.  
  1402.         //! <code>AI.SetFormationLookingPoint(entityId, v3RelativePosition )</code>
  1403.         //! <description>Sets the Relative looking point position inside the formation.</description>
  1404.         //!             <param name="entityId">AI's entity</param>
  1405.         //!             <param name="v3RelativePosition">Table with format {x,y,z} storing the new relative looking point</param>
  1406.         int SetFormationLookingPoint(IFunctionHandler* pH);
  1407.  
  1408.         //! <code>AI.SetFormationAngleThreshold(entityId, fAngleThreshold )</code>
  1409.         //! <description>Sets the Relative position inside the formation.</description>
  1410.         //!             <param name="entityId">AI's entity</param>
  1411.         //!             <param name="fAngleThreshold">New Leader orientation angle threshold in degrees to recal position</param>
  1412.         int SetFormationAngleThreshold(IFunctionHandler* pH);
  1413.  
  1414.         //! <code>AI.GetFormationPosition(entityId)</code>
  1415.         //! <description>Gets the Relative position inside the formation.</description>
  1416.         //!             <param name="entityId">AI's entity</param>
  1417.         //! <returns>v3 - Table with format {x,y,z} storing the relative position</returns>
  1418.         int GetFormationPosition(IFunctionHandler* pH);
  1419.  
  1420.         //! <code>AI.GetFormationLookingPoint(entityId)</code>
  1421.         //! <description>Gets the looking point position inside the formation.</description>
  1422.         //!             <param name="entityId">AI's entity</param>
  1423.         //! <returns>v3 - Table with format {x,y,z} storing the looking point position</returns>
  1424.         int GetFormationLookingPoint(IFunctionHandler* pH);
  1425.  
  1426.         int AutoDisable(IFunctionHandler* pH);
  1427.  
  1428.         //! <description>Creates new combat class.</description>
  1429.         int AddCombatClass(IFunctionHandler* pH);
  1430.  
  1431.         int Animation(IFunctionHandler* pH);
  1432.  
  1433.         //! <code>AI.SetAnimationTag(entityId, tagName)</code>
  1434.         //!             <param name="entityId">AI's entity</param>
  1435.         //!             <param name="tagName">.</param>
  1436.         int SetAnimationTag(IFunctionHandler* pH, ScriptHandle entityID, const char* tagName);
  1437.  
  1438.         //! <code>AI.ClearAnimationTag(entityId, tagName)</code>
  1439.         //!             <param name="entityId">AI's entity</param>
  1440.         //!             <param name="tagName">.</param>
  1441.         int ClearAnimationTag(IFunctionHandler* pH, ScriptHandle entityID, const char* tagName);
  1442.  
  1443.         //int GetClosestPointToOBB(IFunctionHandler *pH);
  1444.  
  1445.         //! <code>AI.GetStance(entityId)</code>
  1446.         //! <description>Get the given entity's stance.</description>
  1447.         //!             <param name="entityId">AI's entity id</param>
  1448.         //! <returns>entity stance (STANCE_*)</returns>
  1449.         int GetStance(IFunctionHandler* pH);
  1450.  
  1451.         //! <code>AI.SetStance(entityId, stance)</code>
  1452.         //! <description>Set the given entity's stance.</description>
  1453.         //!             <param name="entityId">AI's entity id</param>
  1454.         //!             <param name="stance">stance value (STANCE_*)</param>
  1455.         int SetStance(IFunctionHandler* pH);
  1456.  
  1457.         //! <code>AI.SetMovementContext(entityId, context)</code>
  1458.         //! <description>Set the given entity's movement context.</description>
  1459.         //!             <param name="entityId">AI's entity id</param>
  1460.         //!             <param name="context">context value </param>
  1461.         int SetMovementContext(IFunctionHandler* pH, ScriptHandle entityId, int context);
  1462.  
  1463.         //! <code>AI.ResetMovementContext(entityId)</code>
  1464.         //! <description>Reset the given entity's movement context.</description>
  1465.         //!             <param name="entityId">AI's entity id</param>
  1466.         //!             <param name="context">context value</param>
  1467.         int ClearMovementContext(IFunctionHandler* pH, ScriptHandle entityId, int context);
  1468.  
  1469.         //! <code>AI.SetPostures(entityId, postures)</code>
  1470.         //! <description>Set the given entity's postures.</description>
  1471.         //!             <param name="entityId">AI's entity id</param>
  1472.         //!             <param name="postures">.</param>
  1473.         int SetPostures(IFunctionHandler* pH, ScriptHandle entityId, SmartScriptTable postures);
  1474.  
  1475.         //! <code>AI.SetPosturePriority(entityId, postureName, priority)</code>
  1476.         //! <description>Set the given entity's posture priority.</description>
  1477.         int SetPosturePriority(IFunctionHandler* pH, ScriptHandle entityId, const char* postureName, float priority);
  1478.  
  1479.         //! <code>AI.GetPosturePriority(entityId, postureName)</code>
  1480.         //! <description>Set the given entity's posture priority.</description>
  1481.         int GetPosturePriority(IFunctionHandler* pH, ScriptHandle entityId, const char* postureName);
  1482.  
  1483.         //! <code>AI.IsMoving(entityId)</code>
  1484.         //! <description>Returns true if the agent desires to move.</description>
  1485.         //!             <param name="entityId">AI's entity id</param>
  1486.         int IsMoving(IFunctionHandler* pH);
  1487.  
  1488.         //! <code>AI.RegisterDamageRegion(entityId, radius)</code>
  1489.         //! <description>
  1490.         //!             Register a spherical region that causes damage (so should be avoided in pathfinding).
  1491.         //!             Owner entity position is used as region center. Can be called multiple times, will just move
  1492.         //!             update region position
  1493.         //! </description>
  1494.         //!             <param name="entityId">owner entity id.</param>
  1495.         //!             <param name="radius">If radius <= 0 then the region is disabled</param>
  1496.         int RegisterDamageRegion(IFunctionHandler* pH);
  1497.  
  1498.         //! <code>AI.GetBiasedDirection(entityId)</code>
  1499.         //! <description>Get biased direction of certain point.</description>
  1500.         //!             <param name="entityId">AI's entity
  1501.         int GetBiasedDirection(IFunctionHandler* pH);
  1502.  
  1503.         //! <code>AI.SetAttentiontarget(entityId, targetId)</code>
  1504.         //! <description>Set a new attention target.</description>
  1505.         //!             <param name="entityId">AI's entity</param>
  1506.         //!             <param name="targetId">target's id</param>
  1507.         int SetAttentiontarget(IFunctionHandler* pH);
  1508.  
  1509.         //! <code>AI.FindStandbySpotInShape(centerPos, targetPos, anchorType)</code>
  1510.         int FindStandbySpotInShape(IFunctionHandler* pH);
  1511.  
  1512.         //! <code>AI.FindStandbySpotInSphere(centerPos, targetPos, anchorType)</code>
  1513.         int FindStandbySpotInSphere(IFunctionHandler* pH);
  1514.  
  1515.         //! <code>AI.CanMelee(entityId)</code>
  1516.         //! <description>returns 1 if the AI is able to do melee attack.</description>
  1517.         //!             <param name="entityId">AI's entity id</param>
  1518.         int CanMelee(IFunctionHandler* pH);
  1519.  
  1520.         //! <code>AI.CheckMeleeDamage(entityId, targetId, radius, minheight, maxheight, angle)</code>
  1521.         //! <description>returns 1 if the AI performing melee is actually hitting target.</description>
  1522.         //!             <param name="entityId">AI's entity id</param>
  1523.         //!             <param name="targetId">AI's target entity id</param>
  1524.         //!             <param name="radius">max distance in 2d to target</param>
  1525.         //!             <param name="minheight">min distance in height</param>
  1526.         //!             <param name="maxheight">max distance in height</param>
  1527.         //!             <param name="angle">FOV to include target</param>
  1528.         //! <returns>(distance,angle) pair between entity and target (degrees) if melee is possible, nil otherwise</returns>
  1529.         int CheckMeleeDamage(IFunctionHandler* pH);
  1530.  
  1531.         //! <code>AI.GetDirLabelToPoint(entityId, point)</code>
  1532.         //! <description>Returns a direction label (front=0, back=1, left=2, right_3, above=4, -1=invalid) to the specified point.</description>
  1533.         //!             <param name="entityId">AI's entity id</param>
  1534.         //!             <param name="point">point to evaluate.</param>
  1535.         int GetDirLabelToPoint(IFunctionHandler* pH);
  1536.  
  1537.         //! <code>AI.DebugReportHitDamage(pVictimEntity, pShooterEntity)</code>
  1538.         //!             <param name="pVictimEntity">Victim ID.</param>
  1539.         //!             <param name="pShooterEntity">Shooter ID.</param>
  1540.         //! <description>Creates a debug report for the hit damage.</description>
  1541.         int DebugReportHitDamage(IFunctionHandler* pH);
  1542.  
  1543.         //! <code>AI.ProcessBalancedDamage(pShooterEntity, pTargetEntity, damage, damageType)</code>
  1544.         //!             <param name="pShooterEntity">Shooter ID.</param>
  1545.         //!             <param name="pTargetEntity">Target ID.</param>
  1546.         //!             <param name="damage">Hit damage.</param>
  1547.         //!             <param name="damageType">Hit damage type.</param>
  1548.         //! <description>Processes balanced damage.</description>
  1549.         int ProcessBalancedDamage(IFunctionHandler* pH);
  1550.  
  1551.         //! <code>AI.SetRefpointToAnchor(entityId, rangeMin, rangeMax, findType, findMethod)</code>
  1552.         //!             <param name="entityId">AI's entity ID.</param>
  1553.         //!             <param name="rangeMin">Minimum range.</param>
  1554.         //!             <param name="rangeMax">Maximum range.</param>
  1555.         //!             <param name="findType">Finding type.</param>
  1556.         //!             <param name="findMethod">Finding method.</param>
  1557.         //! <description>Sets a reference point to an anchor.</description>
  1558.         int SetRefpointToAnchor(IFunctionHandler* pH);
  1559.  
  1560.         //! <code>AI.SetRefpointToPunchableObject(entityId, range)</code>
  1561.         //!             <param name="entityId">AI's entity ID.</param>
  1562.         //!             <param name="range">Range for the punchable object.</param>
  1563.         //! <description>Sets the reference point to the punchable object.</description>
  1564.         int SetRefpointToPunchableObject(IFunctionHandler* pH);
  1565.  
  1566.         //! <code>AI.MeleePunchableObject(entityId, objectId, origPos)</code>
  1567.         //!             <param name="entityId">AI's entity ID.</param>
  1568.         //!             <param name="objectId">Object ID.</param>
  1569.         //!             <param name="origPos    ">Position of the melee punchable object</param>
  1570.         int MeleePunchableObject(IFunctionHandler* pH);
  1571.  
  1572.         //! <code>AI.IsPunchableObjectValid(userId, objectId, origPos)</code>
  1573.         //!             <param name="userId">User ID.</param>
  1574.         //!             <param name="objectId">Object ID.</param>
  1575.         //!             <param name="origPos">Object position in the world.</param>
  1576.         //! <description>Checks if a punchable object is valid.</description>
  1577.         int IsPunchableObjectValid(IFunctionHandler* pH);
  1578.  
  1579.         //! <code>AI.PlayReadabilitySound(entityId, soundName)</code>
  1580.         //! <description>Plays readability sound on the AI agent. This call does not do any filtering like playing readability using signals.</description>
  1581.         //!             <param name="entityId">AI's entity id</param>
  1582.         //!             <param name="soundName">the name of the readability sound signal to play</param>
  1583.         //!             <param name="stopPreviousSounds (Optional)">TRUE if any currently playing readability should be stopped in favor of this one</param>
  1584.         //!             <param name="responseDelayMin (Optional)">Minimum (or exact, if no maximum) delay for the Response readability to play</param>
  1585.         //!             <param name="repsonseDelayMax (Optional)">Maximum delay for the Response readability to play</param>
  1586.         int PlayReadabilitySound(IFunctionHandler* pH);
  1587.  
  1588.         //! <code>AI.PlayCommunication(entityId, commName, channelName[, targetId] [, targetPos])</code>
  1589.         //! <description>Plays communication on the AI agent.</description>
  1590.         //!             <param name="entityId">AI's entity id</param>
  1591.         //!             <param name="commName">The name of the communication to play</param>
  1592.         //!             <param name="channelName">The name of the channel where the communication will play</param>
  1593.         int PlayCommunication(IFunctionHandler* pH, ScriptHandle entityId, const char* commName, const char* channelName,
  1594.                               float contextExpiry);
  1595.  
  1596.         //! <code>AI.StopCommunication(playID)</code>
  1597.         //! <description>Stops given communication.</description>
  1598.         //!             <param name="playID">The id of the communication to stop.</param>
  1599.         int StopCommunication(IFunctionHandler* pH, ScriptHandle playID);
  1600.  
  1601.         //! <code>AI.EnableWeaponAccessory(entityId, accessory, state)</code>
  1602.         //! <description>Enables or disables certain weapon accessory usage.</description>
  1603.         //!             <param name="entityId">AI's entity id</param>
  1604.         //!             <param name="accessory">enum of the accessory to enable (see EAIWeaponAccessories)</param>
  1605.         //!             <param name="state">true/false to enable/disable</param>
  1606.         int EnableWeaponAccessory(IFunctionHandler* pH);
  1607.  
  1608.         // AIHandler calls this function to replace the OnPlayerSeen signal
  1609.         /*      static const char* GetCustomOnSeenSignal( int iCombatClass )
  1610.            {
  1611.             if ( iCombatClass < 0 || iCombatClass >= m_CustomOnSeenSignals.size() )
  1612.               return "OnPlayerSeen";
  1613.             const char* result = m_CustomOnSeenSignals[ iCombatClass ];
  1614.             return *result ? result : "OnPlayerSeen";
  1615.            }*/
  1616.  
  1617.         //! <code>AI.RegisterInterestingEntity(entityId, baseInterest, category, aiAction)</code>
  1618.         //! <description>Registers the entity with the interest system. Any errors go to the error log.</description>
  1619.         //!             <param name="entityId">AI's entity id</param>
  1620.         //! <returns>
  1621.         //!             true - if a valid update was performed
  1622.         //!             nil - if not (Interest system is disabled, parameters not valid, etc)
  1623.         //! </returns>
  1624.         int RegisterInterestingEntity(IFunctionHandler* pH, ScriptHandle entityId, float radius, float baseInterest, const char* actionName, Vec3 offset, float pause, int shared);
  1625.  
  1626.         //! <code>AI.UnregisterInterestingEntity(entityId)</code>
  1627.         //! <description>Unregisters the entity with the interest system. Any errors go to the error log.</description>
  1628.         //!             <param name="entityId">AI's entity</param>
  1629.         int UnregisterInterestingEntity(IFunctionHandler* pH, ScriptHandle entityId);
  1630.  
  1631.         //! <code>AI.RegisterInterestedActor(entityId, fInterestFilter, fAngleInDegrees)</code>
  1632.         //! <description>Registers the interested actor with the interest system. Any errors go to the error log.</description>
  1633.         //!             <param name="entityId">AI's entity</param>
  1634.         //! <returns>
  1635.         //!             true - if a valid update was performed
  1636.         //!             nil - if not (Interest system is disabled, parameters not valid, etc)
  1637.         //! </returns>
  1638.         int RegisterInterestedActor(IFunctionHandler* pH, ScriptHandle entityId, float fInterestFilter, float fAngleInDegrees);
  1639.  
  1640.         //! <code>AI.UnregisterInterestedActor(entityId)</code>
  1641.         //! <description>Unregisters the entity with the interest system. Any errors go to the error log.</description>
  1642.         //!             <param name="entityId">AI's entity id</param>
  1643.         int UnregisterInterestedActor(IFunctionHandler* pH, ScriptHandle entityId);
  1644.  
  1645.         //! <code>AI.IsCoverCompromised(entityId)</code>
  1646.         //!             <param name="entityId">AI's entity</param>
  1647.         //! <returns>
  1648.         //!             true - Cover is not good anymore
  1649.         //!             nil - if not
  1650.         //! </returns>
  1651.         int IsCoverCompromised(IFunctionHandler* pH);
  1652.  
  1653.         //! <code>AI.SetCoverCompromised(entityId)</code>
  1654.         //!             <param name="entityId">AI's entity</param>
  1655.         int SetCoverCompromised(IFunctionHandler* pH);
  1656.  
  1657.         //! <code>AI.IsTakingCover(entityId, [distanceThreshold])</code>
  1658.         //!             <param name="entityId">AI's entity</param>
  1659.         //!             <param name="distanceThreshold">(optional) distance over which if the agent is running to cover, he won't be considered as taking cover</param>
  1660.         //! <returns>
  1661.         //!             true - Agent is either in cover or running to cover
  1662.         //!             nil - if not
  1663.         //! </returns>
  1664.         int IsTakingCover(IFunctionHandler* pH);
  1665.  
  1666.         //! <code>AI.IsMovingInCover(entityId)</code>
  1667.         //!             <param name="entityId">AI's entity</param>
  1668.         //! <returns>
  1669.         //!             true - Agent is moving in cover
  1670.         //!             nil - if not
  1671.         //! </returns>
  1672.         int IsMovingInCover(IFunctionHandler* pH);
  1673.  
  1674.         //! <code>AI.IsMovingToCover(entityId)</code>
  1675.         //!             <param name="entityId">AI's entity</param>
  1676.         //! <returns></returns>
  1677.         //!             true - Agent is running to cover
  1678.         //!             nil - if not
  1679.         //! </returns>
  1680.         int IsMovingToCover(IFunctionHandler* pH);
  1681.  
  1682.         //! <code>AI.IsInCover(entityId)</code>
  1683.         //! <returns></returns>
  1684.         //!             true - if AI is using cover
  1685.         //!             nil - if not
  1686.         //! </returns>
  1687.         int IsInCover(IFunctionHandler* pH);
  1688.  
  1689.         //! <code>AI.SetInCover(entityId, inCover)</code>
  1690.         //!             <param name="entityId">AI's entity</param>
  1691.         //!             <param name="inCover">if the AI should be set to be in cover or not</param>
  1692.         int SetInCover(IFunctionHandler* pH);
  1693.  
  1694.         //! <code>AI.IsOutOfAmmo(entityId)</code>
  1695.         //!             <param name="entityId">AI's entity</param>
  1696.         //! <returns>
  1697.         //!             true - Entity is out of ammo
  1698.         //!             nil - if not
  1699.         //! </returns>
  1700.         int IsOutOfAmmo(IFunctionHandler* pH);
  1701.  
  1702.         //! <code>AI.IsLowOnAmmo(entityId)</code>
  1703.         //!             <param name="entityId">AI's entity</param>
  1704.         //!             <param name="threshold">the ammo percentage threshold</param>
  1705.         int IsLowOnAmmo(IFunctionHandler* pH);
  1706.  
  1707.         //! <code>AI.ResetAgentState(entityId,stateLabel)</code>
  1708.         //! <description>Resets a particular aspect of the agent's state, such as "lean". Intended to keep these hacky concepts together.</description>
  1709.         //!             <param name="entityId">AI's entity</param>
  1710.         //!             <param name="stateLabel">string describing the state that must be reset to default</param>
  1711.         //! <returns>nil</returns>
  1712.         int ResetAgentState(IFunctionHandler* pH, ScriptHandle entityId, const char* stateLabel);
  1713.  
  1714.         //! <code>AI.RegisterTacticalPointQuery( querySpecTable )</code>
  1715.         //! <description>Get a query ID for the given tactical point query.</description>
  1716.         //!             <param name="querySpecTable">table specifying the query (a mini-language - see Tactical Point System docs elsewhere)</param>
  1717.         //! <returns>
  1718.         //!             > 0 - If the query was parsed successfully
  1719.         //!             0 - Otherwise
  1720.         //! </returns>
  1721.         int RegisterTacticalPointQuery(IFunctionHandler* pH);
  1722.  
  1723.         //! <code>AI.GetTacticalPoints( entityId, tacPointSpec, point )</code>
  1724.         //! <description>Get a point matching a description, related to an entity. Format of a point is: { x,y,z }.</description>
  1725.         //!             <param name="entityId">AI's entity</param>
  1726.         //!             <param name="tacPointSpec">table specifying the points required</param>
  1727.         //!             <param name="point">a table put coordinates of point found</param>
  1728.         //! <returns>
  1729.         //!             true - If a valid point was found
  1730.         //!             false - Otherwise
  1731.         //! </returns>
  1732.         int GetTacticalPoints(IFunctionHandler* pH);
  1733.  
  1734.         //! <code>AI2.DestroyAllTPSQueries()</code>
  1735.         //! <description>Destroys all the tactical point system queries.</description>
  1736.         int DestroyAllTPSQueries(IFunctionHandler* pH);
  1737.  
  1738.         //! <code>AI.GetObjectBlackBoard( entity )</code>
  1739.         //! <description>retrieves given object's black board (a Lua table).</description>
  1740.         //!             <param name="entityId or entityName">some kind of AI entity's identifier</param>
  1741.         //! <returns>
  1742.         //!             black board - if there was one
  1743.         //!             nil - Otherwise
  1744.         //! </returns>
  1745.         int GetObjectBlackBoard(IFunctionHandler* pH);
  1746.  
  1747.         //! <code>AI.GetBehaviorBlackBoard( entity )</code>
  1748.         //! <description>retrieves given AIActor current behaviour's black board (a Lua table).</description>
  1749.         //!             <param name="entityId or entityName">some kind of AIActors's identifier</param>
  1750.         //! <returns>
  1751.         //!             black board - if there was one
  1752.         //!             nil - Otherwise
  1753.         //! </returns>
  1754.         int GetBehaviorBlackBoard(IFunctionHandler* pH);
  1755.  
  1756.         //! <code>AI.SetBehaviorVariable( entity, variableName, value )</code>
  1757.         //! <description>Sets a behaviour variable for the specified actor.</description>
  1758.         int SetBehaviorVariable(IFunctionHandler* pH, ScriptHandle entityId, const char* variableName, bool value);
  1759.  
  1760.         //! <code>AI.GetBehaviorVariable( entity, variableName, value )</code>
  1761.         //! <description>Returns a behavior variable for the specified actor.</description>
  1762.         int GetBehaviorVariable(IFunctionHandler* pH, ScriptHandle entityId, const char* variableName);
  1763.  
  1764.         //! <code>AI.ParseTables( firstTable,parseMovementAbility,pH,aiParams,updateAlways )</code>
  1765.         //!             <param name="firstTable">Properties table.</param>
  1766.         //!             <param name="parseMovementAbility">True to parse movement ability, false otherwise.</param>
  1767.         //!             <param name="aiParams">AI parameters.</param>
  1768.         //!             <param name="updateAlways">.</param>
  1769.         bool ParseTables(int firstTable, bool parseMovementAbility, IFunctionHandler* pH, AIObjectParams& aiParams, bool& updateAlways);
  1770.  
  1771.         //! <code>AI.GoTo(entityId, vDestination)</code>
  1772.         //! <description>This function is intended to allow AI Actor (the entity) go to the specified destination.</description>
  1773.         //!             <param name="entityId">AI's entity</param>
  1774.         //!             <param name="vDestination">.</param>
  1775.         int GoTo(IFunctionHandler* pH);
  1776.  
  1777.         //! <code>AI.SetSpeed(entityId, urgency)</code>
  1778.         //! <description>This function allows the user to override the entity's current speed (urgency).</description>
  1779.         //!             <param name="entityId">AI's entity</param>
  1780.         //!             <param name="urgency">float value specifying the movement urgency (see AgentMovementSpeeds::EAgentMovementUrgency)</param>
  1781.         int SetSpeed(IFunctionHandler* pH);
  1782.  
  1783.         //! <code>AI.SetEntitySpeedRange( userEntityId, urgency, defaultSpeed, minSpeed, maxSpeed, stance = all)</code>
  1784.         //! <description>This function allows the user to override the entity's speed range for the given urgency.</description>
  1785.         //!             <param name="usedEntityId">entity id of the user for which its last used smart object is needed</param>
  1786.         //!             <param name="urgency">integer value specifying the movement urgency (see AgentMovementSpeeds::EAgentMovementUrgency)</param>
  1787.         //!             <param name="defaultSpeed">floating point value specifying the default speed</param>
  1788.         //!             <param name="minSpeed">floating point value specifying the min speed</param>
  1789.         //!             <param name="maxSpeedfloating point value specifying the max speed</param>
  1790.         //!             <param name="stance">optional parameter specifying the stance for which the range is set. default is all (see AgentMovementSpeeds::EAgentMovementStance)</param>
  1791.         //! <returns>true if the operation was successful and false otherwise</returns>
  1792.         int SetEntitySpeedRange(IFunctionHandler* pH);
  1793.  
  1794.         //! <code>AI.SetAlarmed( entityId )</code>
  1795.         //! <description>This function sets the entity to be "perception alarmed".</description>
  1796.         int SetAlarmed(IFunctionHandler* pH);
  1797.  
  1798.         //! <code>AI.LoadBehaviors( folderName, extension, globalEnv)</code>
  1799.         int LoadBehaviors(IFunctionHandler* pH, const char* folderName, const char* extension);
  1800.  
  1801. #ifdef USE_DEPRECATED_AI_CHARACTER_SYSTEM
  1802.         //! <code>AI.LoadCharacters(folderName, tbl)</code>
  1803.         int LoadCharacters(IFunctionHandler* pH, const char* folderName, SmartScriptTable tbl);
  1804. #endif
  1805.  
  1806.         //! <code>AI.IsLowHealthPauseActive( entityID )</code>
  1807.         int IsLowHealthPauseActive(IFunctionHandler* pH, ScriptHandle entityID);
  1808.  
  1809.         //! <code>AI.GetPreviousBehaviorName( entityID )</code>
  1810.         int GetPreviousBehaviorName(IFunctionHandler* pH, ScriptHandle entityID);
  1811.  
  1812.         //! <code>AI.SetContinuousMotion( entityID, continuousMotion )</code>
  1813.         int SetContinuousMotion(IFunctionHandler* pH, ScriptHandle entityID, bool continuousMotion);
  1814.  
  1815.         //! <code>AI.GetPeakThreatLevel( entityID )</code>
  1816.         int GetPeakThreatLevel(IFunctionHandler* pH, ScriptHandle entityID);
  1817.  
  1818.         //! <code>AI.GetPeakThreatType( entityID )</code>
  1819.         int GetPeakThreatType(IFunctionHandler* pH, ScriptHandle entityID);
  1820.  
  1821.         //! <code>AI.GetPreviousPeakThreatLevel( entityID )</code>
  1822.         int GetPreviousPeakThreatLevel(IFunctionHandler* pH, ScriptHandle entityID);
  1823.  
  1824.         //! <code>AI.GetPreviousPeakThreatType( entityID )</code>
  1825.         int GetPreviousPeakThreatType(IFunctionHandler* pH, ScriptHandle entityID);
  1826.  
  1827.         //! <code>AI.CheckForFriendlyAgentsAroundPoint( entityID, point, radius)</code>
  1828.         int CheckForFriendlyAgentsAroundPoint(IFunctionHandler* pH, ScriptHandle entityID, Vec3 point, float radius);
  1829.  
  1830.         //! <code>AI.EnableUpdateLookTarget(entityID, bEnable)</code>
  1831.         int EnableUpdateLookTarget(IFunctionHandler* pH, ScriptHandle entityID, bool bEnable);
  1832.  
  1833.         //! <code>AI.SetBehaviorTreeEvaluationEnabled(entityID, enable)</code>
  1834.         int SetBehaviorTreeEvaluationEnabled(IFunctionHandler* pH, ScriptHandle entityID, bool enable);
  1835.  
  1836.         //! <code>AI.UpdateGlobalPerceptionScale(visualScale, audioScale, [filterType], [faction])</code>
  1837.         int UpdateGlobalPerceptionScale(IFunctionHandler* pH, float visualScale, float audioScale);
  1838.  
  1839.         //! <code>AI.QueueBubbleMessage(entityID, message, flags)</code>
  1840.         int QueueBubbleMessage(IFunctionHandler* pH, ScriptHandle entityID, const char* message);
  1841.  
  1842.         //! <code>AI.SequenceBehaviorReady(entityId)</code>
  1843.         int SequenceBehaviorReady(IFunctionHandler* pH, ScriptHandle entityId);
  1844.  
  1845.         //! <code>AI.SequenceInterruptibleBehaviorLeft(entityId)</code>
  1846.         int SequenceInterruptibleBehaviorLeft(IFunctionHandler* pH, ScriptHandle entityId);
  1847.  
  1848.         //! <code>AI.SequenceNonInterruptibleBehaviorLeft(entityId)</code>
  1849.         int SequenceNonInterruptibleBehaviorLeft(IFunctionHandler* pH, ScriptHandle entityId);
  1850.  
  1851.         //! <code>AI.SetCollisionAvoidanceRadiusIncrement(entityId, radius)</code>
  1852.         int SetCollisionAvoidanceRadiusIncrement(IFunctionHandler* pH, ScriptHandle entityId, float radius);
  1853.  
  1854.         //! <code>AI.RequestToStopMovement(entityId)</code>
  1855.         int RequestToStopMovement(IFunctionHandler* pH, ScriptHandle entityId);
  1856.  
  1857.         //! <code>AI.GetDistanceToClosestGroupMember(entityId)</code>
  1858.         int GetDistanceToClosestGroupMember(IFunctionHandler* pH, ScriptHandle entityId);
  1859.  
  1860.         //! <code>AI.IsAimReady(entityIdHandle)</code>
  1861.         int IsAimReady(IFunctionHandler* pH, ScriptHandle entityIdHandle);
  1862.  
  1863.         //! <code>AI.LockBodyTurn(entityID, bAllowLowerBodyToTurn)</code>
  1864.         //!             <param name="entityId">entity id of the agent you want to set the look style to</param>
  1865.         //!             <param name="bAllowLowerBodyToTurn">true if you want to allow the turning movement of the body, false otherwise</param>
  1866.         int AllowLowerBodyToTurn(IFunctionHandler* pH, ScriptHandle entityID, bool bAllowLowerBodyToTurn);
  1867.  
  1868.         //! <code>AI.GetGroupScopeUserCount(entityID, bAllowLowerBodyToTurn)</code>
  1869.         //!             <param name="entityId">entity id of the agent you want to access the group scope for.</param>
  1870.         //!             <param name="groupScopeName">the group scope name.</param>
  1871.         //! <returns>The amount of actors inside the group scope (>= 0) or nil if an error occurred.</returns>
  1872.         int GetGroupScopeUserCount(IFunctionHandler* pH, ScriptHandle entityIdHandle, const char* groupScopeName);
  1873.  
  1874.         int StartModularBehaviorTree(IFunctionHandler* pH, ScriptHandle entityIdHandle, const char* treeName);
  1875.         int StopModularBehaviorTree(IFunctionHandler* pH, ScriptHandle entityIdHandle);
  1876.  
  1877.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  1878.         // XML support for goal pipes
  1879.         //////////////////////////////////////////////////////////////////////////////////////////////////////////
  1880.         int LoadGoalPipes(IFunctionHandler* pH);
  1881.  
  1882. private:
  1883.  
  1884.         static const char* GetPathTypeName(EAIPathType pathType);
  1885.  
  1886. protected:
  1887.  
  1888.         //====================================================================
  1889.         // Fetch entity ID from script parameter
  1890.         //====================================================================
  1891.         EntityId GetEntityIdFromParam(IFunctionHandler* pH, int i);
  1892.  
  1893.         //====================================================================
  1894.         // Fetch entity pointer from script parameter
  1895.         //====================================================================
  1896.         IEntity* GetEntityFromParam(IFunctionHandler* pH, int i);
  1897.  
  1898.         void     AssignPFPropertiesToPathType(const string& sPathType, AgentPathfindingProperties& properties);
  1899.  
  1900.         void     SetPFProperties(AgentMovementAbility& moveAbility, EAIPathType nPathType) const;
  1901.         void     SetPFProperties(AgentMovementAbility& moveAbility, const string& sPathType) const;
  1902.  
  1903.         bool     GetSignalExtraData(IFunctionHandler* pH, int iParam, IAISignalExtraData*& pEData);
  1904.  
  1905.         int      RayWorldIntersectionWrapper(Vec3 org, Vec3 dir, int objtypes, unsigned int flags, ray_hit* hits, int nMaxHits,
  1906.                                              IPhysicalEntity** pSkipEnts = 0, int nSkipEnts = 0, void* pForeignData = 0, int iForeignData = 0);
  1907.  
  1908.         int CreateQueryFromTacticalSpec(SmartScriptTable specTable);
  1909.  
  1910.         typedef std::map<int, int>                              VTypeChart_t;
  1911.         typedef std::multimap<int, int, std::greater<int> /**/> VTypeChartSorted_t;
  1912.  
  1913.         bool GetGroupSpatialProperties(IAIObject* pRequester, float& offset, Vec3& avgGroupPos, Vec3& targetPos, Vec3& dirToTarget, Vec3& normToTarget);
  1914.  
  1915.         int  SetLastOpResult(IFunctionHandler* pH, ScriptHandle entityIdHandle, ScriptHandle targetEntityIdHandle);
  1916.  
  1917.         std::vector<Vec3> m_lstPointsInFOVHistory;
  1918.  
  1919.         IGoalPipe*        m_pCurrentGoalPipe;
  1920.         bool              m_IsGroupOpen;
  1921. };
  1922.  
  1923. #endif // __ScriptBind_AI_H__
  1924.  
downloadScriptBind_AI.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