Function List

General
Functions

Boolean  AI_DebugEnabled( Void  )
 

Returns true debugging trace calls should be used, false otherwise 

  Source: [AILuaUtil.cpp (2470)]  

Position  AI_FindClosestEnemyPos( AIPlayer* pAIPlayer )
 

Return the closest enemy base position to the given AI or returns zero if it can't find one 

  Source: [AILuaUtil.cpp (1873)]  

Position  AI_FindOpenNearPos( Position pos )
 

Return an open position near the given position (default: size 5) 

  Source: [AILuaUtil.cpp (1865)]  

String  AI_GetUnitClassAt( Integer classindex )
 

Returns the unit class type name for the given index (example return: "infantry") 

  Source: [AILuaUtil.cpp (1986)]  

Integer  AI_GetUnitClassCount( Void  )
 

Returns the number of type unit class types 

  Source: [AILuaUtil.cpp (1980)]  

Integer  AI_GetUnitClassID( String classname )
 

Returns the unit class ID for the given name (example parameter: "class_light_vehicle") 

  Source: [AILuaUtil.cpp (1994)]  

Void  AIAbility_CastPlayer( AIPlayer* pPlayer, PropertyBagGroup pbg )
 

Casts a player ability (no target required) 

  Source: [AILuaUtil.cpp (2295)]  

Void  AIAbility_CastPlayerToPos( AIPlayer* pPlayer, PropertyBagGroup pbg, Position position )
 

Casts a player ability on the given position 

  Source: [AILuaUtil.cpp (2283)]  

Void  AIAbility_CastPlayerToPosWithFacing( AIPlayer* pPlayer, PropertyBagGroup pbg, Position position, Position lookAtPos )
 

Casts a player ability on the given position facing the lookAtPos (a position not a direction) 

  Source: [AILuaUtil.cpp (2289)]  

Boolean  AIAbility_DoesTargetEntity( PropertyBagGroup pbg )
 

Does this ability target entities 

  Source: [AILuaUtil.cpp (2238)]  

Boolean  AIAbility_DoesTargetPosition( PropertyBagGroup pbg )
 

 

  Source: [AILuaUtil.cpp (2216)]  

Boolean  AIAbility_DoesTargetSquad( PropertyBagGroup pbg )
 

 

  Source: [AILuaUtil.cpp (2227)]  

ResourceAmount  AIAbility_GetCost( const ModPlayer* pPlayer, PropertyBagGroup pbg )
 

Returns the cost of the given ability, needs player to determine if any modifiers have been applied to it 

  Source: [AILuaUtil.cpp (2205)]  

String  AIAbility_GetDemandFunc( PropertyBagGroup pbg )
 

Returns the ability demand function defined in its tactic property table 

  Source: [AILuaUtil.cpp (2181)]  

String  AIAbility_GetEntityFunc( PropertyBagGroup pbg )
 

Returns the ability entity filtering function defined in its tactic property table 

  Source: [AILuaUtil.cpp (2199)]  

String  AIAbility_GetFilterFunc( PropertyBagGroup pbg )
 

Returns the ability filter function defined in its tactic property table 

  Source: [AILuaUtil.cpp (2175)]  

PropertyBagGroup  AIAbility_GetPlayerAt( AIPlayer* pPlayer, Integer index )
 

Returns the player ability at the given index 

  Source: [AILuaUtil.cpp (2166)]  

Integer  AIAbility_GetPlayerCount( AIPlayer* pPlayer )
 

Returns the number of abilities this AI player has 

  Source: [AILuaUtil.cpp (2158)]  

String  AIAbility_GetPositionFunc( PropertyBagGroup pbg )
 

Returns the ability position filtering function defined in its tactic property table 

  Source: [AILuaUtil.cpp (2193)]  

String  AIAbility_GetSquadFunc( PropertyBagGroup pbg )
 

Returns the ability squad filtering function defined in its tactic property table 

  Source: [AILuaUtil.cpp (2187)]  

Boolean  AIAbility_IsFacing( PropertyBagGroup pbg )
 

Is this a modal ability, does it require the AI to choose a target 

  Source: [AILuaUtil.cpp (2260)]  

Boolean  AIAbility_IsTargeted( PropertyBagGroup pbg )
 

Is this a modal ability, does it require the AI to choose a target 

  Source: [AILuaUtil.cpp (2249)]  

Real  AIPlayer_AllyThreatAtPos( AIPlayer* pPlayer, Position pos )
 

Return the amount of ally threat at the given position 

  Source: [AILuaUtil.cpp (1896)]  

Boolean  AIPlayer_CanPlayerCastAbility( AIPlayer* pPlayer, PropertyBagGroup pbg )
 

Can the given ai player cast the given ability (pbg) 

  Source: [AILuaUtil.cpp (2275)]  

Boolean  AIPlayer_CanSee( AIPlayer* pPlayer, Position pos )
 

Returns true if the AIplayer can see this position through the FOW 

  Source: [AILuaUtil.cpp (455)]  

Boolean  AIPlayer_CanSeeEntity( AIPlayer* pPlayer, EntityID pEntity )
 

Returns true if the AIplayer can see this entity through the FOW (will return false for camo'd units) 

  Source: [AILuaUtil.cpp (461)]  

Boolean  AIPlayer_CanSeeSquad( AIPlayer* pPlayer, SquadID pSquad )
 

Returns true if the AIplayer can see this entity through the FOW (will return false for camo'd units) 

  Source: [AILuaUtil.cpp (467)]  

Real  AIPlayer_EnemyThreatAtPos( AIPlayer* pPlayer, Position pos )
 

Return the amount of enemy threat at the given position 

  Source: [AILuaUtil.cpp (1890)]  

Integer  AIPlayer_GetBestClumpIdx( AIPlayer* pPlayer, AISquad* pSquad, Real allowableDist )
 

(AI only) returns a 0-based index of the best clump of enemy players within the given tolerance to the AI squad 

  Source: [AILuaUtil.cpp (1657)]  

Integer  AIPlayer_GetBestPosClumpIdx( AIPlayer* pPlayer, Position pos, Real allowableDist )
 

(AI only) returns a 0-based index of the best clump of enemy players within the given tolerance to the AI squad 

  Source: [AILuaUtil.cpp (1668)]  

Position  AIPlayer_GetClumpPosition( AIPlayer* pPlayer, Integer i )
 

(AI only) Used for tactics; returns a "special error position" on failure that's nowhere inside the world 

  Source: [AILuaUtil.cpp (1701)]  

Integer  AIPlayer_GetDifficultyLevel( AIPlayer* pPlayer )
 

Returns the difficulty level of this AI player, will return one of these: AD_Easy, AD_Standard, AD_Hard, AD_Hardest 

  Source: [AILuaUtil.cpp (951)]  

Integer  AIPlayer_GetFowBestClumpIdx( AIPlayer* pPlayer, AISquad* pSquad, Real allowableDist )
 

(AI only) returns a 0-based index of the best clump of enemy players within the given tolerance to the AI squad 

  Source: [AILuaUtil.cpp (1681)]  

AIPlayer*  AIPlayer_GetLocal( Integer playerId )
 

Returns the local AIPlayer given a PlayerId (1000-1008) 

  Source: [AILuaUtil.cpp (476)]  

Integer  AIPlayer_GetNextBestPosClumpIdx( AIPlayer* pPlayer, Position pos, Real allowableDist )
 

(AI only) returns a 0-based index of the best clump of enemy players within the given tolerance to the AI squad (ignores the passed in position clump) 

  Source: [AILuaUtil.cpp (1674)]  

ResourceAmount  AIPlayer_GetProductionCost( const ModPlayer* player, Integer buildtype, PropertyBagGroup pbg )
 

Returns the cost of the given structure PBG 

  Source: [AILuaUtil.cpp (565)]  

String  AIPlayer_GetRace( const ModPlayer* pPlayer )
 

Returns a pbg given a pathname (eg. ebps\\race_*\\pvp\\buildings\\*_hq) 

  Source: [AILuaUtil.cpp (499)]  

ResourceAmount  AIPlayer_GetStructureCost( const ModPlayer* player, PropertyBagGroup pbg )
 

Returns the cost of the given structure PBG 

  Source: [AILuaUtil.cpp (558)]  

Boolean  AIPlayer_IsFireConePosition( AIPlayer* pPlayer, Math::Vector3f position )
 

Returns true if the given position is in a setup firecone arc (something that can be avoided) 

  Source: [AILuaUtil.cpp (447)]  

Void  AIPlayer_SimulatePre( AIPlayer* pAIPlayer )
 

Updates the AIs analysis of the world (VPs, winconditions, all things adjusted at simulate-pre time) 

  Source: [AILuaUtil.cpp (1086)]  

Real  AIPlayer_SumThreatAtPos( AIPlayer* pPlayer, Position pos )
 

Return the amount of total threat (enemy - ally) 

  Source: [AILuaUtil.cpp (1902)]  

Real  AIPlayer_ThreatAtBase( AIPlayer* pPlayer )
 

Return the amount of threat around the home-base 

  Source: [AILuaUtil.cpp (1882)]  

Real  AIPlayer_TotalDamageReceived( AIPlayer* pPlayer )
 

Return the total amount of damage the AI has received from all its enemies 

  Source: [AILuaUtil.cpp (1908)]  

PropertyBagGroup  AIProduction_GetBuildableBuildingAt( AIPlayer* pPlayer, Integer index )
 
  Source: [AILuaUtil.cpp (1323)]  

Integer  AIProduction_GetBuildableBuildingCount( AIPlayer* pPlayer )
 
  Source: [AILuaUtil.cpp (1317)]  

PropertyBagGroup  AIProduction_GetBuildableSquadAt( AIPlayer* pPlayer, Integer index )
 

Return the squad PBG at the given index, must be less than GetBuildableSquadCount 

  Source: [AILuaUtil.cpp (1335)]  

Integer  AIProduction_GetBuildableSquadCount( AIPlayer* pPlayer )
 

Returns the number of squads that can be built based on the buildings the AI currently has 

  Source: [AILuaUtil.cpp (1329)]  

Integer  AIProduction_GetNumEntityProductionQueue( AIPlayer* pPlayer )
 

Returns the number of entity production queues there are 

  Source: [AILuaUtil.cpp (2095)]  

PropertyBagGroup  AIProduction_GetProductionItemAt( AIPlayer* pPlayer, Integer buildtype, Integer index )
 

Return the upgrade PBG at the given index, must be less than GetBuildableUpgradeCount 

  Source: [AILuaUtil.cpp (1347)]  

Integer  AIProduction_GetProductionItemCount( AIPlayer* pPlayer, Integer buildtype )
 

Returns the number of upgrades that can be built based on the buildings the AI currently has 

  Source: [AILuaUtil.cpp (1341)]  

Integer  AIProduction_GetSpawnerBuildings_Team( AIPlayer* pPlayer, EGroupID pGroup )
 

Fills the given EGroup with a list of spawner structures for the given player 

  Source: [AILuaUtil.cpp (2115)]  

Void  AIProfile_Marker( String name )
 

Adds a profile marker 

  Source: [AILuaUtil.cpp (2482)]  

Void  AIProfile_Marker2( String name )
 

Adds a profile marker 

  Source: [AILuaUtil.cpp (2491)]  

Void  AIProfile_Marker3( String name )
 

Adds a profile marker 

  Source: [AILuaUtil.cpp (2500)]  

Void  AIProfile_Marker4( String name )
 

Adds a profile marker 

  Source: [AILuaUtil.cpp (2509)]  

Integer  AIResource_GetCapturePointAddOnCount( AIPlayer* { if (pPoint == NULL )
 

returns the number of addons on a capture point 

  Source: [AILuaUtil.cpp (1054)]  

AICapturePoint*  AIResource_GetCapturePointAt( AIPlayer* pPlayer, Integer i )
 

returns a capture point at given index 

  Source: [AILuaUtil.cpp (1035)]  

Integer  AIResource_GetCapturePointID( AIPlayer* { if (pPoint == NULL )
 

returns a unique identifier for the given capture point 

  Source: [AILuaUtil.cpp (1043)]  

String  AIResource_GetCapturePointName( AICapturePoint* pPoint )
 

returns the blueprint name of the associated entity 

  Source: [AILuaUtil.cpp (1063)]  

Integer  AIResource_GetCapturePointsTotal( AIPlayer* pPlayer )
 

Returns the total number of capturable points in the world 

  Source: [AILuaUtil.cpp (1029)]  

Integer  AIResource_GetCurrentPopulation( AIPlayer* pPlayer, Integer captype )
 

Returns the current population (includes proxy). (use either CT_Vehicle or CT_Personnel for captype) 

  Source: [AILuaUtil.cpp (976)]  

ResourceAmount  AIResource_GetCurrentResourceRate( AIPlayer* pPlayer )
 

Returns the number of resources we have (in proxy) right now (RT_Requisition, RT_Power, RT_Waaagh) 

  Source: [AILuaUtil.cpp (963)]  

ResourceAmount  AIResource_GetCurrentResources( AIPlayer* pPlayer )
 

Returns the number of resources we have (in proxy) right now (RT_Requisition, RT_Power, RT_Waaagh) 

  Source: [AILuaUtil.cpp (957)]  

Integer  AIResource_GetMaxPopulation( AIPlayer* pPlayer, Integer captype )
 

Returns the map population. (use either CT_Vehicle or CT_Personnel for captype) 

  Source: [AILuaUtil.cpp (982)]  

Integer  AIResource_GetNumCapturers( AIPlayer* pPlayer )
 

Returns the total of units that could do some capturing 

  Source: [AILuaUtil.cpp (893)]  

Integer  AIResource_GetNumCombatants( AIPlayer* pPlayer )
 

Returns the total of units that could do some combat 

  Source: [AILuaUtil.cpp (899)]  

Integer  AIResource_GetNumCombatantsWhoCanOnlyAttack( AIPlayer* pPlayer )
 

Returns the total of units that can only attack (not defend) 

  Source: [AILuaUtil.cpp (905)]  

Integer  AIResource_GetNumCombatantsWhoCanOnlyDefend( AIPlayer* pPlayer )
 

Returns the total of units that can only defend (not attack) 

  Source: [AILuaUtil.cpp (911)]  

Integer  AIResource_GetNumOwnedCapturePoints( AIPlayer* pPlayer )
 

Get number of owner strategic points for the given AI 

  Source: [AILuaUtil.cpp (1000)]  

Integer  AIResource_GetNumOwnedCapturePointsOfType( AIPlayer* pPlayer, Integer capType )
 

Get number of owned strategic points of given type for the given AI 

  Source: [AILuaUtil.cpp (1006)]  

Integer  AIResource_GetNumSecuredCapturePoints( AIPlayer* pPlayer )
 

Get number of secured strategic points that this AI has 

  Source: [AILuaUtil.cpp (988)]  

Integer  AIResource_GetNumSecuredCapturePointsForAddOns( AIPlayer* pPlayer )
 

Get number of secured strategic points that this AI has 

  Source: [AILuaUtil.cpp (994)]  

Integer  AIResource_GetNumUnconsciousSquads( AIPlayer* pPlayer )
 

Returns the total of squads that have unconscious units (need resurrecting). 

  Source: [AILuaUtil.cpp (917)]  

Real  AIResource_GetResourceRate( AIPlayer* pPlayer, Integer rtype )
 

Returns the resource rate (RT_Requisition, RT_Power, RT_Waaagh) measured in res per second 

  Source: [AILuaUtil.cpp (969)]  

Real  AIResource_GetResurrectDepreciationProgress( AISquad* pSquad )
 

Returns the depreciation progress for a given squad that needs resurrection (0 is at max cost, 1 is at min cost). 

  Source: [AILuaUtil.cpp (934)]  

ResourceAmount  AIResource_GetResurrectSquadCost( AISquad* pSquad )
 

Returns the current cost to resurrect the given squad. 

  Source: [AILuaUtil.cpp (923)]  

AISquad*  AIResource_GetUnconsciousSquad( AIPlayer* pPlayer )
 

Returns first unconscious squad (null if none) 

  Source: [AILuaUtil.cpp (1074)]  

AISquad*  AIResource_GetUnconsciousSquadByPBG( AIPlayer* pPlayer, PropertyBagGroup pbg )
 

Returns first unconscious squad matching PBG (null if none) 

  Source: [AILuaUtil.cpp (1080)]  

Integer  AIResource_GetVictoryPointsOwnedBy( AIPlayer* pPlayer, Integer team )
 

Returns the number of victory points owned by the given team 

  Source: [AILuaUtil.cpp (1023)]  

Integer  AIResource_GetVictoryPointTotal( AIPlayer* pPlayer )
 

Returns the total number of victory points in the world 

  Source: [AILuaUtil.cpp (1017)]  

Real  AISquad_GetAggression( AISquad* pAISquad )
 

Returns the aggression value for the squad. 

  Source: [AILuaUtil.cpp (326)]  

Position  AISquad_GetAnchorPos( AISquad* pSquad )
 

Returns the anchor position for an ai squad 

  Source: [AILuaUtil.cpp (236)]  

Real  AISquad_GetCaptureTask_CaptureProgress( AISquad* pAISquad )
 

Get the capture progress of the Squad Capture Task target. Returns -1 if target does not exist. 

  Source: [AILuaUtil.cpp (406)]  

Integer  AISquad_GetCloseAlliedEntitiesCount( AISquad* pAISquad )
 

Returns the number of nearby allied entities 

  Source: [AILuaUtil.cpp (308)]  

EntityID  AISquad_GetClosestObstruction( AISquad* pSquad, Real radius, Boolean bFilterAllied )
 

Returns the closest obstruction entity to the given squad 

  Source: [AILuaUtil.cpp (2377)]  

EntityID  AISquad_GetClosestObstructionOfType( AISquad* pSquad, Real radius, PropertyBagGroup pbgtype )
 

Returns the closest obstruction entity to the given squad 

  Source: [AILuaUtil.cpp (2433)]  

Position  AISquad_GetCombatTask_TargetPosition( AISquad* pAISquad )
 

Get the position of the Squad Combat Task target. Returns invalid position if target does not exist. 

  Source: [AILuaUtil.cpp (376)]  

Boolean  AISquad_InCaptureTask( AISquad* pAISquad )
 

Returns true if Squad is in Capture Task. 

  Source: [AILuaUtil.cpp (362)]  

Boolean  AISquad_InCombatTask( AISquad* pAISquad )
 

Returns true if Squad is in Combat Task. 

  Source: [AILuaUtil.cpp (349)]  

Boolean  AISquad_IsPosThreateningToSquad( AIPlayer* pPlayer, AISquad* pAISquad, Position pos )
 

Determines if the given position is threatening to the given squad 

  Source: [AILuaUtil.cpp (297)]  

Boolean  AISquad_IsPosWithinDistOfAttackTarget( AISquad* pSquad, Math::Vector3f pos, Real radius )
 

Returns true if the given position is within the range of any targets of this squad 

  Source: [AILuaUtil.cpp (2409)]  

Void  AISquad_SetAggression( AISquad* pAISquad, Real aggression )
 

Sets the aggression value for the squad. 

  Source: [AILuaUtil.cpp (337)]  

Boolean  Construction_CanConstruct( AIPlayer* pPlayer, PropertyBagGroup pbg )
 

Can this AIPlayer construct this PBG (meaning does he have the prereqs) 

  Source: [AILuaUtil.cpp (1092)]  

Boolean  Construction_CanConstructNow( AIPlayer* pPlayer, PropertyBagGroup pbg )
 

Can this AIPlayer construct this PBG now (meaning does he have the prereqs and the money) 

  Source: [AILuaUtil.cpp (1098)]  

Integer  Construction_IncompleteStructuresCount( AIPlayer* pPlayer )
 

Returns the number of incomplete structures there are in the world (ones that are not currently in any tasks) 

  Source: [AILuaUtil.cpp (2340)]  

Void  Construction_ScuttleIncompleteThreatenedBuildings( AIPlayer* pPlayer, Real minThreatThreshold )
 

This goes through all the incomplete buildings and scuttles them if threatened 

  Source: [AILuaUtil.cpp (2346)]  

Integer  EntityQuery_GetCapturePoints( EGroupID egroup )
 

fills the provided EGroup with strat points in the world 

  Source: [AILuaUtil.cpp (2003)]  

Boolean  EntityQuery_IsStructure( EntityID pEntity )
 

Returns true if this is a structure 

  Source: [AILuaUtil.cpp (602)]  

Integer  getmetatype( LuaBinding::StackVar var )
 

Returns the type of the past in variable 

  Source: [AILuaUtil.cpp (2331)]  

Boolean  PBG_CanCapture( AIPlayer* pPlayer, PropertyBagGroup pbg )
 

Determines if the the given PBG can capture now 

  Source: [AILuaUtil.cpp (2077)]  

Boolean  PBG_CanCaptureEver( PropertyBagGroup pbg )
 

Can this squad capture points 

  Source: [AILuaUtil.cpp (2071)]  

Void  PBG_ClearLimits( AIPlayer* pPlayer )
 
  Source: [AILuaUtil.cpp (1311)]  

PropertyBagGroup  PBG_Get( String name )
 

Returns a pbg given a pathname (eg. ebps\\races\\allies\\buildings\\motorpool.lua) 

  Source: [AILuaUtil.cpp (484)]  

Integer  PBG_GetCount( AIPlayer* pPlayer, PropertyBagGroup pbg )
 

How many of the given item does this player own 

  Source: [AILuaUtil.cpp (1280)]  

Real  PBG_GetDefencePriority( PropertyBagGroup pbg )
 

Get the AIExtInfo defence priority of this object. 

  Source: [AILuaUtil.cpp (585)]  

Integer  PBG_GetID( PropertyBagGroup pbg )
 
  Source: [AILuaUtil.cpp (1968)]  

Integer  PBG_GetLimit( AIPlayer* pPlayer, PropertyBagGroup pbg )
 

How many of this PBG can this ai player build, artifical cap. 

  Source: [AILuaUtil.cpp (1299)]  

String  PBG_GetName( PropertyBagGroup pbg )
 
  Source: [AILuaUtil.cpp (1957)]  

Integer  PBG_GetNumCanProduce( AIPlayer* pPlayer, Integer buildtype, PropertyBagGroup pbg )
 

How many of production channels are their for this PBG 

  Source: [AILuaUtil.cpp (1286)]  

Integer  PBG_GetNumRequestsForProducer( AIPlayer* pPlayer, Integer buildtype, PropertyBagGroup pbg )
 

How many requests are there for the producers of this PBG 

  Source: [AILuaUtil.cpp (1292)]  

Boolean  PBG_IsSame( PropertyBagGroup pbg1, PropertyBagGroup pbg2 )
 

Takes two PBGs and returns true if they are the same 

  Source: [AILuaUtil.cpp (2089)]  

Boolean  PBG_IsStructure( PropertyBagGroup pbg )
 

Returns true if this object is a structure (something with a site_ext) 

  Source: [AILuaUtil.cpp (577)]  

Integer  PBG_ProductionItemCount( PropertyBagGroup pbg, Integer buildtype )
 

Returns the number of items this structure can produce of the given production build type 

  Source: [AILuaUtil.cpp (571)]  

Void  PBG_SetLimit( AIPlayer* pPlayer, PropertyBagGroup pbg, Integer limit )
 
  Source: [AILuaUtil.cpp (1305)]  

Real  PlayerStats_ComparePlayerCombatRatingDiff( const ModPlayer* pPlayer_lhs, const ModPlayer* pPlayer_rhs )
 

Gives a single value of how many rating points lhs is above rhs, can be negative 

  Source: [AILuaUtil.cpp (669)]  

Real  PlayerStats_ComparePlayerCombatRatingPercentageDiff( const ModPlayer* pPlayer_lhs, const ModPlayer* pPlayer_rhs )
 

Gives a percentage describing what percent of rhs is lhs (1.0 == 100%), can be negative 

  Source: [AILuaUtil.cpp (686)]  

Real  PlayerStats_CompareTeamCombatRatingDiff( Integer team_lhs, Integer team_rhs )
 

Gives a single value of how many rating points lhs is above rhs, can be negative 

  Source: [AILuaUtil.cpp (704)]  

Real  PlayerStats_CompareTeamCombatRatingPercentageDiff( Integer team_lhs, Integer team_rhs )
 

Gives a percentage describing what percent of rhs is lhs (1.0 == 100%), can be negative 

  Source: [AILuaUtil.cpp (716)]  

Real  PlayerStats_EvaluateSquadPurchaseCombatRatingDiff( PropertyBagGroup squadPBG, const ModPlayer* pPlayer, Integer team_enemy )
 

Evaluates the value of purchasing a unit for the given player, when faced against the given enemy team.  

The value is the difference in combat outcome (CombatRatingDiff) between after purchase and before.

  Source: [AILuaUtil.cpp (729)]  

Real  PlayerStats_EvaluateSquadUpgradePurchaseCombatRatingDiff( AISquad* aiSquad, PropertyBagGroup upgradePBG, const ModPlayer* pPlayer, Integer team_enemy )
 

Evaluates the value of purchasing a unit for the given player, when faced against the given enemy team.  

The value is the difference in combat outcome (CombatRatingDiff) between after purchase and before.

  Source: [AILuaUtil.cpp (757)]  

Real  PlayerStats_GetTotalAntiClassRatingSum( const ModPlayer* pPlayer )
 

Retrieves the total anti-class rating for this player 

  Source: [AILuaUtil.cpp (633)]  

Real  PlayerStats_GetTotalClassRatingSum( const ModPlayer* pPlayer )
 

Retrieves the total class rating for this player 

  Source: [AILuaUtil.cpp (620)]  

Real  PlayerStats_GetTotalHistoryAntiClassRatingSum( const ModPlayer* pPlayer )
 

Retrieves the total anti-class rating for all the units that has killed this AI's units recently 

  Source: [AILuaUtil.cpp (808)]  

Real  PlayerStats_GetTotalHistoryClassRatingSum( const ModPlayer* pPlayer )
 

Retrieves the total class rating for all the units that has killed this AI's units recently 

  Source: [AILuaUtil.cpp (796)]  

Real  PlayerStats_GetTotalSquadAntiClassRatingSum( const ModPlayer* pPlayer )
 

Retrieves the total squad anti-class rating for this player and the specified class 

  Source: [AILuaUtil.cpp (657)]  

Real  PlayerStats_GetTotalSquadClassRatingSum( const ModPlayer* pPlayer )
 

Retrieves the total squad class rating for this player 

  Source: [AILuaUtil.cpp (645)]  

Void  Request_Capture( AIPlayer* pPlayer, Integer groupID, Real priority, LuaBinding::StackVarTable captureOrderParams )
 

Attempts to lock a capturing resource to go out and capture a point 

  Source: [AILuaUtil.cpp (855)]  

Void  Request_Combat( AIPlayer* pPlayer, Integer groupID, Real priority, LuaBinding::StackVarTable combatOrderParams )
 

Request a combat task. The task will choose a target. rallyLocation should be one of:RALLY_None,RALLY_InBase,RALLY_LastPosSafe,RALLY_NearDefendPoint,RALLY_ReinforcePoint 

  Source: [AILuaUtil.cpp (2031)]  

Void  Request_Generator( AIPlayer* pPlayer, Integer groupID, Real priority, PropertyBagGroup pbg )
 

Attempts to build a generator structure to secure a point 

  Source: [AILuaUtil.cpp (876)]  

Void  Request_ImmobileCombat( AIPlayer* pPlayer, Integer groupID, Real priority )
 

Requests a task to be used by immobile combat units 

  Source: [AILuaUtil.cpp (886)]  

Void  Request_Secure( AIPlayer* pPlayer, Integer groupID, Real priority, PropertyBagGroup pbg )
 

Attempts to build a structure to secure a point 

  Source: [AILuaUtil.cpp (866)]  

Void  Request_Sniper( AIPlayer* pPlayer, Integer groupID, Real priority, Integer sniperStyle )
 

Request a sniper task. sniperStyle should be one of:SNIPER_Attack,SNIPER_Defend 

  Source: [AILuaUtil.cpp (2060)]  

SquadID  SquadQuery_GetAnySquadCombatTarget( SquadID pSquad )
 

Returns the first target squad for the given squad 

  Source: [AILuaUtil.cpp (2313)]  

Boolean  SquadQuery_IsVehicle( SquadID pSquad )
 

Returns true if the given squad is a vehicle type squad 

  Source: [AILuaUtil.cpp (2302)]  

Real  SquadStats_GetAntiClassRating( PropertyBagGroup pbg, Integer ai_class_type )
 

Retrieves the effectives of this unit against another unit of the given classID. 

  Source: [AILuaUtil.cpp (550)]  

Integer  SquadStats_GetBuildTicks( const ModPlayer* pPlayer, PropertyBagGroup pbg )
 

Retrieve the population cap this squad will add (use either CT_Vehicle or CT_Personnel for captype) 

  Source: [AILuaUtil.cpp (522)]  

Integer  SquadStats_GetClass( PropertyBagGroup pbg )
 

Retrieves the type of class that this unit is, determined in the attribute editor. Returns a classID 

  Source: [AILuaUtil.cpp (528)]  

Real  SquadStats_GetClassRating( PropertyBagGroup pbg, Integer ai_class_type )
 

Retrieves the class rating for this unit, which is a rating of how powerful a unit of this class it is 

  Source: [AILuaUtil.cpp (542)]  

ResourceAmount  SquadStats_GetCost( const ModPlayer* pPlayer, PropertyBagGroup pbg )
 

Returns the modified cost of the given unit including all modifications added by the given player 

  Source: [AILuaUtil.cpp (510)]  

Real  SquadStats_GetPop( const ModPlayer* { return (float )
 

Retrieve the population cap this squad will add (use either CT_Vehicle or CT_Personnel for captype) 

  Source: [AILuaUtil.cpp (518)]  

Real  SquadStats_GetPrimaryClassRating( PropertyBagGroup pbg )
 

Retrieves the class rating for this unit, which is a rating of how powerful a unit of this class it is 

  Source: [AILuaUtil.cpp (534)]  

Void  Task_CalcInTaskCombatRating( AIPlayer* pPlayer )
 

Updates the internally cached in-task combat rating.  

The intask rating, is a sum of all the combat ratings of all the units/abilities that have been requested/purchased but not created.

  Source: [AILuaUtil.cpp (1633)]  

Integer  Task_Count( AIPlayer* pPlayer, Integer taskType )
 

Counts the number of particular tasks there are (active or inactive) 

The second parameter has to be one of the TASK_Capture,TASK_Attack,TASK_Defend,TASK_Construction,TASK_CapturePointConstruction TASK_Production,TASK_ResurrectHero

  Source: [AILuaUtil.cpp (1373)]  

Integer  Task_CountActive( AIPlayer* pPlayer, Integer taskType, LuaBinding::StackVar stackVar )
 

Counts the number of active tasks 

The second parameter has to be one of these TASK_Capture,TASK_Attack,TASK_Defend,TASK_Construction,TASK_CapturePointConstruction TASK_Production,TASK_ResurrectHero

  Source: [AILuaUtil.cpp (1475)]  

Integer  Task_CountActiveInGroup( AIPlayer* pPlayer, Integer groupID )
 

Counts the number of active tasks in the given group 

  Source: [AILuaUtil.cpp (1500)]  

Integer  Task_CountActivePBG( AIPlayer* pPlayer, PropertyBagGroup pbg, LuaBinding::StackVar stackVar )
 

Determine how many tasks with the given PBG are of the provided active state, passing no last parameters means to check both 

  Source: [AILuaUtil.cpp (1770)]  

Integer  Task_CountCapturerPBG( AIPlayer* pPlayer )
 

Determine how many requests there are for capturing units 

  Source: [AILuaUtil.cpp (1925)]  

Integer  Task_CountCombat( AIPlayer* pPlayer, Integer combatType )
 

Counts the number of particular combat tasks there are (active and inactive) 

The second parameter has to be one of these COMBAT_Attack,COMBAT_Defend,COMBAT_Default

  Source: [AILuaUtil.cpp (1439)]  

ResourceAmount  Task_CountCost( AIPlayer* pPlayer, Boolean bActive )
 

Count the amount of money running in the tasks 

  Source: [AILuaUtil.cpp (1564)]  

Integer  Task_CountEmpty( AIPlayer* pPlayer, Integer taskType, Integer resType )
 

Count the number of tasks that haven't locked any of a certain resource. 

The second parameter has to be one of these TASK_Capture,TASK_Attack,TASK_Defend,TASK_Construction,TASK_CapturePointConstruction,TASK_Production,TASK_ResurrectHero. The third parameter has to be one of these AI_Squad,AI_ProductionQueue,AI_CapturePoint.

  Source: [AILuaUtil.cpp (1594)]  

ResourceAmount  Task_CountGroupCost( AIPlayer* pPlayer, Integer groupID, Boolean bActive )
 

Count the amount of money running in the group of tasks 

  Source: [AILuaUtil.cpp (1586)]  

Integer  Task_CountIncompleteStructure( AIPlayer* pPlayer )
 

Count the number of tasks that are being allocated for handling incomplete structures 

  Source: [AILuaUtil.cpp (1626)]  

Integer  Task_CountInGroup( AIPlayer* pPlayer, Integer groupID )
 

Counts the number of tasks there are in the given group 

  Source: [AILuaUtil.cpp (1494)]  

Integer  Task_CountPBG( AIPlayer* pPlayer, PropertyBagGroup pbg )
 

Determine how many requested are currently created for this pbg 

  Source: [AILuaUtil.cpp (1718)]  

Integer  Task_CountPopulation( AIPlayer* pPlayer, Boolean bActive )
 

Count the population used by all the tasks that are running, and can specify to count active or inactive ones 

  Source: [AILuaUtil.cpp (1535)]  

Integer  Task_CountResources( AIPlayer* pPlayer, Integer taskType, Integer resType )
 

Count the number of resources locked by certain tasks 

The second parameter has to be one of these TASK_Capture,TASK_Attack,TASK_Defend,TASK_Construction,TASK_CapturePointConstruction,TASK_Production,TASK_ResurrectHero. The third parameter has to be one of these AI_Squad,AI_ProductionQueue,AI_CapturePoint.

  Source: [AILuaUtil.cpp (1508)]  

Real  Task_GetInTaskAntiClassRatingSum( AIPlayer* pPlayer )
 

Returns the intask anticlass rating 

  Source: [AILuaUtil.cpp (1646)]  

Real  Task_GetInTaskClassRatingSum( AIPlayer* pPlayer )
 

Returns the intask class rating 

  Source: [AILuaUtil.cpp (1640)]  

Void  Task_KillAll( AIPlayer* pPlayer )
 

Kills all tasks the player has, which inturn unlocks all the used resources 

  Source: [AILuaUtil.cpp (1365)]  

Void  Task_KillGroup( AIPlayer* pPlayer, Integer groupId )
 

Kills all tasks that belong to the given group 

  Source: [AILuaUtil.cpp (1353)]  

Void  Task_KillInactiveTasksInGroup( AIPlayer* pPlayer, Integer groupId )
 

Kills all tasks that belong to the given group that are inactive 

  Source: [AILuaUtil.cpp (1359)]  

Real  WinCondition_GetMaxVPTickets( Void  )
 

Returns the number of tickets that this team has 

  Source: [AILuaUtil.cpp (2361)]  

Integer  WinCondition_GetVPTickets( Integer teamID )
 

Returns the number of tickets that this team has 

  Source: [AILuaUtil.cpp (2352)]  

 

 

Military
Functions

Void  Military_AddTarget( AIPlayer* pPlayer, Integer militaryTargetType, AIStatsMilitaryPoint* pMilitaryPoint, Real priority )
 

The second parameter has to be one of MTARGET_Defend, MTARGET_Attack

  Source: [AILuaMilitary.cpp (629)]  

Void  Military_ClearTargets( AIPlayer* pPlayer, Integer militaryTargetType )
 

The second parameter has to be one of MTARGET_Defend, MTARGET_Attack

  Source: [AILuaMilitary.cpp (611)]  

AISquad*  Military_GetAISquadAtIndex( AIPlayer* pPlayer, Integer index )
 

Get the AI squad at given index for this player 

  Source: [AILuaMilitary.cpp (78)]  

Real  Military_GetCombinedImportanceAtMilitaryPoint( AIPlayer* pPlayer, AIStatsMilitaryPoint* pMilitaryPoint )
 
  Source: [AILuaMilitary.cpp (278)]  

Real  Military_GetMaxCombinedImportanceAtMilitaryPoint( AIPlayer* pPlayer )
 
  Source: [AILuaMilitary.cpp (302)]  

Real  Military_GetMaxCombinedThreatAtMilitaryPoint( AIPlayer* pPlayer )
 
  Source: [AILuaMilitary.cpp (365)]  

AIStatsMilitaryPoint*  Military_GetMilitaryPointAt( AIPlayer* pPlayerLocal, PlayerID pPlayerEnemy, Integer i )
 
  Source: [AILuaMilitary.cpp (147)]  

Real  Military_GetMilitaryPointCapturePriority( AIPlayer* pPlayer, AIStatsMilitaryPoint* pMilitaryPoint )
 

Returns true if this military point is referenced by a capture task 

  Source: [AILuaMilitary.cpp (395)]  

Integer  Military_GetMilitaryPointCount( AIPlayer* pPlayerLocal, PlayerID pPlayerEnemy )
 

The number of military points owned by the given player 

  Source: [AILuaMilitary.cpp (124)]  

Real  Military_GetMilitaryPointDistanceToBase( AIPlayer* pPlayer, AIStatsMilitaryPoint* pMilitaryPoint )
 
  Source: [AILuaMilitary.cpp (377)]  

EntityID  Military_GetMilitaryPointEntity( AIStatsMilitaryPoint* pMilitaryPoint )
 

Get this military points entity 

  Source: [AILuaMilitary.cpp (425)]  

Position  Military_GetMilitaryPointPosition( AIStatsMilitaryPoint* pMilitaryPoint )
 
  Source: [AILuaMilitary.cpp (437)]  

Real  Military_GetMinCombinedThreatAtMilitaryPoint( AIPlayer* pPlayer )
 
  Source: [AILuaMilitary.cpp (353)]  

AIStatsMilitaryPoint*  Military_GetNeutralMilitaryPointAt( AIPlayer* pPlayerLocal, Integer i )
 
  Source: [AILuaMilitary.cpp (193)]  

Integer  Military_GetNeutralMilitaryPointCount( AIPlayer* pPlayerLocal )
 
  Source: [AILuaMilitary.cpp (175)]  

AIStatsMilitaryPoint*  Military_GetTargetAt( AIPlayer* pPlayer, Integer militaryTargetType, Integer idx )
 

The second parameter has to be one of MTARGET_Defend, MTARGET_Attack

  Source: [AILuaMilitary.cpp (593)]  

Integer  Military_GetTargetCount( AIPlayer* pPlayer, Integer militaryTargetType )
 

The second parameter has to be one of MTARGET_Defend, MTARGET_Attack

  Source: [AILuaMilitary.cpp (575)]  

Void  Military_SetSquadAggression( AIPlayer* pPlayer, Real aggression )
 

Set all squads (locked and unlocked) for player to have the specified aggression level 

  Source: [AILuaMilitary.cpp (102)]  

Void  Military_SortAndCapTargets( AIPlayer* pPlayer, Integer militaryTargetType )
 

The second parameter has to be one of MTARGET_Defend, MTARGET_Attack

  Source: [AILuaMilitary.cpp (652)]  

Integer  Military_SquadTotalCount( AIPlayer* pPlayer )
 

Get all the squads owned by this AI player 

  Source: [AILuaMilitary.cpp (54)]  

Integer  Military_SquadUnlockedCount( AIPlayer* pPlayer )
 

Get all the unlocked squads owned by this player 

  Source: [AILuaMilitary.cpp (66)]