Set ability for ability encounter
Adjust default goal data for ability goals. Sets the default GoalData to the current defaults plus additionalDefaultGoalData; any values specified are used for unspecified encounter ability goal values.
Set default goal data for ability goals. defaultGoalData is cloned; any values specified are used for unspecified encounter ability goal values.
Set modify goal data for ability goals. modifyGoalData is cloned; values specified via keyname_Multiplier are used for the numeric keyname encounter ability goal value.
Set override goal data for ability goals. overrideGoalData is cloned; any values specified are used for encounter ability goal values.
Adjust default goal data for attack goals. Sets the default GoalData to the current defaults plus additionalDefaultGoalData; any values specified are used for unspecified encounter attack goal values.
Set default goal data for attack goals. defaultGoalData is cloned; any values specified are used for unspecified encounter attack goal values.
Set modify goal data for attack goals. modifyGoalData is cloned; values specified via keyname_Multiplier are used for the numeric keyname encounter attack goal value.
Set override goal data for attack goals. overrideGoalData is cloned; any values specified are used for encounter attack goal values.
Adjust default goal data. Sets the default GoalData to the current defaults plus additionalDefaultGoalData; any values specified are used for unspecified encounter goal values.
Set default goal data. defaultGoalData is cloned; any values specified are used for unspecified encounter goal values.
Set modify goal data. modifyGoalData is cloned; values specified via keyname_Multiplier are used for the numeric keyname encounter goal value.
Set override goal data. overrideGoalData is cloned; any values specified are used for encounter goal values.
Adjust default goal data for defend goals. Sets the default GoalData to the current defaults plus additionalDefaultGoalData; any values specified are used for unspecified encounter defend goal values.
Set default goal data for defend goals. defaultGoalData is cloned; any values specified are used for unspecified encounter defend goal values.
Set modify goal data for defend goals. modifyGoalData is cloned; values specified via keyname_Multiply are used for the numeric keyname encounter defend goal value.
Set override goal data for defend goals. overrideGoalData is cloned; any values specified are used for encounter defend goal values.
Ends the encounter and deletes it.
add the EGroup to the Encounter forced target list. NOTE: supported only by the Attack Encounter
add the Entity to the Encounter forced target list. NOTE: supported only by the Attack Encounter
add the SGroup to the Encounter forced target list. NOTE: supported only by the Attack Encounter
add the Squad to the Encounter forced target list. NOTE: supported only by the Attack Encounter
Clear the encounter Forced Combat Targets
Enables/disables squads in combat garrisoning.
remove the EGroup from the Encounter forced target list. NOTE: supported only by the Attack Encounter
remove the Entity from the Encounter forced target list. NOTE: supported only by the Attack Encounter
remove the SGroup from the Encounter forced target list. NOTE: supported only by the Attack Encounter
remove the Squad from the Encounter forced target list. NOTE: supported only by the Attack Encounter
Set Combat Range Policy for the encounter policy is one of: AICombatRangePolicy_Default, AICombatRangePolicy_Ranged_MinRange, AICombatRangePolicy_Ranged_MaxRange, AICombatRangePolicy_MeleeRange
Set if the Attack Encounter should spread the attackers on multiple targets
Set a named bool value in the Encounter DataDictionary
Set a named number value in the Encounter DataDictionary
Set a named PBG value in the Encounter DataDictionary
Enables/disables idle squads garrisoning.
Adds a setup location and facing direction for this encounter not specifically assigned to any squad
clears the encounter setup locations
Enable / disable aggressive move into engagement area
Enable construction in Town Life encounters
Enable setup locations in attack and defend encounters
Sets a TownLife Encounter whether to allow resource gathering from deposits outside of Encounter leash.
Enable encounter to return to previous stages if they fail to meet conditions for current stage.
Enable coordinated arrival in attack encounters
Enables/disables sniper reactions
Enables/disables SubEngagementAreas
Sets max time, in seconds, to accomplish encounter, once the target is engaged.
Sets max time, in seconds, to remain idle at encounter target, once engaged.
set the sbp setup location priority override
set the squad setup location and facing direction
Enable/Disable Reinforce during combat
Enable retreat to break pinned.
Enable retreat to break suppression.
Set entities remaining threshold of encounter [-1 to N] to fallback at. (negative disables)
Set capacity threshold [-1 to 1] to fallback at. (negative disables)
Set combat rating threshold of area [0.0 to 1.0] to fallback at. (0.0 disables)
Set Squad health threshold [-1 to 1] to fallback at. (negative disables)
Set Squad Shield threshold [-1 to 1] to fallback at. (negative disables)
Set Vehicle health threshold [-1 to 1] to fallback at. (negative disables)
Set global fallback threshold (negative for individual squad).
Set global retreat type (true for retreat; false for fallback).
Set the Reinforce Health Percentage [-1 to 1] (negative disables retreat)
Set the Max Reinforce Distance (negative value: no distance constrain)
Set the Min Health Ratio Required To Reach Reinforce Point [0.0, 1.0] (negative value: no constrain)
Set combat rating threshold of area [-1 to 1] to fallback at. (negative disables)
Set combat rating threshold of area [0.0 to 1.0] to retreat at. (0.0 disables)
Set retreat health threshold of area [-1 to 1] (negative disables)
Set fallback target.
Asks the encounter to terminate in its next update (allows PhaseEncounter to set its exit info)
Set formup type for formation encounter to be at building of type from AE tuning list (must set before triggering)
Set formup entity for formation encounter (must set before triggering)
Set formup position for formation encounter (must set before triggering)
Set formup position for formation encounter at the average of current squad positions (must set before triggering)
Set formup position timeout and % squads that must arrive or else it will fail. Setting zero for timeout means infinite
Assign a property bag contains data to support sub task coordination for combat encounters
Set params for terminating a formation phase encounter based on combat, fallback params can also be used
Set params for terminating a formation phase encounter that is moving somewhere and encounters enemies enemyScanRange is scan range from current centre of the formation to look for enemies in meters combatFitnessThreshold is the fitness rating against all detected enemies, < 0 means do not use, 0 means our team will win taking no damage, 1.0 means the enemy will win taking now damage. enemyFormationAngle is the relative heading of the strongest enemy formation in degrees, 0 means do not use enemyFormationPosition is the relative position of the strongest enemy formation in degrees, where 360.0f means directly behind us, 0 means do not use enemyFormationDistance is the distance threshold of the strongest enemy formation in meters
Set params for terminating a formation phase encounter that is moving somewhere timeoutSeconds is how long to wait for squads to get to destination (0 means run indefinitely) requiredSquadsPercent is how many squads must be in the target area, 1.0 means all wasRecentlyAttackedSecs was any unit attacked in this interval, 0 means do not use. Recommend not using if you are also using combat threshold
Get the average position of squads of this finished formation phase encounter (may be the same as target if successful). You should call AIEncounter_FormationPhase_HasValidExitInfo before this to avoid an error
Get the end position of this finished formation phase move encounter (may be the same as target if successful)
Get the combat fitness result for a finished phase encounter, will only be valid for exit states CombatFitnessThreshold or WasAttacked. -1.0f means invalid.
Get SGRoups containing the squads who made it to the destination of a formation phase move encounter and those who didn't (encounter must have completed) false indicates the exit info was not available for this encounter
Query if there is valid exit info for this encounter (will only return true for phase encounters)
Specify data for formation encounter to create a formation min range task state repositionInterval is how often they will check to see if they need to reposition
Specify data for formation encounter to create a formation min range task state with protect task enemyScanRange is scan range from current centre of the formation to look for enemies in meters
Specify data for formation encounter to create a formation move task state
Specify data for formation encounter to create a formation setup ranged task state
Specify data for formation encounter to create a formation setup ranged task state and along with a formation of other units to protect it
Specify data for formation encounter to create a formation simple melee task state
Specify data for formation encounter to create a formation transport move task state
Returns true if enconter has a valid AI player
in non RTM builds, if verboseEncounterLogging is enabled, will spew string to AI log file
Enable / disable aggressive movements on way to engagement targets
Set radius (follow distance) for coordinated move phase (<= 0 disables coordinated movement)
Clears all notification callbacks for encounter
enables/disabled the sniped callback
Sets the ID for the notification event sent out by encounter
Pause/Unpause this encounter
Calculates approximately how long it will take for a specified Encounter to produce a specified squad. Returns production time in seconds. Negative value means the specified PBG cannot be produced at the specified Encounter. pEncounter is the Encounter Module that can service a production request. pbgShortname is the PBG of the squad to query. if canAffordNowOnly is set and we currently don't have enough resource now, report "cannot be produced".
Removes all resource entities from encounter.
Removes all resource squads from encounter.
Sets the resource entities for encounter.
Checks if a squad group is equal to the resource squads of an encounter.
Sets the resource money for an encounter.
Sets the resource squads for encounter.
Set encounter name for debugging.
Reset all tactic filters for encounter
Reset all tactic ability constraints for encounter
Reset ability priority for all squads in encounter
Reset tactic priority for all squads in encounter
Reset all tactic constraints for encounter
Reset all tactic target constraints for encounter
Set tactic ability constraints for encounter maxCasters is maximum concurrent casters of this ability (-1 is unlimited), waitRetrySecs is time in seconds between ability tactic retrying ability retry, wait[self/encounter], and timeout Secs are: the number of seconds to try doing a tactic after a previous try; seconds after last successful try; how long the successful tactic can run. initialWait is true if the waitTime applies before the first ability use. maxRange is the maximum range to look for ability target from caster (other range constraints may limit the max range to a smaller value) castChanceOverride is the probability to cast the ability, must be between 0.0 and 1.0
Set ability priority for all squads in encounter; negative priority disables
Set ability priority for squad in encounter
Set default tactic ability constraints for encounter (ability specific guidance takes priority over defaults) maxCasters is maximum concurrent casters of ability (-1 is unlimited), waitRetrySecs is time in seconds between ability tactic retrying ability, retry, wait[self/encounter], and timeout Secs are: the number of seconds to try doing a tactic after a previous try; seconds after last successful try; how long the successful tactic can run. initialWait is true if the waitTime applies before the first ability use. maxRange is the maximum range to look for ability target from caster (other range constraints may limit the max range to a smaller value) castChanceOverride is the probability to cast the ability, must be between 0.0 and 1.0
Set default tactic constraints for encounter (tactic specific guidance takes priority over defaults) maxUsers is maximum concurrent users of tactic (-1 is unlimited), waitRetrySecs is time in seconds between tactic retrying retry, wait, and timeout Secs are: the number of seconds to try doing a tactic after a previous try; seconds after last successful try; how long the successful tactic can run. initialWait is true if the waitTime applies before the first tactic use. maxRange is the maximum range to look for tactic target from caster (other range constraints may limit the max range to a smaller value)
Set tactic priority for all squads in encounter; negative priority disables
Set tactic priority for squads in encounter
Set tactic constraints for encounter maxUsers is maximum concurrent users of this tactic (-1 is unlimited), waitRetrySecs is time in seconds between tactic retry retry, wait, and timeout Secs are: the number of seconds to try doing a tactic after a previous try; seconds after last successful try; how long the successful tactic can run. initialWait is true if the waitTime applies before the first tactic use. maxRange is the maximum range to look for tactic target from caster (other range constraints may limit the max range to a smaller value)
Set tactic target priority for encounter policy is one of: AITacticTargetPreference_None, AITacticTargetPreference_Near,
Disables the patrol for the passed Squad
Sets target patrol path for encounter
Sets random wander target patrol for encounter; delaySecs is the time in secs to pause at each random point
Sets target patrol path for the squad
Sets random wander target patrol for the squad; delaySecs is the time in secs to pause at each random point
Sets the target for an encounter to a provided marker, position, sgroup, egroup, squad, or entity When you specify a group as the target, it chooses a single squad or entity - if you pass something for the closestTo parameter it will choose the closest one to that, otherwise it will just choose the first
Sets engagement area radius around the target.
Sets target Entity for encounter
Sets leash radius around target where squads should stay within.
Sets target position for encounter
Sets target Squad for encounter
Set encounter name for debugging.
Adjust default goal data for attack goals. Sets the default GoalData to the current defaults plus additionalDefaultGoalData; any values specified are used for unspecified encounter attack goal values.
Set default goal data for attack goals. defaultGoalData is cloned; any values specified are used for unspecified encounter attack goal values.
Set modify goal data for attack goals. modifyGoalData is cloned; values specified via keyname_Multiplier are used for the numeric keyname encounter attack goal value.
Set override goal data for attack goals. overrideGoalData is cloned; any values specified are used for encounter attack goal values.
Adjust default goal data for DefendArea goals. Sets the default GoalData to the current defaults plus additionalDefaultGoalData; any values specified are used for unspecified encounter DefendArea goal values.
Set default goal data for DefendArea goals. defaultGoalData is cloned; any values specified are used for unspecified encounter DefendArea goal values.
Set modify goal data for DefendArea goals. modifyGoalData is cloned; values specified via keyname_Multiplier are used for the numeric keyname encounter DefendArea goal value.
Set override goal data for DefendArea goals. overrideGoalData is cloned; any values specified are used for encounter DefendArea goal values.
Adjust default goal data for move goals. Sets the default GoalData to the current defaults plus additionalDefaultGoalData; any values specified are used for unspecified encounter move goal values.
Set default goal data for move goals. defaultGoalData is cloned; any values specified are used for unspecified encounter move goal values.
Set modify goal data for move goals. modifyGoalData is cloned; values specified via keyname_Multiply are used for the numeric keyname encounter move goal value.
Set override goal data for move goals. overrideGoalData is cloned; any values specified are used for encounter move goal values.
Checks if the cached path crosses known enemy territory
Delete the cached path with this ID, please remember to do this
returns true if enemy territory has been detected
Tests to see if any entity in the group is part of a wall that matches the supplied conditions eGroup contains list of entities to test, minSections is minimum number of connected wall sections, unbreached means all sections must be unbroken. Returns closest entity to refPosition
Returns the anchor build position
returns a 0-based index of the best clump of enemy squads within the given tolerance to the position passed in
returns a 0-based index of the best clump of enemy squads within the given tolerance to the AI squad
returns a 0-based index of the best clump of allied or enemy squads within the given tolerance to the AI player
returns a 0-based index of the best clump of allied or enemy squads within the given tolerance to the AI player
Returns a position that has the highest decayed traffic of either allies or enemies
returns a 0-based index of the best clump of owned squads within the given tolerance to the AI player
returns a 0-based index of the best clump of owned squads within the given tolerance to the AI player
Get the distance of the path requested with the given ID. < 0 means invalid request.
Return the path points of the calculated path from a previous pathfinding request if the result was successful and the path has at least two points.
Used for tactics; returns a "special error position" on failure that's nowhere inside the world
Returns a list of all resource deposit entities seen by the AI player
Returns the local AIPlayer given a PlayerId (1000 and up)
Returns the local AIPlayer given a Player pointer
Returns the Player at specified index out of all opponent players. Use in conjunction with AIPlayer_GetOpponentPlayerCount
.
Returns the number of opponent Players to the specified AIPlayer.
Used for tactics; returns a "special error position" on failure that's nowhere inside the world
Returns the utility of building the squad specified by the PBG, or 0 if not found
Returns a table of squad ids from the AIPlayer's state model corresponding to the given key.
Returns a boolean value from the AIPlayer's state model corresponding to the given key.
Returns a float value from the AIPlayer's state model corresponding to the given key.
Returns an integer value from the AIPlayer's state model corresponding to the given key.
Returns a PropertyBagGroup value from the AIPlayer's state model corresponding to the given key.
Returns a table of targets from the AIPlayer's state model corresponding to the given key.
Has path to target passes through a netural damaged structure
Returns whether the player is on an island (naval map) or not
Has the requested path been processed
Returns whether or not a point is threatened (from the perspective of the player passed in) If enemy builds are not filtered, allied will be. ThresholdFitness is from allied perspective. Typically you want to filter enemy buildings when defending, allied when attacking
Remove a multiplier previously applied to change the weight of a criteria in target scoring The multiplier will be removed from the table for the given tuningValueName. Pass in the multiplier id returned from AIPlayer_PushScoreMultiplier. Allowable strings for tuningValueName: front_line
Remove a multiplier previously applied to a unit type for target scoring The multiplier will be removed from the table for the given unitTypeName. Pass in the multiplier id used earlier with AIPlayer_PushScoreMultiplier.
Was the processed path successful? Only supply requestID for a processed path
Add a multiplier to change the weight of a criteria in target scoring The multiplier will be pushed to a table for the given tuningValueName. All multipliers in the table will be multiplied together and applied to the corresponding static tuning value. The multiplierID passed in can be passed to AIPlayer_PopScoreMultiplier to remove it. Allowable strings for tuningValueName: front_line DefendStructure AttackStructure EnemyClump
Add a multiplier to give weight to a unit type in target scoring The multiplier will be pushed to a table for the given unitTypeName. All multipliers in the table will be multiplied together and applied to targets with the corresponding unit type. multiplierId identifies the
Request a high path between the start and destination, supply a unique ID and the PBG of the largest entity that will be following the path.
Clears the ability priority override for all the abilities contained in the AIAbilityBag
Clears the ability priority override
Sets the ability priority override for all the abilities contained in the AIAbilityBag for all the AISquads owned by the player. -1 to disable the ability. NOTE: Encounter overrides have higher priority.
Sets the ability priority override for all the AISquads owned by the player. -1 to disable the ability. NOTE: Encounter overrides have higher priority.
Set the target distribution of how the ai player should use their units for gathering Second argument is a map of resource type names to weights ex: { ['wood'] = 5, ... }
marks the player to force the stats squads to update
Set the base strategic intention of a player
Toggle debug draw for the specified path, -1 will draw all of them
Updates what the skirmish AI is wanting to gather
Requests the skirmish AI to update attack encounters and capture tasks
Requests the skirmish AI to update player abilities
Updates what the skirmish AI is trying to produce
Requests the skirmish AI to update scout encounters
Create a AlliedCombatFitness scoring function. Returns 1.0 to 0.0, based on how the allied combat fitness is. 1.0 if the allied fitness is at or below minFitness, 0.0 if fitness is above the maxFitness, smooth transition in between. If highFitnessIsGood, returns 0.0 to 1.0 instead. 0.0 if at or below minFitness and 1.0 if at or above maxFitness.
Create a AlliedCombatFitness scoring function (versus strongest enemy). Returns 1.0 to 0.0, based on how the allied combat fitness is. 1.0 if the fitness is at or below minFitness, 0.0 if fitness is above the maxFitness, smooth transition in between. If highFitnessIsGood, returns 0.0 to 1.0 instead. 0.0 if at or below minFitness and 1.0 if at or above maxFitness.
Create a AlliedCombatFitness scoring function (versus the weakest enemy). Returns 1.0 to 0.0, based on how the allied combat fitness is. 1.0 if the fitness is at or below minFitness, 0.0 if fitness is above the maxFitness, smooth transition in between. If highFitnessIsGood, returns 0.0 to 1.0 instead. 0.0 if at or below minFitness and 1.0 if at or above maxFitness.
Check if now is an appropriate time to be making scoring functions. Score functions should only be made within functions referenced by ProductionGroups
Create a ClampedScoringFunction scoring function. Clamps the returned value of the inner scoring function
Create a CounterScore scoring function If a item is a chosen counter it will get the score = (baseScoreContributuion + (1 - baseScoreContributuion) * counter score)
Create a DropOffScore scoring function. Returns positive score if drop off is required to either serve gathering of a resource or improve existing gathering
Create a EntityCombatUpgrade scoring function. Returns positive score if entity's combat fitness is improved. The aforementioned entity is the entity that the upgrade is being produce on.
Create an IslandNeedingExpansionBase scoring function. Returns 1.0f if there is an island requiring an expansion base
Create a LackOfSecuredResourceDeposits scoring function. Returns between 0 and 1, 1 if the total sum of secured resource deposits is less or equal to scarce amount, 0 if the amount is equal to or greater than well off amount, lerps in between
Create a LuaScoringFunction scoring function. Takes a reference to a lua function. Lua function will be called and passed AIPlayer and Pbg. Lua function is expected to return a value >= 0.0 DO NOT call any methods that do stuff to the AIPlayer in your referenced lua function. The referenced lua function must exist within the player's lua context
Create a MaxPopCapPercentage scoring function targetPopulationPercentageAlive should be in range 0.0 -> 1.0. Return 1.0f as long as the combined population of the production item /group does not exceed a percentage of the player's max pop cap. If groupPopulation == true then all members of the item's Production Group are counted towards the current population to be compared against the target population.
Create a MaxWeaponDamage scoring function. Units max weapon damage is normalized by max damage. (returns between 0.0 and 1.0)
Create a MilitaryPlayerUpgrade scoring function. Quantifies how a player upgrade will improve the current army's combat fitness. Result = 1 - (1 - combat_fitness_improvment)^upgradeExponent
Create a MinimumGameTime scoring function. minGameTime is time from start in seconds. Returns 0.0 until minGameTime has passed, 1.0f after.
Create a MultipleProduced scoring function Item will get a score of 1 +(additionalFactor * number of additional produced)
Create a MultiplyListScoringFunction scoring function. Takes a list of scoring functions and multiplies them together. This scoring function can be paired with MaxScoringFunction to generate OR scoring expressions, such as Max(IslandNeedingExpansionBase, (ProductionQueueContention * TimeToAcquire))
Create a NavalTransportRequired scoring function. Returns 0.0 -> 1.0, depending on strategic island decisions that would require transport
Create an NotProducedRecently scoring function. Returns 1.0f if the item was not produced within the time period supplied, 0.0f otherwise
Create a OnlyProduceOneAtATime scoring function. Returns 0.0 while another item of the same type is being produced
Create a PlannedPlacementScore scoring function. Returns the value of the planned placement, returns 0.0 if no planned placement Will return 0.0 if placement score is below minPlacementScore. Set minPlacementScore < 0.0 to ignore this minimum filtering.
Create a PlayerGatheringUpgrade scoring function Result is gatheringImprovment * improvementScalingFactor
Create an AIPlayersOnDifferentIslands scoring function. Returns 1.0 if any players are on different pathfinding islands, 0 if they are all on the same island
Create a PopCapGenerator scoring function. Returns 1.0 score if the item generates required pop cap
Create a PopulationPercentage scoring function targetPopulationPercentageAlive should be in range 0.0 -> 1.0. Score will approach zero as an item's population (as a percentage of the global population) approaches the target, i.e. score = 1.0f - (currentPercentage / target)^dropOffFactor; The global population is number of squads or structures belonging to the player alive. If groupPopulation == true then all members of the item's Production Group are counted towards the current population to be compared against the global population. if useSquadPopulation == true, number of squads will be used in calculation instead of checking if the item pbg corresponds to a squad or building
Create a PresenceOfEnemyTypes scoring function Every time a unit type is observed it's weight is added to the return value of this scoring function. if squadTypes == false, then entity types assumed. Max return value is 1.0
Create a PresenceOfMyTypes scoring function Every time a unit type is observed it's weight is added to the return value of this scoring function. if squadTypes == false, then entity types assumed. Max return value is 1.0
Create a ProductionQueueContention scoring function. Returns a score of productionQueueContention / normalFactor. productionQueueContention is the number of contentions recorded for the associated item (which is a production building), normalFactor is clamped >= 1
Create an RemainingPersonnelPopCap scoring function. Returns 1.0f if there is enough remaining personnel pop cap, 0.0f otherwise
Create a ResourceGeneratorScore scoring function. Gives positive score if the item produces required resources
Create an AIShouldConsiderNaval scoring function. Returns 1.0 if players start on different islands or there are large bodies of water on the map
Create a StrategicIntention scoring function Weights table format: { ["weight name"] = weight, } The score is the sum of current intention values * weight, divided by the sum of weights Ex: (currentSiegeIntention* siegeIntentionWeight)/siegeIntentionWeight
Create a TierUpgrade scoring function. Returns 1.0f if the given BuildInfo is a Player Upgrade that unlocks higher tier of existing units
Create a TimeToAcquire scoring function TimeToAcquire returns values between 0 and 1 and penalizes things that need lots of resources or prerequisites to be produced. Score will approach 0.01 as the time to build something approaches maxTimeSeconds. Time to build something is the sum of the time to gather the outstanding resources, time to build the item, and time to build the requirements of the item
Create a ResourceDesireVsIncome scoring function. Returns 0.0 if no safe trade routes exist, 1.0 otherwise.
Create a UnderCountLimit scoring function Keeps an item within limits. If groupPopulation == true then all members of the item's Production Group are counted towards the current population to be compared against the limit.
Clears a TargetHandle value in the AISquad's state model corresponding to the given key and table row index (0 based).
Clears a TargetHandle value in the AISquad's state model corresponding to the given key.
Find the best squad target which is not part of a clump.
returns the best squad target in the sgroup based on the passed tacticTargetPolicy policy is one of: AITacticTargetPreference_None, AITacticTargetPreference_Near,
Tries to find cover within a certain radius of a position, traveling a max distance to get there, and possibly comparing against current position's cover. If no cover is found, it returns an invalid position
returns the safest position for the AISquad in the current encounter leash area
Returns the closest cuttable obstruction entity to the given squad
Returns the closest obstruction entity to the given squad
Returns the closest obstruction entity to the given squad
Get the position on the far side of the given clump relative to the given squad.
returns the current fallback position
Returns a boolean value from the AISquad's state model corresponding to the given key.
Returns an Entity value from the AISquad's state model corresponding to the given key.
Returns a boolean value from the AISquad's state model corresponding to the given key and table row index (0 based).
Returns an Entity value from the AISquad's state model corresponding to the given key and table row index (0 based).
Returns a float value from the AISquad's state model corresponding to the given key and table row index (0 based).
Returns an integer value from the AISquad's state model corresponding to the given key and table row index (0 based).
Returns a pbg value from the AISquad's state model corresponding to the given key and table row index (0 based).
Returns a Player value from the AISquad's state model corresponding to the given key and table row index (0 based).
Returns a Squad value from the AISquad's state model corresponding to the given key and table row index (0 based).
Returns a Vector3f value from the AISquad's state model corresponding to the given key and table row index (0 based).
Returns a float value from the AISquad's state model corresponding to the given key.
Returns an integer value from the AISquad's state model corresponding to the given key.
Returns a pbg value from the AISquad's state model corresponding to the given key.
Returns a Player value from the AISquad's state model corresponding to the given key.
Returns a Squad value from the AISquad's state model corresponding to the given key.
Returns a Vector3f value from the AISquad's state model corresponding to the given key.
Checks if the squad has been attacked within this time
Checks if the squad has fired its weapon within this time
returns true if the AISquad is currently running the AISquadAbilityTactic for the passed abilityPBG
Sets a boolean value in the AISquad's state model corresponding to the given key.
Sets a boolean value in the AISquad's state model corresponding to the given key and table row index (0 based).
Sets a float value in the AISquad's state model corresponding to the given key and table row index (0 based).
Sets an integer value in the AISquad's state model corresponding to the given key and table row index (0 based).
Sets a pbg value in the AISquad's state model corresponding to the given key and table row index (0 based).
Sets a float value in the AISquad's state model corresponding to the given key.
Sets an integer value in the AISquad's state model corresponding to the given key.
Sets a pbg value in the AISquad's state model corresponding to the given key.
Checks if the squad should fall back or brace itself given the current situation.
On the AIPlayer statetree, spawn a Root Controller with tunings that can be pushed onto the Root Controller's StateModel.
calculates a valid target position for a jump slide ability
Get tactic priority for a squad. Return -1 if the tactic type isn't found.
Adjust default goal data for TownLife goals. Sets the default GoalData to the current defaults plus additionalDefaultGoalData; any values specified are used for unspecified encounter TownLife goal values.
Set default goal data for TownLife goals. defaultGoalData is cloned; any values specified are used for unspecified encounter TownLife goal values.
Set modify goal data for TownLife goals. modifyGoalData is cloned; values specified via keyname_Multiply are used for the numeric keyname encounter TownLife goal value.
Set override goal data for TownLife goals. overrideGoalData is cloned; any values specified are used for encounter TownLife goal values.
overrides the Heavy Cover Occupancy for the passed EBP
Adds a prefab to the AIPrefab system. Target must be set up in a follow up call with returned ID
Get combat fitness estimate. Return value will be between 1.0 and 0.0. 1.0 means teamA wins outright, 0.0 means teamB wins outright. Buildings will be filtered from attacking team
Clear a combat entry from the cache, typically done instead of logging it
This clears the repair priority value for a given squad or building PBG. pbgShortname is the PBG of the squad or building to clear its priority value.
Returns true if the configured input feature calculators characterizes this squad
Returns the defensive upgrades for this structure archetype member
Returns healer feature option pbgs
Returns the offensive upgrades for this structure archetype member
Returns the player upgrades configured in the player upgrade input calculator
Returns squad pbgs for all squad archetypes
Returns squad pbgs for a given archetype (assuming that archetype is composed of squad pbgs)
Returns entity pbgs for a given archetype (assuming that archetype is composed of entity pbgs)
Converts an AIEntity into an Entity
Converts an AIPlayer into a Player
Converts an AISquad into a Squad
Create the combat feature logs in the game log directory
Create a new encounter for player EncounterType is one of: AIEncounterType_DefendArea, AIEncounterType_AttackArea, AIEncounterType_Move, AIEncounterType_Ability,
Enables/disables debugging of AI Attack Encounter Encounter Position Scoring
Returns true if AI Attack Encounter Position Scoring is enabled
Prints detailed rating debug info in the AILog for all the PBGs in the list
Enables/disables AI Lua Debugging
Returns true if AI Lua Debugging is enabled
Enables/disables AI Construction Debugging
Returns true if AI Construction Debugging is enabled
Enables/disables AI Rendering of All Task Children
Returns true if AI Rendering of All Task Children is enabled
Enables/disables AI Skirmish ForwardDeploy Debugging
Returns true if AI Skirmish ForwardDeploy Debugging is enabled
Disable all of the economy overrides for the AI player
Disables all encounters
Run this string in the AI of player
Enables/Disables an AI player
Enables/Disables all AI players
Enables all encounters
Enable or disable the economy override for the AI player
Finds an AISquad owned by the specified player
Find the current best producible Entity PBG corresponding to the specified Entity Types.
Find the current best producible Squad PBG corresponding to the specified Squad Types.
Find the closest open position from a given position for a given ability blueprint
Find the closest open position from a given position and ability blueprint, taking into account a min
Find the closest open position from a given position for a given Entity blueprint
Find a valid construction location for a pbg, using a spiral search. Returns INVALID_POS if it fails.
Returns the maximum number of targets for the given ability, or -1 if the ability is invalid.
Returns a table with all active (not dead) encounters.
Stores entities of a specific type owned by a player in an egroup parameter
Get and reserve the next available AITaskID (which can be used to create an AIEncounter from SCAR).
Returns the current squad target for the given squad (null if no target, or target is non-squad entity)
Get current AI player ID
Gets the difficulty level of this AI player Levels can be one of: AD_Easy, AD_Standard, AD_Hard, AD_Hardest
Returns the number of alive encounters currently managed by the AI manager.
Get the personality name of this AI player
Get the personality lua file name of this AI player
Returns true if player is an AI player
Returns true if player is an AIPlayer and is targetable by other AI players.
Checks if the AI debug display is enabled
Returns true if player is a AIPlayer and is enabled
Returns true if the player is an AIPlayer running on the local machine
Returns True if the current AI_Manager difficulty matches any in a given list.
Checks if this is a valid AISquad
Find a AI module that's associated with a squad or sgroup
Find a AI module that's associated with a squad or sgroup
Takes a target, fallback, or spawnLocation, which can come in many formats, and converts it to a combatArea.
Overrides the current difficulty setting (only for the AI Manager). Pass 'nil' to reset to Game_GetSPDifficulty() value
Pauses or unpauses currently running tasks
Set a named bool value in the AIPlayer DataDictionary
Set a named number value in the AIPlayer DataDictionary
Set a named PBG value in the AIPlayer DataDictionary
Clears goals on all encounters, then empties the encounter list. Can also issue a stop command to all units.
Restarts the AI
Restores the default personality and difficulty settings of this AI player
Set Combat Range Policy for the AISquad, overrides the one set at Encounter/task level policy is one of: AICombatRangePolicy_Default, AICombatRangePolicy_Ranged_MinRange, AICombatRangePolicy_Ranged_MaxRange, AICombatRangePolicy_MeleeRange
Enables or Disables an AI player to be targetable by other AI players.
Enable or disable the AI debug display
Set the level of debug information shown but Ai:Print().
Sets the default player to use when creating an encounter.
Set the difficulty level of this AI player Levels ca be one of: AD_Easy, AD_Standard, AD_Hard, AD_Hardest
This sets the repair priority value for a given squad or building PBG. pbgShortname is the PBG of the squad or building to change its priority value. priorityValue must be within range [0, 1], with higher value being more desirable to repair.
Set the personality name of this AI player
Set an AI Player's desired income of specified resource type at specified value. This will affect the AI resource gathering, building construction and production priority in trying to achieve the specified resource income.
Clear a named Squad in the AISquad DataDictionary
Get a named bool value in the AISquad DataDictionary, returns false if the value doesn't exist
Get a named number value in the AISquad DataDictionary, returns 0 if the value doesn't exist
Get a named Squad in the AISquad DataDictionary, returns null if the entry doesn't exist
Set a named bool value in the AISquad DataDictionary
Set a named number value in the AISquad DataDictionary
Set a named PBG value in the AISquad DataDictionary
Set current debug AI player to the next AI player
Toggle encounter/goal debug information on screen.
Toggles the AI debug display
Toggle printing console debug information for encounters.
Re-updates the AI in regards to all the static objects in the world (if SCAR creates new strategic points dynamically this will need to be called)
Set whether or not an action marker is visible.
Start the given action marker's FX.
Stop the given action marker's FX.
Adds all the units in a battalion to a given module
Adds resources to a given player
Dissolves a module and folds its units into another module
Dissolves a module
Moves units to a given marker
Notifies the player of something
Enable or diable a group of abilities for one or more players; useful for hiding glows. data can be a string (ability short name), a table of such strings. To deactivate for a player other than Player 1, pass in a table or tables as such: {player = playerID, abilities = {"name","name"}} Triggers the mission start title card (as long as it is properly defined in mission recipe)
Spawns a new entity at a given location (only once, since many entities don't like overlapping)
Spawns new units and adds them to a given module
Spawns new units at a given location
Plays a speech event for a given actor WITH a portrait and subtitle If the speech file is not available, a placeholder time will be calculated for the message using the number of words and the message will be displayed for that length of time.\n speechbubble: Who a speech bubble should appear over ingame. Can be a squadID or an SGroup (where it appears over the first guy in the group) \n It can also be a table in the format {sgroup = sg_orkboys, closest_to = sg_gorgutz} where it finds the squad in the group closest to the reference point. It can also be in the format {sbp = SBP.ORKS.ORK_BOY, closest_to = mkr_orkIdol} to find the closest unit of the specified type, and you can also add a player entry to that table to specify which player (default is the local player)\n You can also specify just an SBP, in which case it will play on the first SBP found owned - use this for elite units who may or may not be on the map audioCtrlEvent: is a wwise event name. This parameter is used to apply an effect on the line of speech. Ex. "Comm_on" plays speech through a comm effect. Work with an audio designer to get more effects.
Plays a speech event for a given actor WITHOUT a portrait or subtitle. See Actor_PlaySpeech for more details
Returns all ScarMarkers from the Mission Editor with the given name. If you don't care about the type, pass in an empty string ( "" ) The type is defined in the markers list of the mission editor when placing markers.\n
Returns all ScarMarkers from the Scenario Editor with the given name. If you don't care about the type, pass in an empty string ( "" ) The type is defined on the ScarMarkerBlueprint in the Scenario Editor\n
Converts an angle in degrees (0-360) to a short string representing a compass heading. 0 degrees is north; 90 degrees is east.
Remove the movie mode framerate restriction
Run the game at specified frame rate (for capturing movies). Only works with 60 or 120, other rates are defaulted to 60. Setting it to 0 disables movie mode
Predicate testing if a value is of specific type Performs basic type-checking on [value] Makes an assertion. If the assertion turns out to be false, raises an error. e.g. foo = 7; assert(foo ~= nil, 'foo should not be nil!', 'If foo is nil we don't know how many bars to spawn!'') This is intended to be a more scripter friendly version of LUA assert. e.g. foo = 7; std.Validate(foo, 'foo', T_NUMBER, false) e.g. f = std.TypePredicate(); f() => 1; f() => 2 ...
Checks if Resources_Disable is currently applying to a player.
Checks if Resources_Disable is currently applying to a player.
assigns each tradecart to trade
assigns each villager to gather from the nearest bush
assigns each villager to "gather" from the nearest deers
assigns each villager to gather from the nearest farm
assigns each villager to gather from the nearest bush
assigns each villager to gather from the nearest gold mine
assigns each villager to "gather" from the nearest sheep
assigns each villager to gather from the nearest stone mine
assigns each villager to gather from the nearest tree
Support modules may not exist yet, so let's delay this until we've initialized everything
Stops the Attack module entirely and returns the units it contained
Finds what Attack module is currently using a given encounter
Returns how many units this module started with
Returns the units currently in the module as a percentage of the unit count the module started with
Gets the SGroup of units involved in this Attack module
Returns the difference between the current amound of units and the starting unit count
Returns true if all the Attack module's units are dead
Callback function that signals to a module that its current encounter is completed
Updates the target of an Attack module. newTarget can be a Location (either as a String or a LocationTable), or a MarkerID or Position
Activates an audio trigger
Verifies whether an audio trigger can start playing
Regularly check an Audio Trigger's conditions and update accordingly
Regularly check an Audio Trigger's conditions and update accordingly
Deactivates an audio trigger
Sets up a Leader unit's custom Leader behaviour for use in a campaign mission
Sets up a Leader unit's custom Leader behaviour for use in a campaign mission
Completely removes an audio trigger from the mission
Returns an AIAbility property bag group.
Returns an AIAbility property bag group.
Returns an AIFormationCoordinator property bag group.
Returns an AIFormationCoordinator property bag group.
Returns an AIFormationTargetPriority property bag group.
Returns an AIFormationTargetPriority property bag group.
Returns an AIStateModelTunings property bag group.
Returns an AIStateModelTunings property bag group.
Returns an ability property bag group.
Returns an ability property bag group.
Returns an entity property bag group.
Returns an entity property bag group.
Get a table of all of the EBPs that match a particular EntityType. You can pass in a table of multiple EntityTypes to get a list EBPs that match ANY of the types listed. If you want a blueprint to match a bunch of EntityTypes at the same time (i.e. AND instead of OR) then those types should be listed together in a sub-table. This function can potentially be quite slow as it has to parse every EBP in the game, so be careful about how you use it.
Returns the child blueprint of the specified entity blueprint at specified index.
Returns the number of child blueprints of the specified entity blueprint.
Returns the parent blueprint of the specified entity blueprint at specified index
Returns the number of parent blueprints of the specified entity blueprint.
Returns race blueprint associated with an entity blueprint type_ext at specified index.
Returns the number of race blueprints associated with an entity blueprint type_ext.
Returns a table containing the ui_ext info for given entity
Returns a map pool property bag group.
Returns a map pool property bag group.
Returns a move type property bag group.
Returns a move type property bag group.
Return the path name of the group Example name would be "abilities\ally_mad_minute_ability"
Returns an pass type property bag group.
Returns an pass type property bag group.
Return the number of property bag groups of the same type Example type would be PBG_Critical
Return the path name of the group Example name would be "abilities\ally_mad_minute_ability"
Returns a UIReticuleBag property bag group.
Returns a slot item property bag group.
Returns a slot item property bag group.
Returns a squad property bag group.
Returns a squad property bag group.
Get a table of all of the SBPs that match a particular SquadType. You can pass in a table of multiple SquadTypes to get a list SBPs that match ANY of the types listed. If you want a blueprint to match a bunch of SquadTypes at the same time (i.e. AND instead of OR) then those types should be listed together in a sub-table. This function can potentially be quite slow as it has to parse every SBP in the game, so be careful about how you use it.
Returns the child blueprint of the specified squad blueprint at specified index.
Returns the number of child blueprints of the specified squad blueprint.
Returns the parent blueprint of the specified squad blueprint at specified index
Returns the number of parent blueprints of the specified squad blueprint.
Returns race blueprint associated with a squad blueprint squad_type_ext at specified index.
Returns the number of race blueprints associated with a squad blueprint squad_type_ext.
Returns a table containing the ui_ext info for given squad and race
Returns the type of a blueprint.
Returns an upgrade property bag group.
Returns an upgrade property bag group.
Returns a table containing the ui_ext info for given upgrade
Returns a weapon property bag group.
Returns a weapon property bag group.
Returns true if the UpgradePGB's list of types includes the given type
Queue moving the camera along a spline consisting of entity/marker/pos/egroup/sgroup/squad objects within seconds. The camera will move from the position that was in front of it in the pan queue along the positions provided. Catmull-Rom interpolation between points is used
Clamps the camera's target position to a marker
Moves the camera through a list of positions.
Execute spline pan based on queued control points. Use B-Spline interpolation of points
Executes a camera pan that was captured using the Capture Tool. Expects that the "camera_spline" Camera set was pushed to the CameraSwitchboard, using Camera_Push("camera_spline") Returns the duration of the spline, so that the user can call Camera_Pop()
Execute spline pan based on queued control points. Use Catmull-Rom interpolation of points
Execute spline pan based on queued control points. Use linear interpolation between points
Camera would move to the specified position. bPan is a boolean flag that pans the camera if set to true
Set the camera to follow an sgroup/squad/egroup/entity. The camera will follow them until the player takes control again.
Camera will follow specified entity
Camera would follow current selection
Camera will follow specified squad
Get the current position for the camera. (Where the the camera currently is.)
Get the current target position for the camera. (Where the the camera currently is.)
Get the current camera declination (tilt)
Get the default camera orbit (rotation).
Get the current camera orbit (rotation)
Get the pivot of the camera. (The position about which the camera is pivoting). For autodeclinate camera, this is the lookat position.
Get the current position for the camera. (Where the the camera currently is.)
Get the current target position for the camera.
Get the current zoom distance for the camera.
Hide the camera mesh.
Returns the enabled/disabled state of the camera input.
Is the camera mesh being shown?
Queue moving the camera along a spline consisting of entity/marker/pos/egroup/sgroup/squad objects within seconds. The camera will move from the position that was in front of it in the pan queue along the positions provided. Linear interpolation between points is used
Move the camera to an entity/marker/pos/egroup/sgroup/squad at a given speed
Slightly refocus the camera to rest on an entity/squad/squad/sgroup/egroup/pos/marker if it's close by. This function can be called through a CTRL object in NISlets.
Queue moving the camera a certain distance from the position of the camera in a specified amount of time. The position used is the position the camera will be in after completing the movement(s) queued in front.
Queue moving the camera to an entity/marker/pos/egroup/sgroup/squad within seconds. The camera will move from the position that was in front of it in the queue.
Queue a spline control point by position relative to the last queued position. Pan is deferred until requested by an execution function
Queue a spline control point by absolute position. Pan is deferred until requested by an execution function
Clears state info related to camera focus
Set the current camera orbit relative to the current orbit (relative rotation).
Reset the camera to its default rotation.
Reset camera position to default home position
Rotate the camera relative to its current rotation in degrees.
Rotate the camera to a given angle in degrees.
Set the current camera declination (tilt)
Set the default camera declination (tilt).
Set the default camera orbit (rotation).
Set the default zoom distance for the camera.
Enables / Disables camera input.
Set the current camera orbit (rotation)
Set the current camera orbit relative to the current orbit (relative rotation).
Set the current zoom distance for the camera.
Show the camera mesh.
Orbit the camera a given number of degrees clockwise from the current orbit position in a given amount of time.
Orbit the camera to an end orbit position from the current orbit position in a given amount of time. Will choose shortest rotational direction.
Pan the camera to a position in a given amount of time from the position in front of the queue.
Pan the camera by some amount in a given amount of time. This is relative to the position in front of the queue.
Start a transition to a relative zoom distance over a certain amount of time.
Start a transition from one zoom distance to another over a certain amount of time.
Start a transition to a zoom distance over a certain amount of time.
Stop an ongoing camera pan.
Toggle the debug free camera
Toggle the camera mesh.
Frees up the camera (so it's not clamped to a marker anymore)
Converts an entity type (or set of types) into a suitable entity blueprint The types listed are used to track down a specific blueprint, and the list can be augmented with information from the provided player if it isn't specified directly (for things like civilization)
Converts a squad type (or set of types) into a suitable squad blueprint The types listed are used to track down a specific blueprint, and the list can be augmented with information from the provided player if it isn't specified directly (for things like civilization)
Adds a function to the Mission Cheat menu, under the title you provide. These should be registered in the Mission_Preset function. If the restartMission flag is set, when the cheat is activated the mission will be restarted. Most of the startup script happens as normal: Mission_SetupVariables, Mission_SetDifficulty, Mission_SetupRestrictions and Mission_Preset are all called as normal, but the supplied function is called INSTEAD OF the regular Mission_Start function.
Adds a function to the Mission Cheat menu, under the title you provide. These should be registered in the Mission_Preset function. When activated, the mission is restarted. Most of the startup script happens as normal: Mission_SetupVariables, Mission_SetDifficulty, Mission_SetupRestrictions and Mission_Preset are all called as normal, but the supplied function is called INSTEAD OF the regular Mission_Start function.
Cheat to award all ribbons and medals
Cheat to reset all achievement progress
Clones a table allowing for unadulterated use of the data. By default this cloning is done recursively, but that can be changed with the optional recursive flag.
Order a squad group to abandon their current team weapon if they have it and they could (tuning value in attribute editor)
Sends an ability command to a player, egroup or sgroup. extra parameters are provided if the ability requires them.
Order a squad group to attack move to a position (anything whose position can be queried). can be queued, can follow a plan, can search for cover within a radius
Orders a squad to contruct a building at specified position, or to continue construction on an existing building. The command also checks to see if a building already exists at the location, and the squad will continue building it, if it is of the correct type.
Move a squad group in a formation to a given position and delete it when it arrives, potentially calling back a function.
Stops formation of squads
Order a squad group to load at a random entity or squad of the group overload is a flag that will allow the hold entity to ignore maximum slot check
Order a squad group to hold position at a given location (or just it's current location) The location parameter can be a position (to hold position at that location), or a Boolean to enable/disable HoldPosition at the current location. If it's omitted entirely, it defaults to true.
Sends a instant reinforce command to all squads in a group. count represents the number of commands to send. Note: This function bypasses pre-reqs, costs and the production queue
Order a squad group to instant setup their team weapon
Move a squad group to a given position. Supports facing, 'offset' movement, and can find cover. The sgroup can be deleted when in proximity of a marker (it assumes a proximity of 5 if you forget to set one on the marker)
Move a squad group to a given position, attack-moving once close enough Squad will move to a position, once they're within 'distance', they will attack-move the rest of the way.
Sends a reinforce command to all squads in a group. count represents the number of commands to send. Note: To reinforce squad bypassing the pre-reqs and costs use Cmd_InstantReinforceUnit.
Order a squad group to retreat, optionally to a specific location. The sgroup can be deleted when in proximity of a marker (it assumes a proximity of 5 if you forget to set one on the marker) vulnerableRetreat will make retreating squads take more damage
Order a squad group to setup their team weapon with animation
Sends an camouflage stance command to all squads in a group. stanceid should be the number returned by Util_GetCamouflageStanceID( stancename )
Send a command to the squad to follow a path. Can wait at each waypoint. The sgroup can be deleted when in proximity of a marker if you pass in the marker as the 7th argument (it assumes a proximity of 5 if you forget to set one on the marker) loop can be: LOOP_NONE, LOOP_NORMAL, LOOP_TOGGLE_DIRECTION
Retreats large numbers of units in a staggered, realistic manner. vulnerableRetreat will make retreating squads take more damage Each Squad in the sgroup will have a 1 in 3 chance to retreat. After 10 seconds (or maxTries), all squads will be forced to retreat. Squads will delete on arrival at their retreat point.
Pass in a group to command to 'stop'. Pass in booleans for capturing and building
Orders a squad to surrender and awards the local player with an appropriate number of action points The command will also overwrite the exit position as well, if you do not want the squads to exit at the map entry point. Use the optional parameter to assign action points to override the default number. The function automatically addresses squads that are in buildings or vehicles by ordering them out of the vehicle.
Basic test: can all buildings take damage
Basic test: can all combat units take damage and deal damage?
Test whether blueprint_name (squad) can kill a villager
Test whether blueprint_name (entity/building) can be killed by a trebuchet
Test whether blueprint_name (squad) can kill a villager. This test works better for naval attackers
Test whether blueprint_name (squad) can be killed by a combat unit. This test is specifically adjusted for naval units.
Test whether blueprint_name (squad) can be killed by a combat unit
Returns true if a given player has spotted a given set of buildings, either any or all
Checks if a given egroup has living members or not
Checks whether a player has a certain number of units, optionally of a certain type
Checks if a unit with the condition's tag is at the given marker
Checks if all units belonging to a player are close enough to a given marker
Compare two values using provided comparator
Returns the number of non-eliminated teams remaining.
Returns the table reference of a player's TEAMS table entry
Returns the table reference of a PLAYERS table entry
Returns the table reference of a PLAYERS table entry
Returns the entry in the Teams table that corresponds to the given teamIndex. NOTE: Use the teams table's .id entry - not the actual index of the table.
Returns true if a module is registered for delegate invocation, false if delegate invocation is disabled, nil if module not in module registry.
Returns true if a player is eliminated from the game.
Returns true if the two given players are on the same team.
Returns true if the PLAYERS table contains the given player.
Returns true if a team is eliminated from the game. A team is considered eliminated when all of its players are eliminated.
Returns true if teamIndex is a valid index in the Teams table. NOTE: Use the teams table's .id entry - not the actual index of the table.
Call this function to notify other modules (via their ***_OnGameOver() callback) that the match is about to end. Modules typically implement this for cleanup purposes (i.e. remove rules and UI elements) prior to the match end UI.
Registers a script module for delegate invocation. The name should be the prefix used by all of the delegate functions in this module. This needs to be called in global scope of a module script with the prefix name of that module; use this instead of Scar_AddInit. For example, if you call Core_RegisterModule("MySystem") then any delegate functions in your script such as "MySystem_OnGameSetup" or "MySystem_OnInit" will be called at the appropriate time during the game initialization process (after the Project delegates but before the Mission delegates).
Removes a player from player and team tables.
Returns the value of the "Reveal FOW on Elimination" match option
Sets the default presentation table for defeated players.
Sets the default presentation function for victorious players.
Sets the relationship between two entries Valid Relationships: R_NEUTRAL, R_ALLY, R_ENEMY, R_UNDEFINED NOTE: You should generally be setting Team to Team only.
Sets a player as defeated.
Sets a player as the match winner.
Sets if a team is defeated
Sets a team as the match winner.
Removes a script module from the delegate invocation system. This is usually used for a module to remove itself if it decided it isn't needed (i.e. a game mode that isn't relevant given the map). Please don't have modules removing each other!
Set the game to a GameOver state without an explicit winner
Toggle cursor position distance drawring
Toggle clearing of cursor over entity weapon shot history debug display
Toggle cursor over entity weapon shot history debug display
Toggle cursor position information
Toggle cursor over entity weapon information
Toggle cursor over entity weapon range information
Toggles on or off under mouse check. If ignoring mouse check, all entities will have the enabled debug info displayed
Returns a string describing the Scartype
Returns a string describing the Scartype
Allows the local player to issue commands to any unit regardless of ownership.
Toggles on or off all debug test activity
Add a decal to the terrain. Returns a unique decal id allow for future removal via Decal_Destroy
Destroy a decal by unique id
Get the Decal ID that represents an invalid decal (useful to check if creation failed)
Returns the current decal id in use; used in conjunction with Decal_RemoveAllDecalsAfterId
Erases all placed decals after id (inclusive); used in conjunction with Decal_GetNextDecalId
Adds an SGroup of new units to this module's existing SGroup
Creates a new encounter
Stops the Defend module entirely, optionally returns the units it contained to an SGroup, which is NOT cleared
Finds what Defend module is currently using a given encounter
Returns how many units this module started with
Returns the units currently in the module as a percentage of the unit count the module started with
Retrieves the units associated with this SGroup result SGROUP
Returns the difference between the current amound of units and the starting unit count
Initializes a new Defend module
Returns true if all the Defend module's units are dead
Updates the Defend module based on mission context
Removes an SGroup from this module's existing SGroup
Manually orders the module to request units.
Stops the Defend module's encounter
Updates the target of a Defend module. newTarget can be a Location (either as a String or a LocationTable), or a Marker or Position
Query the display adapter database for a boolean setting override.
Query the display adapter database for a floating-point setting override.
Query the display adapter database for an integer setting override.
Output the installed display adapter driver version, the required version for the current adapter, and whether or not the installed version is equal to or greater than the required one.
Query the display adapter database for a uint16 setting override.
Query the display adapter database for a uint8 setting override.
Query the display adapter database for a uint32 setting override.
Query the display adapter database for information about a specified adapter.
Output basic information about the current display adapter.
Query the display adapter database for the minimum required driver version for a specified adapter.
Query the display adapter database for the performance class of the currently-installed display adapter.
Output basic information about the currently installed display adapter driver.
Query the display adapter database for the performance class given a relative performance percentage.
Dissolves a module and folds its units into another module
Draw the ref-posed OBB of a model
Returns true if an entity blueprint exists with the given name.
Returns whether the entity blueprint is of specified race
Adds an ability to all entities in an egroup.
Appends the entities in one group to another group. All entities from 'grouptoadd' will be added to 'group'. If 'group' already contains an entity from 'grouptoadd' it will not be added. This function does not clear the contents of 'grouptoadd'. Example: Add group2 (0, 10, 11, 22) to group1 (1, 11, 20) --> group1 would now be (1, 11, 20, 0, 10, 22)
Calls an Entity_ function on every entity in an egroup The first parameter of the supplied function must be EntityID
Returns whether ALL or ANY entities in an egroup satisfy a condition, using an Entity_ function to perform the query on each entity The first parameter of the supplied function must be EntityID
Removes all entities from a group
Instantly adds an upgrade to all entities in a given EGroup.
Check if a group contains ALL or ANY of the blueprints.
Returns the total number of spawned and despawned entities in a group.
Get the number of alive entities (both spawned and despawned)
Returns the total count of all entities in a given EGroup with the provided blueprint
Returns the number of despawned entities in a group.
Returns the number of spawned entities in a group.
Returns a new entity group with the given name. Entity groups are used for buildings and objects such as rocks and trees. If you need to issue orders to a group vehicles or units you must use a SquadGroupObs.
Find a entity group from name. Creates a new one with given name if it doesnt exist.
Create and display kicker message on the each entity in the egroup to the player
Returns a table of egroups NOT in the world builder See Marker_GetTable for more info on format parameter
Returns an EGroup with a unique name, prefixed by the 'prefix' parameter.
Returns a new entity group with an autogenerated unique name, optionally prefixed by the string passed in. Use this if you want to create a new EGroup but don't necessarily care about the name.\n Entity groups are used for buildings and objects such as rocks and trees.\n
Despawn all spawned entities in a group.
Manually destroy a group that you dont need anymore.
Destroys all spawned and despawned entities in a group.
Enables or disables the minimap indicator for all entities in a group
Enable or disable decorators on all entities in the egroup. Sets selection visuals as well unless enableSelection is specified.
Returns true if the entity group with the given name exists
Filters an EGroup by whether units are on screen or not. Percent refers to the screen area you are considering (0.8 is a good value to use - it won't include things that are right at the screen edge). Setting filtertype to FILTER_KEEP results in the group only containing those entities that are on screen.
Filters an EGroup by construction status. Set the filtertype to FILTER_REMOVE to remove buildings under construction. Setting filtertype to FILTER_KEEP results in the group only containing those entities that are in the process of being built.
Call a lua function for each item in a group. Function will recieve (groupid, itemindex, itemid) and should return true to break or false to continue. function Rule_Test( )  local DespawnEntity = function( egroupid, itemindex, entityID )   Entity_Despawn( entityID )  end  EGroup_ForEach( EGroup_FromName("eg_PlayersHQ"), DespawnEntity ) end Note: This function iterates over SPAWNED ENTITIES ONLY.
Call a lua function for each item in a group. Function will recieve (groupid, itemindex, itemid) and should return a bool. Only use this to TEST conditions on entities. DO NOT use this to perform operations on all entities, since it may not call your function on all entities (due to short circuit evaluation). This is used for checking if ALL or ANY items in a group match a given predicate. (eg. Are all items in a group choas marines) Note: This function iterates over SPAWNED ENTITIES ONLY.
Same as EGroup_ForEachAllOrAny except you have a choice to iterate over spawned entities, despawned entities, or both.
Same as EGroup_ForEach except you have a choice to iterate over spawned entities, despawned entities, or both.
Find an entity group with a given name.
Returns the average health ratio of all units in a entity group. This uses the "proper" measure of health for panel buildings, so should accurately reflect what the user sees.
Returns the entity at the given index. Use EGroup_GetSpawnedEntityAt or EGroup_GetDeSpawnedEntityAt if you want the spawned/despawned items in the group\n Use index 1 to get the first entity in the group.\n It is an error if index > EGroup_GetCount()\n
Check invulnerablity state for ALL or ANY entity in an entity group.
Returns the name of a given entity group.
Builds a table of EGroupIDs that are named in a sequence. i.e. a name of "eg_building" will find groups "eg_building1", "eg_building2" and so on, up until it looks for a group that isn't there.
Returns the distance from the centre of the group of the entity that furthest out.
Returns the total health of all units in a entity group. This uses the "proper" measure of health for panel buildings, so should accurately reflect what the user sees.
Returns the total health of all units in a entity group, excluding entities that currently cannot be damaged. This uses the "proper" measure of health for panel buildings, so should accurately reflect what the user sees.
Returns a table of egroups from the world builder See Marker_GetTable for more info on format parameter
Test whether ANY or ALL buildings in a group have a specified ability
Check if ANY or ALL of the entities in a group match the blueprint specified. The blueprint can be a table of blueprints or types (see Entity_HasBlueprint() for details)
Hide or show all entities in an EGroup Bool should be true to hide, false to show
Reverts an occupied building
Performs a group intersection. Only entities that are in both groups will be added to 'group'. The contents of 'grouptointersect' will not be changed. Example: group = (1,2,3,4,5,6) grouptointersect = (2,4,6,8,10) --> group will now equal (2,4,6)
Checks if ANY or ALL entities in an egroup are on fire (ignition threshold exceeded)
Returns true if ALL or ANY entities are attacking within the time
Returns true if a named entity group contains no spawned or despawned entities
Returns whether any entity in an EGroup has a hold on anything
Returns true if ALL or ANY entities are in cover.
Returns true if ANY or ALL entities in an EGroup are moving.
Returns true if ANY or ALL (use those keywords) of the enities in the group are present onscreen. You can pass in a percentage of the screen to check, so 0.8 would be a centered rectangle occupying 80% of the screen.
Returns true if ALL or ANY entities in a group are currently producing squads Set all to true to check for ALL or set to false to check for ANY
Checks if ANY or ALL entities in an group are currently spawned or not.
Returns true if ALL or ANY entities are under attack within the time
Returns true if ALL or ANY entities are under attack from a direction within the time. see ScarUtil.scar for types of directions. you can pass in a table of offsets
Checks if ANY or ALL squads within an EGroup are using an ability also used for emplacements/entities that are built but function through the use of squads. Does not check WHAT ability a squad is using.
Check to see if an egroup still exists without needing the name.
Kill all entities in an EGroup
Calls a function when any entity in an EGroup gets destroyed by the player clicking the "Detonate me" button
Respawn all despawned entities in a group.
Removes all demolition charges on an egroup
Removes all the entities from the EGroup that don't have HoldExt on them
Removes upgrade(s) from an egroup
Restore the targeting type of the entities in this EGroup to their respective defaults (as found in their EBPs)
Trigger animation action for an EGroup. Please only use this for simple animations
Set animation event for an EGroup. Please only use this for simple animations
Set animation state of a state machine for an EGroup. Please only use this for simple animations
Set animation variable value for an EGroup. Please only use this for simple animations
Sets whether a weapon to auto-target things or not
Sets the health of each unit in an entity group to a given percent [0.0, 1.0].
Enables or disables the burn extenstion
Overrides crushable behavior for an egroup
Set the minimum health for this entity This is usually set to zero, any higher value prevents the entity from having its health reduced below this given value
Enable/Disable invulnerablity for an entire entity group. Use true and false for simple on/off, or use a number between 0.0 and 1.0 for more precise control on how much damage an entity can take before it takes no more. The optional reset_time is used to automatically remove invulnerability after a set time. If invulnerable, health damage is disabled.
Sets all Entities in an EGroup on fire
Sets all entities in an egroup to be recrewable or not when abandoned
Set player selectable state of entities in the egroup
Enables shared team production on a building (teammates can build using THEIR resources)
Sets whether or not Entities in an EGroup should continue burning while invulnerable
Sets a strategic point to neutral (not owned by any team)
Set the allowable methods of targeting the entities in this EGroup.
Makes an egroup neutral
Sorts the EGroup based on health
Add an SGroup to an existing SCAR encounter
Add a squad to an existing SCAR encounter You can also force the encounter to restart if necessary (i.e. it had previously finished)
Find a SCAR encounter that's associated with a squad, sgroup, or an AI encounter
Returns the underlying aiEncounter for the given encounter, if there is one. Returns nil otherwise.
Retrieve the goal data from a given encounter This returns the original data as originally passed in. Internally it may have been augmented with default values and/or preprocessed in other ways, but this returns the original.
Gets the SGroup that holds all of the units associated with an encounter
Tells you whether an encounter is active or has finished
Remove ALL squads from an existing SCAR encounter
Remove all squads in an SGroup from a given SCAR encounter
Remove a squad from an existing SCAR encounter
Restarts an encounter from the beginning
Update the goal data for a given encounter This will cause an encounter to restart internally
Starts an encounter that has been stopped
Stops an encounter that is running.
Allows the entity to use this ability
Advance ability cooldown
Builds the cycle list based on current tagged entity
Check if an entity can currently be damaged.
Cancels an item in a production queue. Index 0 is the currently producing item.
Clear the pending death flag manually. Should be used when campaign leaders are revived.
Clears any previous posture suggestions made to an entity
Clears a TargetHandle value in the entity's state model corresponding to the given key and table row index (0 based).
Clears a TargetHandle value in the entity's state model corresponding to the given key.
Clears the tagged entity used for debugging
Instantly adds an upgrade to a given entity
Converts Entity's blueprint to the specified blueprint.
Creates an entity at a given position and assigns it to a given player. 'blueprint' is a string value containing the name of the entity blueprint. This function does not spawn the entity so you will need to call Entity_Spawn to see this entity
Creates an entity at a given position and assigns it to a given player. 'blueprint' is a string value containing the name of the entity blueprint. This function spawns the entity so there is no need to call Entity_Spawn
Cycle through the existing list built for the originally tagged entity
DeSpawn the entity at its current position
Remove an entity from the world and destroy it.
Disables the death of the given entity building, only works for panel based destructible buldings
Forces the cancel construction command to be disabled, meaning you can't cancel construction for this
Adjusts the entity's burn level by val
Sets whether an entity pays attention to its surroundings
Sets whether an entity can produce anything (including upgrades)
Sets whether an strategic point is active
Returns total entity extension count.
Returns true if the entity has the specific extension enabled.
Returns true if the specified extension on the entity will update every frame.
Returns a string name of the given extension on the entity.
Force constructs this entity but only if its a building
Force a building to self construct if it's a building
Get an entity from a mission editor ID.
Get an entity from a mission editor ID.
Returns the active entity command. Some valid entity commands: STATEID_StructureBuilding, STATEID_Dead, STATEID_Idle, STATEID_Pause
Returns the entity targeted by the given entity.
Returns the squad targeted by the given entity.
Returns the entity's blueprint
Returns the construction progress (with range [0.0, 1.0] for a given entity. Returns 0.0 if the entity is not a building.
Get cover safety value from the where the entity is standing. The safety value is number from -.5 to .5. Higher value means better cover. If the entity doesn't have cover_ext, value of 0 would be returned
Get the currently tagged debug entity
Returns number of entities that will be placed if this ebp is built in a fence.
Returns the number of filled slots for squads in a hold in the HoldExtInfo
Returns the entities unique id in the world
Returns the health of an entity. Health will be zero for entities with no health extension.
Returns the max health of an entity. Max health will be zero for entities with no health extension.
Returns the percentage health, taking into account destructible buildings Health will be zero for entities with no health extension nor building destruction
Returns the entities unique id in the world
Check if the entity is invulnerable or not
Returns the invulnerable point in terms of percentage For buildings, retrieve the percentage value of healthy below which no more panels could be destroyed
Get the unit kill count for entities. Possible kill types are VS_Infantry, VS_LightArmor, VS_HeavyArmor, VS_Building
Gets the maximum capture crew size from a recrewable entity
Returns the number of specified slots for squads in a hold in the HoldExtInfo
Returns the number of blocks the entity will perform per number of attacks For each numAttacks melee attacks the entity receives, it will block a random numBlocks of them. Block rate is numBlocks / numAttacks
Returns the number of combat slots in total of a certain hold-able type
Returns the number of entities connected to an entity via the interaction system.
interactionType should match one of the values defined in the interaction_type
attribute enum
Returns the production type (PITEM_Upgrade, PITEM_Spawn, PITEM_SquadUpgrade, PITEM_SquadReinforce, PITEM_PlayerUpgrade) for a production queue item with index.
Returns the number of items in the entities production queue. It is an error to call this function on an entity that does not have a production queue. Use Entity_HasProductionQueue to check that the entity has a queue.
Returns the number of blocks the entity will perform per number of attacks For each numAttacks projectile attacks the entity receives, it will block a random numBlocks of them. Block rate is numBlocks / numAttacks
Returns the number of blocks the entity will perform per number of attacks For each numAttacks ranged attacks the entity receives, it will block a random numBlocks of them. Block rate is numBlocks / numAttacks
Get remaining resource amount of the given entity.
Returns the inner sight radius for this entity Radius will be zero for entities without a sight extension
Returns the inner sight radius for this entity Radius will be zero for entities without a sight extension
Returns the outer sight radius for this entity Radius will be zero for entities without a sight extension
Returns the outer sight radius for this entity Radius will be zero for entities without a sight extension
Returns a boolean value from the entity's state model corresponding to the given key.
Returns an Entity value from the entity's state model corresponding to the given key.
Returns a boolean value from the entity's state model corresponding to the given key and table row index (0 based).
Returns an Entity value from the entity's state model corresponding to the given key and table row index (0 based).
Returns a float value from the entity's state model corresponding to the given key and table row index (0 based).
Returns an integer value from the entity's state model corresponding to the given key and table row index (0 based).
Returns a Player value from the entity's state model corresponding to the given key and table row index (0 based).
Returns a Squad value from the entity's state model corresponding to the given key and table row index (0 based).
Returns a Vector3f value from the entity's state model corresponding to the given key and table row index (0 based).
Returns a float value from the entity's state model corresponding to the given key.
Returns an integer value from the entity's state model corresponding to the given key.
Returns a Player value from the entity's state model corresponding to the given key.
Returns a Squad value from the entity's state model corresponding to the given key.
Returns a Vector3f value from the entity's state model corresponding to the given key.
Returns an Entity value from the entity's StateTree EntityTargetingExt with the given type and key.
Returns an Player value from the entity's StateTree EntityTargetingExt with the given type and key.
Returns an Squad value from the entity's StateTree EntityTargetingExt with the given type and key.
Returns an Vector3f value from the entity's StateTree EntityTargetingExt with the given type and key.
Returns the number of entities or squads currently securing this strategic point
Get the entity's targeting type - auto, manual, or none
Gets the total number of panels in a building (returns 0 for anything but panel based destructible buldings)
Gets the current number of undestroyed panels in a building (returns 0 for anything but panel based destructible buldings)
Returns a weapon hardpoint
Returns how many hardpoints an entity has
Call HandleAssert on an EntityAssertHandler for each entity
Tests to see if an entity has an ability
Checks whether an entity is of any of the Blueprints or EntityTypes specified. Blueprint can be a single Blueprint, a single EntityType, or a table of multiple Blueprints or EntityTypes. If you want to see if an entity has ALL of a set of EntityTypes, then wrap them all in a sub-table.
Return true if the entity has the given criticalID applied to it
Returns true if an entity has a production queue.
Return true if the entity has purchased the specified upgrade.
Reverts an occupied building
True if the ability is active
Returns true if entity is alive and spawned
Returns true if entity is still alive
Returns true if the entity is attacking within the time Time is in seconds
Returns true if the given entity is a building
Returns true if the entity can be set on fire
Returns true if the given entity is burning (buildings on fire or non-buildings with burn_exts)
Returns whether the entity is camouflaged.
Returns true if the entity is a capturable building
Returns true if entity is a casualty else false
Returns whether this entity is cuttable
Returns whether this entity's demolition charges are ready to be detonated
True if entity is currently performing the given ability
Returns true if the given blueprint is a building
Returns true if the given blueprint is objcover
Returns true if the given blueprint is of the given type. Types are defined in type_ext/unit_type_list
Returns whether a hardpoint is active
Check if the entity has a hold on anything
Returns whether or not the entity is in the background.
Returns true if entity is in cover.
Returns whether an entity is an infantry unit
get if an entity is invulnerable
Returns whether an entity is moving.
Determines if this entity is of the given type. Types are defined in type_ext/unit_type_list
Returns if an Entity is currently on walkable wall.
Returns true if the entity is part of a squad
Returns whether an entity is a plane (has a flight extension)
Returns whether an entity is a planned structure.
Returns whether a particular squad blueprint is being produced by a given entity
Returns true if an entity has a production queue and if the queue is available
Returns true if the entity is a resource generator and has resources remaining
Return true if the entity is a slot item
Returns whether an entity is a soldier
if entity is spawned return true
Returns true if the entity is a starting position
Returns true if the entity is a strategic point.
Return true if the entity is a team weapon
Returns true if the entity is under attack.
Returns true if the entity was under attack from a certain direction (8 offset types, see LuaConsts.scar)
Returns true if the entity is being repaired.
Check if an entity with the given ID can be found in the world
Returns whether an entity can be vaulted
Returns whether an entity is a vehicle
Returns true if entityID is a victory point
Kill the entity. Sets health to 0, and triggers death effects.
Calls a function when an entity gets destroyed by the player clicking the "Detonate me" button next to an entity.
Overrides whether to display a critical or not. types are: CT_VehicleFront, CT_VehicleBack, CT_VehicleLeft, CT_VehicleRight, CT_VehicleEngineGreen, CT_VehicleEngineYellow, CT_VehicleEngineRed, CT_VehiclePrimaryWeapon, CT_VehicleSecondaryWeapon
Precache entity resources and listen for event GE_EntityPrecached that it is done callback example: Rule_AddGlobalEvent(EntityPrecacheComplete, GE_EntityPrecached) Params: ebp - entity blueprint skinID - this is the server item id for a skin, it will precache and equip it player - the player that we want to precache the entity or squad for cacheName - name of cache where resource will be loaded into source - helps identify who requested the precaching id - id to table of data that will be used once entity/squad is loaded
trigger the RagDoll skeleton driving.
Removes an ability that was previously added by Entity_AddAbility. You cannot remove static abilities (from AE: ability_ext)
Removes all booby-traps on this entity
Removes all demolition charges on an entity
Removes an upgrade from an entity
Returns true if you should call Misc_UpdateSlottedSplinesContainingEGroupAfterBlueprintConversion with an egroup containing this entity after blueprint converting it. Make sure to batch together all your entities when using that function to reduce duplicated work.
Reset melee block rate to AE tuned values
Reset Projectile block rate to AE tuned values
Reset ranged block rate to AE tuned values
Restore the targeting type to the default found in the ebp
Trigger animation action for an entity. Please only use this for simple animations
Set animation action parameter for an entity. Please only use this for simple animations
Set animation event for an entity. Please only use this for simple animations
Set animation state of a state machine for an entity. Please only use this for simple animations
Set animation variable value for an entity. Please only use this for simple animations
Sets the entity to be in the background or foreground. By default, all entities are in the foreground
Overrides crushable behavior for an entity
enable or disable the casualtext
Enables/disables an extension on the entity.
Set the health of an entity. healthPercent must be in the range [0.0, 1.0].
Set invulnerability on the entity. Reset time is in seconds. If it it set, the invulnerability will expire after this time.
Make an entity invulnerable to physical damage when health is below the minimum health percentage resetTime is the time in seconds that vulnerability will be restored.; zero time for reset time means the buff will last forever
Set the number of blocks the entity will perform per number of attacks For each numAttacks melee attacks the entity receives, it will block a random numBlocks of them. Block rate is numBlocks / numAttacks
Sets an object on fire (also works on buildings)
Set the number of blocks the entity will perform per number of attacks For each numAttacks projectile attacks the entity receives, it will block a random numBlocks of them. Block rate is numBlocks / numAttacks
Sets whether or not a projectile can explode.
Set the number of blocks the entity will perform per number of attacks For each numAttacks ranged attacks the entity receives, it will block a random numBlocks of them. Block rate is numBlocks / numAttacks
Sets an entity to be recrewable or not when it becomes abandoned
Set remaining resource amount of the given entity.
Enables shared team production on a building (teammates can build using THEIR resources)
Show or hide the entity's silhouette when behind other objects
Sets a boolean value in the entity's state model corresponding to the given key.
Sets a boolean value in the entity's state model corresponding to the given key and table row index (0 based).
Sets a float value in the entity's state model corresponding to the given key and table row index (0 based).
Sets an integer value in the entity's state model corresponding to the given key and table row index (0 based).
Sets a float value in the entity's state model corresponding to the given key.
Sets an integer value in the entity's state model corresponding to the given key.
Sets a flag that tells a building to keep burning while invulnerable (for atmosphere).
Sets a strategic point to neutral (not owned by any team)
Sets whether a strategic point's reticule is visible
Set the allowable methods of targeting this entity Targeting_Automatic: allow auto and manual targeting Targeting_Manual: only allow manual targeting Targeting_None: do not allow targeting
Makes an entity neutral
Shows/hides the entity in the simulation
Snaps the entity to the grid and ground.
Spawn the entity at its current position
Spawn the entity at its current position without pathfinding and collision
Abruptly stops an active ability
Puts out the fire on an object (also works on buildings)
Suggests a posture to an entity, lasting the passed duration Posture of 0 is prone, 1 is kneel/crouch, and 2 is standing. Duration is in seconds, negative means indefinate.
Returns whether this entity is set up to have demolitions placed on it
Tags the entity to be used for debugging
Hides or shows an entity visually.
Converts any enum value to a number
Converts any enum value to a string
Creates a Call to Action UI event. cta_type can be CTA_ALARM, CTA_CELEBRATE, CTA_UNIQUE_STAKES, or CTA_UNIQUE_CHANGE. onTriggerIntel plays when the Call appears and must be an Intel Event; onClickFunction plays when the Call is clicked and can be a standard function or an Intel Event. Pass in a postition, marker, or group to move the camera when user clicks on CTA
Clear any Call To Action that is currently displayed
Creates a center screen high priority player cue
Callback helper function for relocate an Encounter goal. Name of parameters: 'encounter'.
Example usage: Event_*(EventHandler_ResetGoalRelocation, {encounter =
Callback helper function for relocate an Encounter goal to the original location. Name of parameters: 'encounter'.
Example usage: Event_*(EventHandler_ResetGoalRelocation, {encounter =
Callback helper function for triggering an Encounter goal. Name of parameters: 'encounter'.
Invokes Encounter:TriggerGoal() for data.encounter Example usage: Event_*(EventHandler_TriggerEncounterGoal, {encounter =
Creates a Callback Event that triggers when ALL of the specified events are triggered.
Callback given callback function with data, when the certain objects die.
Pauses for a given amount of time. This function MUST be called from a CTRL object in NISlet events only! See Event_Start for more information on NISlet events.
Callback given callback function with data when target enters range
Callback given callback function with data when target exits range
Callback given callback function with data, when the amount of objects matches the requested conditions - Note: Does not count team weapons
Callback given callback function with data, when group is dead(empty).
Callback given callback function with data, when the amount of entities left in a group drops below amount.
Returns true if any standard (non-save) event has been queued to run. TODO: This function name is misleading. We should maybe change it, but this is being called in many mission scripts so we are leaving it for later.
Returns true if the event is being skipped.
Callback given callback function with data, when group is doing an attack or is under attack in the last attackTime seconds.
Callback given callback function with data, when group is out of combat in the last attackTime seconds.
Callback when a target element is selected.
Callback given callback function with data when target enters location.
Callback given callback function with data, when the amount of members left in a squad matches the requested conditions
Starts a save event the same way as Event_Start, but automatically sets highest priority and promotes the request up the queue automatically. It waits for the existing event to finish, and does not cancel the existing event. STT_Quick: Saves the game by user request. Name is generated from campaign mission or skirmish preset name. STT_Auto: Campaign only. Saves the game by script request. Name is generated from campaign mission. STT_Standard: Saves the game using the name provided, overwriting if necessary - a suitable filename will be generated - saves to Campaign or Skirmish folder depending on currently running scenario STT_Dev: Saves the game using the filename provided - for development and testing only
Starts a save event the same way as Event_Save, but with a filename specified. STT_Quick: Saves the game by user request. Name is generated from campaign mission or skirmish preset name. Supplied filename is ignored. STT_Auto: Campaign only. Saves the game by script request. Name is generated from campaign mission. Supplied filename is ignored. STT_Standard: Saves the game using the name provided, overwriting if necessary - a suitable filename will be generated - saves to Campaign or Skirmish folder depending on currently running scenario STT_Dev: Saves the game using the filename provided - for development and testing only
Completes execution of the event immediatley (all calls to Wait() are ignored)
Starts event. Event will not start until all rules are evaluated for this frame! We allow saving events in multiplayer so please don't put any non-UI events in multiplayer Running events are not saved at all.
Starts an event the same way as Event_Start, but calls a user defined function when the event is over
Callback given callback function with data when target remains in range (called every interval seconds)
Toggle blockers info
Enables or disables the FOW, including out of bound areas and all entities on the map
Explores entire map for all players. (Careful where this is used. For example, if used before the first tick, a statetree may change an entity's visual on the first tick, so the ghost's visual will not reflect the entity's.)
Reveal FOW except blockers for all players. Does not create ghosts and ghosts will not be present if undone.
Explores entire map for one player. (Careful where this is used. For example, if used before the first tick, a statetree may change an entity's visual on the first tick, so the ghost's visual will not reflect the entity's.)
Reveal FOW for specified player
Unexplores entire map for one player.
Use to undo a FOW_RevealAll for specified player
Reveal FOW for all players
Reveals a circular area for all alive players over a given duration. YOU SHOULD ONLY CALL THIS ONCE FOR EACH AREA. Pass in a duration of -1 for indefinite duration ( until unreveal is called )
Reveals an entity groups line of sight(LOS) for all alive players over a given duration. YOU SHOULD ONLY CALL THIS ONCE FOR EACH AREA. Pass in a duration of -1 for indefinite duration ( until the entities are dead )
Reveals an entity group in the FOW for alive players for a duration. Pass in a duration of -1 for an indefinite duration.
Reveals an entities line of sight (LOS) for all alive players over a given duration. YOU SHOULD ONLY CALL THIS ONCE FOR EACH AREA. Pass in a duration of -1 for indefinite duration ( until the entity is dead )
Reveals an area the size of a given markers proximity at that markers position for a given amount of time. Pass in a duration of -1 for indefinite duration. YOU SHOULD ONLY CALL THIS ONCE FOR EACH AREA. This function will reveal the FOW for ALL alive players. This does not work with markers with rectangular proximity type
Reveals a squad groups line of sight(LOS) for all alive players over a given duration. YOU SHOULD ONLY CALL THIS ONCE FOR EACH AREA. Pass in a duration of -1 for indefinite duration ( until the squads are dead )
Reveals a squad group in the FOW for alive players for a duration. Pass in a duration of -1 for an indefinite duration.
Reveals a squads line if sight(LOS) for all alive players over a given duration. YOU SHOULD ONLY CALL THIS ONCE FOR EACH AREA. Pass in a duration of -1 for indefinite duration ( until the entity is dead )
Reveals a territory to a player
Reveal FOW for all players by disabling rendering of FOW without triggering a FOW in the game simulation
Use to reveal all Entities in FoW
Use to transition from game to RevealAll
Use to undo a FOW_UIRevealAll
Use to unreveal all Entities in FoW
Use to transition into game
Unexplores entire map for all players
Use to undo a FOW_RevealAll
UnReveals a circular area for all alive players. YOU SHOULD ONLY CALL THIS ONCE FOR EACH AREA.
Unreveals an area the size of a given markers proximity at that markers position. YOU SHOULD ONLY CALL THIS ONCE FOR EACH AREA. This does not work with markers with rectangular proximity type
Unreveals a territory sector
Use to undo a FOW_ForceRevealAllUnblockedAreas.
Find a food deposit on screen that has visible UI decorators Returns a food deposit entity and a boolean indicating if the entity itself has visible decorators. If not, the squad has visible decorators.
Calculate the dimensions and centre offset of a formation for given squads. Returns as a ScarPosition {x = Width, y = Height, z = centre offset along forward (Height) direction}. Returns a zero vector if error.
Take over control of the local player
Returns the input enabled flag as an integer.
Returns the visibility flag as an integer.
Restores various aspects of the single player game after loading a mission from a save game
deletes save game(s), even if it is not loadable with the current version of the game
Enables/Disables all input EXCEPT for ESC and F10.
Ends the single player game (win/lose).
Removes title text displayed with Game_SubTextFade(...) immediately
Removes title text displayed with Game_TextTitleFade(...) immediately
Fades the screen to black - FADE_OUT to fade to black, FADE_IN to fade back in
Fast forward all production queues as if x seconds passed, returns info about what has been produced Returns a lua table of the format { (string)PlayerID : { (string)EntityProducerName : { "research" : { (string)researchedItemName : (int)number of times researched }, "production" : { (string)producedItemName : (int)number of items produced }, }, }, } for each player present, for each entity that produced after fast forwarding, for each item researched and produced
For all players fast forwards their resource income as if x seconds passed
Checks whether a callback
Returns the input enabled flag.
Get the local player. (should only be used for UI purpose)
Get the local player id. (should only be used for UI purpose) (not deterministic)
Returns current single player difficulty. Values are GD_EASY, GD_NORMAL, GD_HARD, GD_EXPERT.
get the simulation update rate
injects terrain type values into passed table to use for terrain creation
Returns the game's visibility flag.
Determine if there is a valid local player. (UI only -- nondeterminstic)
Returns lock state of stored data at location named by dataID.
check if scenario has FTUE boolean set in match setup
Returns whether the game is paused.
Returns true if the we're running the performance test.
Use to test whether the game is running in RTM mode or not. Using -rtm from the command line will cause this function to also return true in non-RTM builds.
Checks that the save system has a save queued or is actively saving.
load this scenario as an single player match
Load data store to disk
load this game as a single player match, full path is expected excluding extension
load the savegame with the given internal name from Campaign or Skirmish folder depending on currently running scenario
load this scenario as an single player match
If you are running something that is non-deterministic like a getlocalplayer conditional, you can lock the random to make sure no one down the callstack will throw the game random index out of sync and cause a sync error. REMEMBER TO UNLOCK WHEN YOU ARE DONE
Quits the app immediately
Quits the app immediately with the given exitCode
Removes a callback from being called on game restore
Removes the data store at the given path.
Requests the local player to be set on the next update. (not deterministic)
Loads table data stored at datastore[dataID] into global lua table var named
Save data store to disk
checks if the save game exists in dev folder and is loadable, filename is expected excluding folder and extension
Fades the screen to a given RGBA colour over a number of seconds
Updates the status of an in-game achievement or challenge.
sets lock state for stored data at location named by dataID.
Adds a function and set of arguments to be automatically called during restore from a saved game. Maxiumum of 9 parameters. Callback will be called like this: Callback(arg[1], arg[2], ...)
Sets the input enabled flag.
set the simulation update rate
Sets the visibility of the specified game visibility flag.
Sets the game visibility flag.
Brings up the pause menu. The game does not get paused until the end of the current sim tick, so anything that comes after Game_ShowPauseMenu in your function will still get executed, as well as any rules set to run during that frame.
Skips all events. Can either delete or skip queued events.
Skips the currently playing event (and stops current sound)
Stores provided table into long-lived data store at location named by dataID.
Fade in and out two or three lines of subtext. This function has to support two lines, for backwards compatibility. The 'detail' line is therefore optional.
Fade in and out one, two or three lines of subtext with an icon
Shows title text that fades in and out over a specified durations Call UI_TitleDestroy to remove.
Transitions to another atmosphere. Overwrites current transitions. Uses predefined atmosphere settings (only compatible with EEditor maps).
unlock the random from a previous lockrandom call only
Finds a marker with a given core name and a cardinal heading
Get physics debug toggle value
Get physics debug toggle value
Disable the spotting of enemy entities that may become ghosts in the FoW
Enable the spotting of enemy entities that may become ghosts in the FoW
Creates a hintpoint attached to a Marker, EGroup, SGroup or position If range is set to 0, then the hintpoint is rangeless, see the design document for rangeless features. The following types of hintpoint actions are available. HPAT_Objective HPAT_Hint HPAT_Critical HPAT_Movement HPAT_Attack HPAT_FormationSetup HPAT_RallyPoint HPAT_DeepSnow HPAT_CoverGreen HPAT_CoverYellow HPAT_CoverRed HPAT_Detonation HPAT_Vaulting
Clear the hint point arrow facing value.
Removes a hintpoint.
Removes all hintpoints.
Sets a hintpoint's display offset, which is 3D for world hintpoints and 2D for taskbar binding hintpoints (ignore z)
Add a projected offset to the specified hint point.
Face the hint point arrow towards this entity.
Face the hint point arrow towards this position.
Face the hint point arrow towards this squad.
Sets a hintpoint's visibility. Currently, FOW is not accounted for.
Show or hide the specified hint point.
Toggle hold info
Grabs villagers and gets them moving around to look busy. Meant for non-player/AI villagers only. Should be run as an Interval Rule. Example: Rule_AddInterval(IdleVillagers_MakeBusy, 5, {marker = mkr_town, player = player2, sgroup = sg_spare_villagers})
Loads a scar file if it hasn't been loaded yet
A class-like object used as a Singleton to read and write a JSON file Initializes based on command line parameter -test_result_file alias:path. Checks for temporary logs on creation and inserts them into the result data. NOTE: A lot of information in the file is redundant to make it easier to process and easier to read for a human.
Returns true if the pbg class list contains a type that has economic utility
Can this structure be used to secure territory
Can this structure be used to secure territory
Returns true if this object is a structure (something with a site_ext)
turns on the watcher and displays the lists if any
Needs the proper luaConfig id, and looks through that list to add the filter.
Needs the proper luaConfig id, returns true if filter exists.
Returns true if LCWatcher is active.
Needs the proper luaConfig id, removes filter added by LCWatch_AddFilter.
Selects a LuaConfig state to watch. Returns true if state is registered and false if it has not.
DEV ONLY: Converts ansi text to localized text. Your text will have to get localized properly at some point before final. When converting text with this function you will get LOC: prefixed to your text
Finds a location based on the identifier Locates locations based on identifier type: TABLE (location matching identifier), STRING (location with identifier as descriptor), ENTITY/EGROUP (location containing identifier), SCARPOS (closest location to identifier). Returns nil if nothing is found.
Get the player's equipped elite at the specified index for their currently set race
Get the number of elites currently equipped for the player's current race
Empty string. This will create an empty localized string.
Returns a localized string containing the integer.
Returns a localized string containing the number to the specified number of decimal places.
Returns a formatted localized string. Use this function to format localized text. ie %1PLAYERNAME% is going to win. It accepts up to 9 additional values as parameters.
Returns a formatted time string in hours, minutes, and seconds. can omit leading zeroes.
Returns a formatted time string in minutes and seconds. can omit leading zeroes.
Returns a formatted time string in minutes, seconds, and milliseconds. can omit leading zeroes.
Returns the localized string identified by the specified id.
Send a entity command to a entity group(CMD_DefaultAction, CMD_Stop, CMD_Destroy, CMD_BuildSquad, CMD_CancelProduction, CMD_RallyPoint, CMD_AttackForced) Entity commands are mostly used for buildings etc. If you need to issue commands to units, use the Squad_Command function.
Send an entity ability command (CMD_Ability) to an entity
Send a squad command to a entity group with custom data
Send a entity-based command to an entity group. Use this function to issue orders that require a entity to an entity group (eg. order a building to attack another building)\n See LocalCommand_Entity for a list of all the possible entityCommands.
Send a squad command to a squad group with custom data
Send a position command to an entity group. Use this function to issue orders that require a position to an entity group (eg. set a rally point for a building)\n See LocalCommand_Entity for a list of all the possible entityCommands.
Send a positional ability command (CMD_Ability) to an entity Use this function to issue ability orders that require a position to player
Send a positional/directional ability command (CMD_Ability) to an entity Use this function to issue ability orders that require a position and a direction to player
Send a dual target (position and squad) command to an entity group. Use this function to issue orders that require a position and a squad to an entity group (eg. unloading squad from hold)\n See LocalCommand_Entity for a list of all the possible entityCommands.
Send a squad-based command to an entity group. Use this function to issue orders that require a squad to an entity group (eg. order a building to attack a squad)\n See LocalCommand_Entity for a list of all the possible entityCommands.
Send an entity-targeting ability command (CMD_Ability) to an entity Use this function to issue ability orders that require an entity target to an entity
Send an squad-targeting ability command (CMD_Ability) to an entity Use this function to issue ability orders that require an entity target to an entity
Send a squad command to a entity group with custom data
Send a player command to a player PCMD_Ability
Send a player ability command (PCMD_Ability) to a player
Send an entity command to a player.
Send a player command to a player with a custom flag
Send a player a command to use a multi-target ability on the given targets.
Place a planned structure
Place a planned fence
Place a planned slotted spline
Send a position command to a player. Use this function to issue orders that require a position to player)\n See LocalCommand_Player for a list of all the possible playerCommands.
Send a positional ability command (PCMD_Ability) to a player Use this function to issue ability orders that require a position to player
Send a positional/directional ability command (PCMD_Ability) to a player Use this function to issue ability orders that require a position and a direction to player
Send a position command to a player with extra info Use this function to issue orders that require a position to player\n See LocalCommand_Player for a list of all the possible playerCommands.
Send a player command to itself to order squads in the sgroup to construct the building at specific position and facing structureBlueprint must be a valid building that can be constructed by the sgroup. This building would cost nothing and does not effect population and availability This is a special command for SCAR use
Send a player command to itself to order squads in the sgroup to construct the building at specific position and facing structureBlueprint must be a valid building that can be constructed by the sgroup. This building would cost nothing and does not effect population and availability This is a special command for SCAR use
Send a player command to itself to order squads in the sgroup to construct fences from posStart to posEnd structureBlueprint must be a valid building that can be constructed by the sgroup. This building would cost nothing and does not effect population and availability This is a special command for SCAR use
Send a player command to itself to order squads in the sgroup to construct fences from posStart to posEnd structureBlueprint must be a valid building that can be constructed by the sgroup. This building would cost nothing and does not effect population and availability This is a special command for SCAR use
Send a player command to itself to order squads in the sgroup to construct a field ranging from posStart to posEnd structureBlueprint must be a valid building that can be constructed by the sgroup. This building would cost nothing and does not effect population and availability This is a special command for SCAR use
Send a player command to itself to order squads in the sgroup to construct a field ranging from posStart to posEnd structureBlueprint must be a valid building that can be constructed by the sgroup. This building would cost nothing and does not effect population and availability This is a special command for SCAR use
Send a command from player to sgroup to build ebp as a slotted spline from posStart to posEnd. structureBlueprint must be a valid building that can be constructed by the sgroup. This building costs nothing and does not effect population and availability This is a special command for SCAR use
Send a command from player to sgroup to build ebp as a slotted spline from posStart to posEnd. structureBlueprint must be a valid building that can be constructed by the sgroup. This building costs nothing and does not effect population and availability This is a special command for SCAR use
Send a command from player to sgroup to build ebp as a slotted spline dependent entity. structureBlueprint must be a valid building that can be constructed by the sgroup. This building costs nothing and does not effect population and availability This is a special command for SCAR use
Send a command from player to sgroup to build ebp as a slotted spline dependent entity. structureBlueprint must be a valid building that can be constructed by the sgroup. This building costs nothing and does not effect population and availability This is a special command for SCAR use
Send a command from player to sgroup to build ebp as a slotted spline replacer entity. structureBlueprint must be a valid building that can be constructed by the sgroup. This building costs nothing and does not effect population and availability This is a special command for SCAR use
Send a command from player to sgroup to build ebp as a slotted spline replacer entity. structureBlueprint must be a valid building that can be constructed by the sgroup. This building costs nothing and does not effect population and availability This is a special command for SCAR use
Sends an upgrade command to a player
Send a squad command to a squad group SCMD_DefaultAction, SCMD_Move, SCMD_Stop, SCMD_Destroy, SCMD_BuildStructure, SCMD_Capture, SCMD_Attack, SCMD_ReinforceUnit, SCMD_Upgrade, SCMD_CancelProduction SCMD_AttackMove, SCMD_Ability SCMD_Load,SCMD_UnloadSquads, SCMD_DoPlan SCMD_SlotItemRemove, SCMD_InstantReinforceUnit, SCMD_InstantUpgrade
Send a ability command (SCMD_Ability) to a squad
Send a position ATTACK MOVE command to a squad group with custom data. WARNING: Element plans need to be reimplemented in state trees.
Send an entity command to a squad group. Use this function to isssue an entity-based command to a squad group.\n See LocalCommand_Squad for a list of all the possible squadCommands
Send a entity ability command (SCMD_Ability) to a squad
Send an entity command ATTACK to a squad group. Use this function to issue an entity-based command to a squad group with custom FOW check flag. (eg. order a squad to attack a building)\n planName is the name of the custom plan file to execute. Pass in empty string to use the default\n stationary flag uses SCMD_StationaryAttack instead where plan file is ignored and squad does not pursue its target See LocalCommand_Squad for a list of all the possible squadCommands WARNING: Element plans need to be reimplemented in state trees.
Send a entity command to a squad group with custom BOOLEAN data
Send a entity command to a squad group with custom data
Send special squad command to a squad group with squad load parameters This is a special command for loading squads into building (entity) holds (SCMD_Load, SCMD_InstantLoad)
Send a squad command to a squad group with custom data
Send a squad a command to use a multi-target ability on the given targets.
Send a position command to a squad group. Use this function to issue orders that require a position to a squad group (eg. order a squad to move to position, or attack position)\n See LocalCommand_Squad for a list of all the possible squadCommands.
Send a positional ability command (SCMD_Ability) to a squad
Send a position command to a squad group with custom data
Send an position command ATTACK to a squad group. Use this function to issue an position-based command to a squad group with custom FOW check flag. (eg. order a squad to attack a building)\n planName is the name of the custom plan file to execute. Pass in empty string to use the default\n stationary flag uses SCMD_StationaryAttack instead where plan file is ignored and squad does not pursue its target See LocalCommand_Squad for a list of all the possible squadCommands WARNING: Element plans need to be reimplemented in state trees.
Send a set CombatStance command to the squads Set the CombatStance for all the Squads in the SGroup. StanceTypes: STANCE_CeaseFire (don't shoot), STANCE_StandGround (don't move, just shoot), STANCE_Attack (move and shoot)
Send a set Weapon Preference command to the squads Set the Weapon Preference for all the Squads in the SGroup. WeaponPreference: WP_Melee, WP_Ranged,
Send an squad-based command to a squad group. Use this function to issue a squad-based command to a squad group. \n See LocalCommand_Squad for a list of all the possible squadCommands
Send a squad ability command (SCMD_Ability) to a squad
Send an squad-based command to a squad group. Use this function to issue a squad-based command to a squad group with special boolean flag. (eg. order a squad to attack another squad)\n If bCheckFOW is set to false, the squad would be able to attack other squads hidden in FOW \n planName is the name of the custom plan file to execute. Pass in empty string to use the default\n stationary flag uses SCMD_StationaryAttack instead where plan file is ignored and squad does not pursue its target See LocalCommand_Squad for a list of all the possible squadCommands WARNING: Element plans need to be reimplemented in state trees.
Send a squad command to a squad group with custom data
Send special squad command to a squad group with squad load parameters This is a special command for loading squads into vehicle (squad) holds (SCMD_Load, SCMD_InstantLoad)
Sends an upgrade command to a squad group.
Adds units to the appropriate modules associated with this location. Villagers are added to Townlife if there is one. Military units are added to defend if there is one. Left over units are added to the sgroup_unassigned sgroup instead.
Finds a location with the given descriptor. Returns nil if none exists.
Print text to specified file
Clear the map icon facing value.
Create a map icon targetting an entity.
Create a map icon targetting a position.
Create a map icon targetting a squad.
Remove a map icon.
Remove all map icons.
Face the map icon towards this entity.
Face the map icon towards this position.
Face the map icon towards this squad.
Returns the number of ScarMarkers with the given name If you don't care about the type, pass in an empty string ( "" ) The type is defined in the markers list of the mission editor when placing markers.
Gives the sgroup a series of queued orders to go to each marker with the same markerName.
Clears the minimap path with the given pathName string, if there is one. If removePath, that path is entirely deleted; otherwise it persists and can be used again
Follow-up gate locking function, because you can't call two commands on an Entity in the same frame
Gives the sgroup a series of queued orders to go to each marker with the same markerName.
Finds a marker in an entity, creates a SCAR marker there and returns the new marker's name. Uses the MarkerExt to find a marker inside an entity. Creates a SCAR marker at the internal marker's location. Returns the new SCAR marker's name.
Delete this marker, only recommended for dynamically created markers
Returns true if a generic number attribute exists for the marker type.
Returns true if a generic string attribute exists for the marker type.
Returns true if marker exists. If you don't care about the type, pass in an empty string ( "" )
Returns a ScarMarker from the Mission Editor. If you don't care about the type, pass in an empty string ( "" ) The type is defined in the markers list of the mission editor when placing markers. You will need the result of this function to call any functions that start with Marker_
Returns the name of a given marker. This value gets set in the Mission Editor.
Returns a fixed size table of markers from the world builder. Markers that do not exist in the WB, will be nil in the table. This is why we call it 'non-sequential'
Returns a generic number attribute defined in a marker. Different marker types have different attributes. Note: All marker types have Name and Proximity. Do not use this function to retrieve these values, use Marker_GetName and Marker_GetProximity instead.
Returns the proximity dimensions of a given marker. If non rectangular, default value is returned Dimensions are 2d but returned in 3d world space (terrain mapped to x,z) This value gets set in the Scenario Editor.
Returns the proximity radius of a given marker. Only for marker with proximity type PT_Circle. This value gets set in the Mission Editor.
Returns the proximity radius of a given marker. If non circular, default value is returned This value gets set in the Scenario Editor.
Builds a table of MarkerIDs that are named in a sequence. i.e. a name of "spot" will find markers "spot1", "spot2" and so on, up until it looks for a marker that isn't there.
Function List
Returns a table of markers from the world builder. Creates as many as it finds mkr_table = Marker_GetTable( 'mkr_%d' ) -- creates a table with 3 markers named 'mkr_1', 'mkr_2', and 'mkr_3' (and so on) from the WB\n\n mkr_table2 = Marker_GetTable( 'mkr_%02d' ) -- creates a table with 3 markers named 'mkr_01', 'mkr_02', 'mkr_03' (and so on) from the WB\n\n mkr_table3 = Marker_GetTable( 'mkr_%03d_patrol' ) -- creates a table with 3 markers named 'mkr_001_patrol', 'mkr_002_patrol' (and so on) from the WB\n\n
Returns the typename of a given marker. This is the typename from the Mission Editor (name displayed when placing markers)
Returns if a marker has a defined (non-default) proximity range
Set the proximity shape of a marker to a circle with size radius
Set the proximity shape of a marker to point marker (no proximity)
Set the proximity shape of a marker to a rectangle with dimensions width and height
Disable collecting and displaying render stats
Enable collecting and displaying render stats
Toggle collecting and displaying render stats
Merge clones two table (recursively) into a single table combining into a new table allowing for unadulterated use of the data
Let AI take over local player
Abort straight out of the game to the frontend, without asking the user
Add another circle in which commands are restricted to.
Add another marker in which commands are restricted to.
Appends given string to a file expects to receive a filename with an alias conserves existing file content \return Number returned is # bytes successfully written
Returns the enabled/disabled state of the right-click command input.
Clears a specific control group.
Clears the current selection.
Clears the current sub selection.
Returns true if the app has had any keyboard input in the last second
Returns true if the app has had any mouse input in the last second
Do weapon hit effect on the entity from the view camera origin WeaponID is the property bag group id; if penetrated is set to false, deflection effect would be played instead
Do weapon hit effect on the ground WeaponID is the property bag group id; if penetrated is set to false, deflection effect would be played instead
Checks if the given position has an associated district.
Turn on or off the performance test monitoring
Finds resource deposits of given type within the specified range of a position, that can be collected by the provided gathererEBP Returns an egroup of resource deposits named "eg_Misc_FindNearbyDepositOfType_result", sorted by proximity to the position
Returns the string argument for a command line option. ex: for "-init test.lua" it would return "test.lua"
Return the entity generating the district containing the given position. Use with Misc_DoesPositionHaveAssociatedDistrict
Return the district value of the district containing the given position. Use with Misc_DoesPositionHaveAssociatedDistrict
Returns the control group index that this entity belongs to, from 0 to 9, or -1 if none
returns the size of the file expects to receive a filename with an alias \return file size OR 0 if the file can not be read
Returns a hidden position on path from origin to destination. If there's none, it returns the origin position Possible check types are CheckHiddenFromCamera, CheckHiddenInFOW and CheckHiddenBothCameraFOW Camera check determined by the camera frustum. use cameraPadding to increase the area around the camera when doing the check FOW check requires a valid player ID passed in stepDistance is the interval along the path that the hidden points will be checked ( min is 1 metre ) If no hidden position is found, position ( 0, 0, 0 ) is returned Don't use this for multi-player SCAR script!!
Returns the world position of the mouse on the terrain
Returns the entity under the mouse (if any)
Returns the entity squad under the mouse (if any) (not deterministic)
Clears a given egroup and adds the current selection to the group
Clears a given sgroup and adds the current selection to the group
Returns the control group index that this squad belongs to, from 0 to 9, or -1 if none
Returns true if -option is specified on the command line
Returns whether the game is running in dev mode. The rules for dev mode are a bit complicated between builds, so we cannot simply check the command line.
Test whether ANY or ALL of an EGroup is on screen currently (not strict)
Returns true if ANY or ALL of the EGroup is selected
Check if the entity is on screen currently
Returns true if an entity is currently selected
Returns true if the mouse is over an entity
Returns true if the mouse is over a squad (not deterministic)
Check if position is on screen
Test whether ANY or ALL of an SGroup is on screen currently (not strict)
Returns true if ANY or ALL of the SGroup is selected
Returns the enabled/disabled state of the selection input.
Check if the squad is on screen currently
Returns true if a squad is currently selected
Assumes 'data:' as root; Returns a table containing the names of files matching the supplied path. Wildcards are allowed.
Returns a table containing the names of files matching the supplied path. Wildcards are allowed.
Reads the file as string expects to receive a filename with an alias \return file content OR empty string if the file can not be read
Can issue commands anywhere
Deletes the given file expects to receive a filename with an alias \return true if file was deleted or did not exist in the first place, false otherwise
Can only issue commands inside this marker
Save a screenshot
Set the graphic file type for screenshot (.jpg, .tga)
Select all the entities in an EGroup
Select the entity as if you had clicked it.
Select (or deselect) all the squads in an SGroup
Add or remove squad members from the current selection
Sets the current autotest being used. Used to set default text in the crash reports
Enables / Disables right-click command input.
Shows or hides designer splats, which are splats in the UI folder
Allow all entities in an EGroup to be selectable (or not)
Makes a squad belong to a specific control group. If it already belongs to another control group, it's removed from that one before being added to the new one.
Disable/enable selectability of the specified entity.
Allow all squads in an SGroup to be selectable (or not)
Enables / Disables selection input.
Makes a squad belong to a specific control group. If it already belongs to another control group, it's removed from that one before being added to the new one.
Disable/enable selectability of the specified squad.
Updates the slotted spline system to handle the fact that the entities in the given EGroup have done a blueprint conversion. This must be called after converting slotted spline entities from script.
Writes the given string to a file expects to receive a filename with an alias overwrites any existing file content \return Number returned is # bytes successfully written
Associate an entity with a suitable nearby location. The entity will be added to the location's egroup. If no suitable location is found, it is moved into the eg_orphanBuildings group, so it can be tried again later (maybe by then other buildings will connect it to a location)
Used to successfully COMPLETE all currently-active objectives
Used to FAIL all currently-active objectives
Used to FAIL the entire mission
Used to view the mission recipe that this mission was generated from
Used to WIN the entire mission
Looks for a battalion whose player name matches the identifier
Finds the location data table, identifying it from a String
Finds the module data table, identifying it from a String
Finds the player data table for one of the players in the mission, identifying them from a String ("descriptor"), PlayerID, Squad/SGroup or Entity/EGroup If you pass in a PlayerTable that has already been resolved it returns it straight back
Get the relationship between two players in the mission. These players can be referenced in any way that MissionOMatic_GetPlayer() can process.
Adds a training hint to a certain kind of squad that is resolved by selecting a squad of that type
Adds a training hint to a certain kind of squad that is resolved by selecting a squad of that type
Adds a training hint to a certain kind of squad that is resolved by selecting a squad of that type
Pass an sgroup of units back to the UnitRequest manager to complete a request
Request to have units produced by available production means
Function that reveals FOW on units in an SGroup in a way that follows them
Helper function that actually sends units somewhere once they're ready to go
Triggers the mission start title card (as long as it is properly defined in mission recipe)
Ends an SP scenario with a Victory. Waits for no intel events to be playing before it ends the mission. This will play any endNIS and endMovie specified in the g_missionData table. After this is called, the path is set and any subsequent calls to Mission_Complete() or Mission_Fail() are ignored.
Ends an SP scenario with a Victory. Waits for no intel events to be playing before it ends the mission. This will play any endNIS and endMovie specified in the g_missionData table. After this is called, the path is set and any subsequent calls to Mission_Complete() or Mission_Fail() are ignored.
Enable or diable a group of abilities for one or more players; useful for hiding glows. data can be a string (ability short name), a table of such strings. To deactivate for a player other than Player 1, pass in a table or tables as such: {player = playerID, abilities = {"name","name"}}
Ends an SP scenario with a Failure. Waits for no intel events to be playing before it ends the mission. After this is called, the path is set and any subsequent calls to Mission_Complete() or Mission_Fail() are ignored.
Ends an SP scenario with a Failure. Waits for no intel events to be playing before it ends the mission. After this is called, the path is set and any subsequent calls to Mission_Complete() or Mission_Fail() are ignored.
Initialize challenge timers
Regularly check on the Leader unit to see if it needs to surrender or do anything else; should only be called as a rule at a set interval
Finds any goal sequence that has a certain key, and toggles its state
If the passed SquadID corresponds to a leader, flips its Up/Down state
Initialize a player for use in campaign missions. Sets defaults for Player Names, Ages, and Colors, if not defined. Returns a World_GetPlayerAt value.
Sets up a Leader unit's custom Leader behaviour for use in a campaign mission
Recovers the Leader from surrender and returns it to player control
Initiates the surrender of a leader unit, temporarily removing it from player control
Watches for the death of a leader, which requires special handling
Revives a leader at a defaulted or designated spawn point
Sets all gates in an EGroup to be either locked or unlocked
Follow-up gate locking function, because you can't call two commands on an Entity in the same frame
Applies an entity modifier to an entity.
Applies a player modifier to a player.
Applies a squad modifier to a squad.
Returns a modifier that you can apply to stuff. applicationType : MAT_EntityType, MAT_Entity, MAT_Player, MAT_Squad, MAT_SquadType, or MAT_Weapon. modtype : Name of modifier from the modifiers table in the attribute editor. usageType : MUT_Addition, MUT_Multiplication, MUT_MultiplyAdd or MUT_Enable. exclusive : This field is not currently used for modifiers created through script. value : The value for the modifier. extname : The name of the entity/squad blueprint for when the applicationType is MAT_EntityType or MAT_SquadType.
Set up tables to track modifiers that are applied per resource
The game specific
Checks whether the modifier is enabled (requires an Entity and an Entity enable/disable modifier)
Checks if a modifier is enabled on all or any entities in an egroup
Set up tables to track modifiers that are applied per resource
Remove an applied modifier.
The game specific
Removes all SCAR-applied modifiers for a specific EGroup.
Removes all SCAR-applied modifiers for a specific SGroup.
Modify whether or not the group is revealed in the fog of war.
Modify the damage done to the entity per tick when it is on fire Can modify the value to zero to allow buildings to be on fire without taking damage
Modify the amount that the burn level decays per tick when not on fire
Modify the health threshold required to set the entity on fire
Modify the burn level threshold required to set the entity on fire. A LOWER value means it lights on fire FASTER.
Raise or lower the ceiling that a player's pop cap can reach. The does NOT change the current pop cap, use Modify_PlayerPopCap() for that. Usage types are MUT_Multiplication (default) or MUT_Addition.
Modify a player's current pop cap. Usage types are MUT_Multiplication (default) or MUT_Addition.
Modify the number of entities spawned in new squads Intended use case is spawning damaged squadss
Start capturing a movie, optionally downscaling to low resolution.
Stop a previously started movie capture.
Gets the 'default music movement'. This is the current default that can always be called
Translates the string music event level into the engine designated intensity value
Lock the music's intensity to a given level, for a given length of time (if you omit duration, the music plays indefinately until Music_UnlockIntensity is called) You can chain several level/duration pairs together to create a playlist of sorts. To do this, just use more parameters: Music_LockIntensity(level1, duration1, level2, duration2, ...)
Plays the music end outro segement and stop music after for about 50 secs.
Play Music at the 'default music movement' Set current music movement with Music_SetDefaultMovement
Plays a specific movement immediately - useful for things like NISes
Plays a stinger audio event. The wwise event should handle ducking, ending, etc.
Plays the music short end outro segement after combat finishes and goes to silence for around 20 secs.
This restart the music after objective after certain
Sets the 'default music movement'. This is the current default that can always be called
This restart the music after objective after certain
Stops all music currently playing
This stops music after objective and make sound go to silence
Unlock the music's intensity and revert to gameplay-driven
ONLY USE THIS INSIDE AN NIS EVENT. Wait until the NIS camera hits its counterpart checkpoint. Makes the script pause and wait until the camera portion hits "nis_pause()" (the counterpart checkpoint) on it's timeline. With these two functions, you can have the event script and camera sync up - i.e. make one wait for the other - at various points in the NIS and avoid all sorts of timing issues.
ONLY USE THIS INSIDE AN NIS EVENT. Transition from the NIS back to the game. You can safely do any cleanup after calling this, and it will occur once the screen is black.
Used to create a fade cut in an NIS Call this in your NIS Event. This will require an nis_pause() frame in your NIS file in order to work.
ONLY USE THIS INSIDE AN NIS EVENT. Transition from the game into an NIS preamble - a quick section before the NIS proper. A preamble is totally optional, if you want to go straight into an NIS, skip this and use NIS_START instead. See NIS_START for information about the details table.
ONLY USE THIS INSIDE AN NIS EVENT. Transition from the game (or a preamble) into an NIS. You can do any setup after calling this, as that will occur once the screen has faded to black on the transition in. The game will fade back in to the NIS over the next half second or so (apart from opening cinematics, which is two seconds), so you may want to delay your first action accordingly. The details table should include, at the very least, the following items: style (NIS_OPENING, NIS_MID, or NIS_CLOSING), revealFOW (a Boolean). If you included details in a preamble, you don't need to supply them again here.
ONLY USE THIS INSIDE AN NIS EVENT with an NIS camera. Starts the NIS camera drifting. "Drifting" moves the camera around in the shape of an infinity symbol, so it doesn't look quite so static.
ONLY USE THIS INSIDE AN NIS EVENT with an NIS camera. Stops the NIS camera drifting. "Drifting" moves the camera around in the shape of an infinity symbol, so it doesn't look quite so static.
Stores the current camera position as the NIS's end_camera position. Useful if you want the camera to always end where the player was last looking. If it does not return a position, nothing will be stored.
Wraps the input in a table and returns it. Does nothing if it was already a table.
Create an objective and returns the unique ID for it type could either be OT_Primary, OT_Secondary or OT_Medal
Delete the objective with the specified ID
Delete all objectives
Get the count of the counter on the objective.
Get the maximum count of the counter on the objective.
Get the counter type of an objective.
Get objective progress bar value
Get objective progress bar visibility (not deterministic)
Get objective state ( OS_Off, OS_Incomplete, OS_Complete, OS_Failed )
Get objective visibility
Hide the objective progress panel.
Hide the specified objective progress panel.
Set colour of objective. In order red, green, blue, alpha.
Set the count of the counter on the objective.
Set the maximum count of the counter on the objective.
Set the number of seconds on an objective with a timer. Only used to inform the UI.
Set the counter type of an objective.
Set description text localization ID for the objective
Set icon path for the objective
Set callback functions for the objective. FN_OnActivate is for triggering situation report. FN_OnShow is used to assign UI element when tactical map is open. FN_OnSelect is used to assign UI element when the objective is highlighted
Set objective progress bar value
Make the objective progress bar blink or stop blinking.
Set objective progress bar visibility
Set objective state ( OS_Off, OS_Incomplete, OS_Complete, OS_Failed )
Set title text localization ID for the objective
Set objective visibility
Show the objective progress panel with a progress bar - call repeatedly to update progress. Value should be normalized between [0 - 1].
Show the objective progress panel with a progress bar - call repeatedly to update progress. Value should be normalized between [0 - 1]. Appears in center of screen.
Show the specified objective progress panel with a progress bar - call repeatedly to update progress. Value should be normalized between [0 - 1]. If critical, progress bar will pulse.
Show the objective progress panel with a timer icon - call repeatedly to update progress. Value should be in seconds.
Adds a map highlight around a specific point AreaType is AT_CIRCLE (the default) or AT_SQUARE. Color is a table with three values for red, green and blue - i.e. {255, 0, 0}.
Adds a map highlight around a specific point AreaType is AT_CIRCLE (the default) or AT_SQUARE. Color is a table with three values for red, green and blue - i.e. {255, 0, 0}.
Adds a visual splat on the ground in the world around a certain position, returning the ID The reticule blueprint (the circle on the ground) and the hintpoint template (the arrow) are by defualt taken from the objective type, but you can override them or set them to false to turn that element off.
Adds a visual splat on the ground in the world around a certain position, returning the ID The reticule blueprint (the circle on the ground) and the hintpoint template (the arrow) are by defualt taken from the objective type, but you can override them or set them to false to turn that element off.
Adds a Healthbar tied to a squad or entity at a location. Will update the health bar as the unit's health fluctuates. Can be removed with Objective_RemoveHealthBar or completing/failing the objective If you want to use one of the "global" progress bars (if your project supports them), supply the relevant barIndex value and text string to show alongside it.
Adds a Healthbar tied to a squad or entity at a location. Will update the health bar as the unit's health fluctuates. Can be removed with Objective_RemoveHealthBar or completing/failing the objective If you want to use one of the "global" progress bars (if your project supports them), supply the relevant barIndex value and text string to show alongside it.
Adds a Timer bar for objective timers, which is automatically updated. The bar can be removed with Objective_RemoveTimerBar or by completing/failing the objective. Requires a timer to have been started with Objective_StartTimer to work. If you want to use one of the "global" progress bars (if your project supports them), supply the relevant barIndex value and text string to show alongside it.
Adds a Timer bar for objective timers, which is automatically updated. The bar can be removed with Objective_RemoveTimerBar or by completing/failing the objective. Requires a timer to have been started with Objective_StartTimer to work. If you want to use one of the "global" progress bars (if your project supports them), supply the relevant barIndex value and text string to show alongside it.
Adds multiple UI elements on one position. 'pos' can be group/entity/squad/marker. worldArrow adds a 3D arrow which points to the thing in the world. hintpointText adds a hint point that appears on the thing when moused over. If you're adding an arrow or a hintpoint, this thing will be among those potentially pointed to by the 2D HUD arrow. objectiveArrowOffset is an offset applied to the arrow's position (you can specify a height offset or a 3D position offset).
Adds multiple UI elements on one position. 'pos' can be group/entity/squad/marker. worldArrow adds a 3D arrow which points to the thing in the world. hintpointText adds a hint point that appears on the thing when moused over. If you're adding an arrow or a hintpoint, this thing will be among those potentially pointed to by the 2D HUD arrow. objectiveArrowOffset is an offset applied to the arrow's position (you can specify a height offset or a 3D position offset).
Returns whether all primary objectives have been completed.
Returns whether all primary objectives have been completed.
Returns whether ALL or ANY sub-objectives of the given objective are complete
Returns whether ALL or ANY sub-objectives of the given objective are complete
Returns whether ALL or ANY sub-objectives of the given objective are expired
Returns whether ALL or ANY sub-objectives of the given objective are failed
Returns whether ALL or ANY sub-objectives of the given objective are failed
Bring attention to some UI elements by blinking them. This causes the hintpoint and the off-screen arrow to blink, but leaves the minimap ping and other elements constant.
Bring attention to some UI elements by blinking them. This causes the hintpoint and the off-screen arrow to blink, but leaves the minimap ping and other elements constant.
Completes an objective and removes it from the list (unless it is a sub-objective, in which case it is marked as complete but stays visible until the parent objective is finished) Automatically removes any elements added with Objective_AddUIElements(). The showTitle and playIntel flags let you control whether the titlecard and Intel_Complete event are played (default: true).
Completes an objective and removes it from the list (unless it is a sub-objective, in which case it is marked as complete but stays visible until the parent objective is finished) Automatically removes any elements added with Objective_AddUIElements(). The showTitle and playIntel flags let you control whether the titlecard and Intel_Complete event are played (default: true).
Expires an objective and removes it from the list (unless it is a sub-objective, in which case it is marked as expired but stays visible until the parent objective is finished) Automatically removes any elements added with Objective_AddUIElements(). The showTitle and playIntel flags let you control whether the titlecard and Intel_Expire event are played (default: true).
Fails an objective and removes it from the list (unless it is a sub-objective, in which case it is marked as failed but stays visible until the parent objective is finished) Automatically removes any elements added with Objective_AddUIElements(). The showTitle and playIntel flags let you control whether the titlecard and Intel_Fail event are played (default: true).
Fails an objective and removes it from the list (unless it is a sub-objective, in which case it is marked as failed but stays visible until the parent objective is finished) Automatically removes any elements added with Objective_AddUIElements(). The showTitle and playIntel flags let you control whether the titlecard and Intel_Fail event are played (default: true).
Returns the current count associated with this objective.
Returns the current count associated with this objective.
Returns a table of all sub-objectives of the given objective
Returns a table of all sub-objectives of the given objective
Returns the amount of seconds on the timer (time remaining or time elapsed, based on the type of timer used)
Returns the amount of seconds on the timer (time remaining or time elapsed, based on the type of timer used)
Increases the counter that is associated with this objective in the UI. You can provide an amount to increase by.
Increases the counter that is associated with this objective in the UI. You can provide an amount to increase by.
Returns whether an objective is complete
Returns whether an objective is complete
Returns true if a counter has been set for this objective
Returns true if a counter has been set for this objective
Returns whether an objective is expired
Returns whether an objective is failed
Returns whether an objective is failed
Returns whether an objective has been started. Completed and failed / expired objectives will also return true.
Returns whether an objective has been started. Completed and failed / expired objectives will also return true.
Returns true if a timer has been set for this objective
Returns true if a timer has been set for this objective
Returns whether an objective is visible or not.
Returns whether an objective is visible or not.
Pauses the objective's timer. If a timer has not been set, it does nothing.
Pauses the objective's timer. If a timer has not been set, it does nothing.
'Registers' an objective. Wrapper function for Objective_Create with a few other features. Includes pings as defined by the objective table created in the main scar file. You can pass in a team or player, so that the objective only applies to it.
'Registers' an objective. Wrapper function for Objective_Create with a few other features. Includes pings as defined by the objective table created in the main scar file. You can pass in a team or player, so that the objective only applies to it.
Removes an existing ground reticule by its ID
Removes an existing ground reticule by its ID
Removes a tactical map ping from an objective
Removes a tactical map ping from an objective
Remove a progress bar for this objective.
Removes a group of UI elements that were added by Objective_AddUIElements
Removes a group of UI elements that were added by Objective_AddUIElements
Resume the objective's timer. If a timer has not been set, it does nothing.
Resume the objective's timer. If a timer has not been set, it does nothing.
Sets whether this objective always shows detailed text, the HUD arrow, or the hintpoints. There can only be one objective at a time that forces the HUD arrow to show up. If you pass in 'nil' for hud_arrow then its behavior is not affected.
Sets whether this objective always shows detailed text, the HUD arrow, or the hintpoints. There can only be one objective at a time that forces the HUD arrow to show up. If you pass in 'nil' for hud_arrow then its behavior is not affected.
Sets a counter that is associated with this objective in the UI. You can provide a 'maximum' so that it shows up as "1 of 5"
Sets a counter that is associated with this objective in the UI. You can provide a 'maximum' so that it shows up as "1 of 5"
Show a progress bar for this objective with the given value (which should be a percentage from 0.0 (empty) to 1.0 (full)). This bar can be removed with Objective_RemoveProgressBar or by completing or failing the mission. If you want to use one of the "global" progress bars (if your project supports them), supply the relevant barIndex value and text string to show alongside it.
Shows or hides an objective from the UI and tactical map
Shows or hides an objective from the UI and tactical map
Shows an objective to the player and activates it Includes pings and FOW as defined by the SetupUI() function. The showTitle and playIntel flags let you control whether the titlecard and Intel_Start event are played (default: true).
Shows an objective to the player and activates it Includes pings and FOW as defined by the SetupUI() function. The showTitle and playIntel flags let you control whether the titlecard and Intel_Start event are played (default: true).
Starts a timer that is associated with this objective in the UI. Use COUNT_DOWN or COUNT_UP for the 'direction' parameter
Starts a timer that is associated with this objective in the UI. Use COUNT_DOWN or COUNT_UP for the 'direction' parameter
Stops an objective that is in progress and puts it back into the waiting-to-start state
Stops an objective that is in progress and puts it back into the waiting-to-start state
Stops the objective's counter. If a counter has not been set, it does nothing.
Stops the objective's counter. If a counter has not been set, it does nothing.
Stops the objective's timer. If a timer has not been set, it does nothing.
Stops the objective's timer. If a timer has not been set, it does nothing.
Toggles minimap blips on or off.
Toggles minimap blips on or off.
ONLY CALL THIS FROM INSIDE AN OBJECTIVE'S INTEL START / COMPLETE / FAIL EVENT. The objective titlecard will present itself at this point inside the event. If you omit this call, the titlecard will appear at the end of the event by default. You also do not have to wrap this with CTRL and WAIT stuff - it does all of the internally.
ONLY CALL THIS FROM INSIDE AN OBJECTIVE'S INTEL START / COMPLETE / FAIL / EXPIRE EVENT. The objective titlecard will present itself at this point inside the event. If you omit this call, the titlecard will appear at the end of the event by default. You also do not have to wrap this with CTRL and WAIT stuff - it does all of the internally.
Updates the title and description for the objective. If you only want to set one of them, pass in nil for the other Use the immediate flag to make this change happen immediately, bypassing the queue that objective updates normally sit in (i.e. you're updating the objective's title in the middle of its PreStart() function!)
Updates the title and description for the objective. If you only want to set one of them, pass in nil for the other Use the immediate flag to make this change happen immediately, bypassing the queue that objective updates normally sit in (i.e. you're updating the objective's title in the middle of its PreStart() function!)
Reload mouse over entity's entire list of extension info's
Reload mouse over squad's entire list of extension info's
Reload mouse over squad's weapon property bag
Clear entire draw pathfinding cell list
Draw pathfinding impassable map
Toggle pathfinding entity path
Draw pathfinding grid overlay
Add pathfinding cell to draw cell list
Add pathfinding precise cell to draw cell list
Toggle pathfinding collision circles
Disable displaying the Essence Profiler
Dump the Essence Profiler data onto a file
Enable displaying the Essence Profiler
Get perf stats toggle value
Toggle displaying the Essence Profiler
Returns the number of rigid bodies in the physical world
Returns true if the current specs allows for physics to play
Clears the config changed callback
Clear player color overriding and use the "PlayerColour" setting instead.
Force enable player color that overrides the current "PlayerColour" setting.
Sets a callback firing when user changes the config for player colour
Learns and hides upgrades for each player in mission based on individual CurrentAge and MaxAge.
Hides all unit upgrades for player beyond maxAge.
Learns all research upgrades for player up to and including desiredAge.
Learns all unit upgrades for player up to and including desiredAge.
Lock all unit upgrades for player beyond maxAge.
Add an ability to a player
Specifies a marker where an ability cannot be used. This only applies to abilities where you use the cursor to pick a location in the world (like a location to paradrop at).
Add resource to player, as opposed to just setting it. Player::AddResourceReason, the resource add reason enum, can be nil, RES_Other, RES_Gift, RES_Resourcing, RES_Refund, RES_RefundOnDeath
Add resources to player, as opposed to just setting it.
Gives the player new command points to spent on
Tests if the player can currently use an ability on target entity
Tests if the player can currently use an ability on target player
Tests if the player can currently use an ability on target position
Tests if the player can currently use an ability on target squad
Tests if the player is able to construct a given blueprint
Check if a player of specified group can place an entity at the specified position and facing angle. ebp is the structureBlueprint that must be a valid building that can be constructed by the sgroup.
Any of the player's units in the marker area move out of the area, and can be made invulnerable for a bit whilst they do it You can replace the marker with a position and a range - i.e. Player_ClearArea(player, pos, range, invulnerable)
Clears item, command and construction menu availabilities for the player.
Clears the pop cap override so that modifiers can take effect again
Clears a TargetHandle value in the player's state model corresponding to the given key and table row index (0 based).
Clears a TargetHandle value in the Player's state model corresponding to the given key.
Finish upgrade for a player
Searches the player list in the world and returns the id of the first neutral player
Returns a player given a player id from the ME. NOTE: this is a temp function, and will be replaced with Player_FromName
Returns the type of the given player if it is an AI. Possible types are: AII_None, AII_Normal, AII_LocalHumanTakeover, AII_RemoteAITakeover, AII_RemoteHumanTakeover (-1 if the player does not exist)
Returns the modified cost of the given ability including all modifications added by the given player
Creates/Clears groups that contain all of a player's units and buildings. Defaults - sg_allsquads and eg_allentities Fills an SGroup with all of the given player's squads, and an EGroup with all the player's entities. If you don't provide and groups, then it defaults to using sg_allsquads and eg_allentities.
Returns an sim::EntityGroupObs containing all the players entities including ones in squad. This function returns a 'global' entity group with the name '__Player%dEntities', where %d is the player ID. This means that you should never need to destroy it./n However, if you do destroy it, it will be recreated the next time this function is called.
Gather together all of a player's entities that are in proximity to a marker, a position, or within a territory sector into an EGroup. The EGroup is cleared beforehand. You can override a marker's normal proximity by specifying a range.
Gather together all of a player's squads that are in proximity to a marker, a position, or within a territory sector into an SGroup. The SGroup is cleared beforehand. You can override a marker's normal proximity by specifying a range.
Returns the entityID of the first player owned building listed in the table. This only looks at completed buildings
Returns the entityID of the first player owned building listed in the table. This only looks at under construction buildings
Returns the total number of buildings owned by this player.
Returns the total number of buildings owned by this player (with exclusions).
Returns the number of buildings owned by this player (inclusive).
Returns a number corresponding to the player's latest age upgrade. The result is a number from 1 to 4, but they are also mapped onto these constants: AGE_DARK, AGE_FEUDAL, AGE_CASTLE or AGE_IMPERIAL
Use capType CT_Personnel to get current squad cap, CT_Vehicle to get current vehicle cap, CT_Medic to get current medic cap
Returns the players UI name.
Returns an EntityGroupObs containing all the players entities. This function returns a 'global' entity group with the name '__Player%dEntities', where %d is the player ID. This means that you should never need to destroy it./n However, if you do destroy it, it will be recreated the next time this function is called.
Returns the modified cost of the given entity including all modifications added by the given player
Finds the greatest (or least) concentration of entities owned by a player. This function is slow, so don't call it very often
Returns the number of entities a player currently owns
Returns the number of entities of a certain unit type
Returns the name of an entity a player currently owns
Returns the id of the player
Use capType CT_Personnel to get max squad cap or CT_VehicleCap to get max vehicle cap.
Returns a number corresponding to the maximum age a player can reach The result is a number from 1 to 4, but they are also mapped onto these constants: AGE_DARK, AGE_FEUDAL, AGE_CASTLE or AGE_IMPERIAL
Returns the number of squads currently gathering resources of a given type
Returns the number of strategic points (not objectives) this player owns
Returns the number of strategic objectives this player owns
Gets the current personnel or vehicle population as a percetange of the current max-cap. The captype is either CT_Personnel or CT_Vehicle. captype is CT_Personnel by default. If MaxPopulation is 0, returns 1.0
Returns the race index for the given player.
Returns the name of the race for a given player (eg. allies, allies_commonwealth, axis, axis_panzerelite) and always in english
Returns the amount of resources a given player has. Possible resource types are RT_Manpower, RT_Fuel, RT_Munition, RT_Action, RT_Command
Returns the amount of resources a given player is getting per second. Possible resource types are RT_Manpower, RT_Fuel, RT_Munition, RT_Action, RT_Command
Returns the list of all the resources a given player has.
Returns the lobby slot index for this player, starting at one
Returns the modified cost of the given unit including all modifications added by the given player
Finds the greatest (or least) concentration of squads owned by a player. This function is slow, so don't call it very often
Returns the number of squads a player currently owns
Returns a SquadGroupObs containing all the players units. This function returns a 'global' squad group with the name '__Player%dSquads', where %d is the player ID. This means that you should never need to destroy it./n However, if you do destroy it, it will be recreated the next time this function is called.
Returns the current game state of the player.
Returns a boolean value from the Player's state model corresponding to the given key.
Returns an Entity value from the Player's state model corresponding to the given key.
Returns a boolean value from the player's state model corresponding to the given key and table row index (0 based).
Returns an Entity value from the player's state model corresponding to the given key and table row index (0 based).
Returns a float value from the player's state model corresponding to the given key and table row index (0 based).
Returns an integer value from the player's state model corresponding to the given key and table row index (0 based).
Returns a Player value from the player's state model corresponding to the given key and table row index (0 based).
Returns a Squad value from the player's state model corresponding to the given key and table row index (0 based).
Returns a Vector3f value from the player's state model corresponding to the given key and table row index (0 based).
Returns a float value from the Player's state model corresponding to the given key.
Returns an integer value from the Player's state model corresponding to the given key.
Returns a Player value from the Player's state model corresponding to the given key.
Returns a Squad value from the Player's state model corresponding to the given key.
Returns a Vector3f value from the Player's state model corresponding to the given key.
Returns a value (-1.0 to 1.0) of how close a point is to being controlled by the team of the player provided Progress between -1.0 and 0 means an enemy has progress toward owning a point. Values between 0 and 1.0 represent progress being made toward capture. 1.0 is a team controlled point. -1.0 is an enemy controlled point.
Get the team a player is on
Gets the toal population including Personnel, Vehicle and Medic Directly uses the C++ API Player_GetCurrentPopulation to get the current population for CT_Personnel, CT_Vehicle and CT_Medic.
Returns the UI colour of a player with respect to the local machine. Access with .r .g .b .a. Values are in the range 0-255.
Returns the current number of units the player has.
Returns the cost of an upgrade.
Returns the cost of an upgrade in a specific resource.
Set the gifted resource amount for a given player A positive resource amount means the player receives the resources A negative resource amount means the player sends the resources Ignores income cap and resource sharing.
Tests to see if a player has an ability
Returns true if this player owns any buildings listed in the table. This only looks at completed buildings - use Player_HasBuildingUnderConstruction to see if the player is building something
Returns true if this player owns any buildings listed in the table currently under construction.
Returns true if this player owns any buildings. (with exclusions).
Tests to see if the player has any entities with the specified PBG
Returns whether a player has a map entry position
Return true if the squad has purchased the specified upgrade.
Returns true or false, depending on whether the passed in player ability is active on the player
Returns true if player is still alive and false if player is dead. Will error if playerIdx is an invalid index.
Returns whether a player is human controlled (local or remote), not dead, and not replaced by an AI
Returns true if player has surrendered and false if not. Will error if playerIdx is an invalid index.
Check if id corresponds to a player
Returns the number of upgrades that this player has. The upgradeName should be a relative filename (eg. upgrade/allies/research/phase_2.lua)
Removes a marker that was previously a lockout zone.
Removes all upgrade from a player
Removes an upgrade from a player
Reset the cooldown of an ability on every unit a player has, and the player itself.
Reset the resource amount for a given player to zero. Also reset team weapon Possible resource types are RT_Manpower, RT_Fuel, RT_Munition, RT_Action, RT_Command.
Restrict a list of addons. list should contain an array of strings to restrict.
Restrict a list of buildings. list should contain an array of strings to restrict.
Restrict a list of research items. list should contain an array of strings to restrict.
Sets the availability of an ability. Availability can be either ITEM_LOCKED, ITEM_UNLOCKED, ITEM_REMOVED or ITEM_DEFAULT
Sets availability of ALL entity, squad and player commands.
Sets the availability of entity, squad and player commands. Availability can be either ITEM_LOCKED, ITEM_UNLOCKED, ITEM_REMOVED or ITEM_DEFAULT
Sets the availability of a construction menu. Availability can be either ITEM_LOCKED, ITEM_UNLOCKED, ITEM_REMOVED or ITEM_DEFAULT
Sets the current age of a player Age can be a number from 1 to 4, or any one of these: AGE_DARK, AGE_FEUDAL, AGE_CASTLE or AGE_IMPERIAL
Set default squad mood mode which can be overrided by squad level mood mode settings
Sets the availability of an entity production item. Availability can be either ITEM_LOCKED, ITEM_UNLOCKED, ITEM_REMOVED or ITEM_DEFAULT
Sets the current personnel or vehicle max-cap for a player. The captype is either CT_Personnel or CT_Vehicle (you can't adjust Medic caps just yet). you will have to call Player_SetMaxPopulation to adjust the current max population to do this. Note that any modifiers that adjust the current max cap will be applied on top of this. Also note, this is only adjusting the max cap, not the current cap,
Sets the current personnel or vehicle cap for a player. The captype is either CT_Personnel or CT_Vehicle (you can't adjust Medic caps just yet). Note that any modifiers that adjust the current cap will be applied on top of this. Also note, the current cap cannot go higher than the max cap.
Sets the maximum age a player can progress to Age can be a number from 1 to 4, or any one of these: AGE_DARK, AGE_FEUDAL, AGE_CASTLE or AGE_IMPERIAL. You cannot build the landmark building at the end of the maximum age.
Sets a pop cap override that ignores any modifiers.
Set the relationship that observer has to target. If the relationship does not match the current reputation, the reputation will be changed to match it.
Set the resource amount for a given player. Ignores income cap and resource sharing. Possible resource types are RT_Manpower, RT_Fuel, RT_Munition, RT_Action, RT_Command.
Set the resource amount for a given player. Ignores income cap and resource sharing.
Set all the resource amount for a given player. Ignores income cap and resource sharing.
Sets the availability of a squad production item. Availability can be either ITEM_LOCKED, ITEM_UNLOCKED, ITEM_REMOVED or ITEM_DEFAULT
Sets a boolean value in the Player's state model corresponding to the given key.
Sets a boolean value in the player's state model corresponding to the given key and table row index (0 based).
Sets a float value in the player's state model corresponding to the given key and table row index (0 based).
Sets an integer value in the player's state model corresponding to the given key and table row index (0 based).
Sets a float value in the Player's state model corresponding to the given key.
Sets an integer value in the Player's state model corresponding to the given key.
Sets the availability of an upgrade. Availability can be either ITEM_LOCKED, ITEM_UNLOCKED, ITEM_REMOVED or ITEM_DEFAULT
Abruptly stops an active ability
Prevents a player from earning any action points (and by extention, command points)
Returns an average position for a table of positions
Check if a position is valid or not... useful for functions that may return INVALID_POS
Add this helper function to your prefab's Init function to cover standard trigger zone functionality. It will call a Trigger function in your prefab when appropriate. Your schema needs to include the standard elements: trigger_enable, ignore_planes, trigger_player, trigger_zone and delay
Applies the defaults listed in the prefab schema to the instance data. Any items NOT included explicitly in the instance data will have default values pulled from the schema.
Calls an action function with a given name on an instance, making sure it calls the right version for the type of Prefab. Instance can be a string, this will convert it. Example: Calling the "Trigger" action on an instance that is a PlaneCrash prefab will look for a function called "PlaneCrash_Trigger"
Finalize the initialization of any prefab instances that have been run through Prefab_Init(). This is automatically called one frame after a prefab is initialized, but you can force it early if necessary. If you are creating prefabs and using them in the same frame, call this function once, after all the Prefab_Inits, but before you start using them. This will force the post-initialization to occur early.
Returns a table of all current prefabs matching the instance type
Returns the instance data for a given instance, specified by a number of methods. This normalizes your instance data. You can pass in the instance name as a string, a data table with an instance subtable (i.e. the input params from an event function) or a real instance data table, and it normalizes the format and returns you the instance data table.
Initialize a specific prefab instance. In many cases, this is all you need to do (see the documentation for the specific prefab for details)
Returns if a String is a valid
Stop and restart a prefab instance, pulling a fresh set of the instance data from the WB-exported prefabs. This is meant for testing and debug purposes, rather than use in mission scripts.
Stops a prefab instance from continuing to run. If the prefab has a prefabName_Stop() function, that will be called. Also, all events with the instance as the data parameter will be removed.
Triggers the specified prefab
Prints a message on the screen
Prints the lua content of an object on the screen
Removes the PrintOnScreen text of a given ID
Remove any messages from the screen Removes from the screen any messages put there with PrintOnScreen()
Returns true if ANY or ALL entities from a group are in range of a given position, marker, or territory sector. Markers with proximity type rectangle will use circular proximity check if custom range is supplied\n You MUST specify a range if you are using a position rather than a marker.
Returns true if ANY or ALL of a player's entities are in range of a given position, marker, or territory sector. THIS FUNCTION IS VERY SLOW. DO NOT USE THIS UNLESS ABSOLUTELY NECESSARY. Markers with proximity type rectangle will use circular proximity check if custom range is supplied\n You MUST specify a range if you are using a position rather than a marker.\n
Returns true if ANY or ALL of a player's members (i.e. individual guys, not squads as a whole) are in range of a given position, marker, or territory sector. DO NOT USE THIS FUNCTION UNLESS YOU ABSOLUTELY HAVE TO!! You MUST specify a range if you are using a position rather than a marker.
Returns true if ANY or ALL of a player's squads are in range of a given position, marker, or territory sector. THIS FUNCTION IS VERY SLOW. DO NOT USE THIS UNLESS ABSOLUTELY NECESSARY. Markers with proximity type rectangle will use circular proximity check if custom range is supplied\n You MUST specify a range if you are using a position rather than a marker.\n
Returns true if ANY or ALL squad members (i.e. individual guys, not squads as a whole) from a group are in range of a given position, marker, or territory sector. DO NOT USE THIS FUNCTION UNLESS YOU ABSOLUTELY HAVE TO!! Markers with proximity type rectangle will use circular proximity check if custom range is supplied\n You MUST specify a range if you are using a position rather than a marker.\n
Returns true if ANY or ALL squads from a group are in range of a given position, marker, or territory sector Markers with proximity type rectangle will use circular proximity check if custom range is supplied\n You MUST specify a range if you are using a position rather than a marker.\n
Returns true if ANY or ALL of a teams's squads are in range of a given position, marker, or territory sector. THIS FUNCTION IS VERY SLOW. DO NOT USE THIS UNLESS ABSOLUTELY NECESSARY. Markers with proximity type rectangle will use circular proximity check if custom range is supplied\n You MUST specify a range if you are using a position rather than a marker.\n
Takes something (Entity, Squad, SGroup, EGroup, Position) in, then returns a random position Minimum is ignored if it is greater than the radius Minimum is the distance from the origin point that is guaranteed to have a return greater than
Checks if ALL or ANY players squads are in proximity of a given entity group. Set "all" to true to check that ALL squads are in proximity, or set "all" to false to check for ANY.
Checks if ALL or ANY players squads are in proximity of a given squad group. Set "all" to true to check that ALL squads are in proximity, or set "all" to false to check for ANY.
Activate the raid system
Adds a new spawn location to the existing raid system
Counts the number of idle raiders
Returns the number of current raid parties
Deactivate the raid system (can be reactivated)
Stops all active raid parties and returns them as an SGroup
Use this to initialize the raid system
Returns true if the timer will allow another raid to be launched
Forcibly prunes away all dead raider parties
Removes a specific RovingArmy from the system
Sets the maximum number of raiding parties allowed at once
Sets whether scouts are regularly sent to look for the player
Spawns an extremely basic, small probe attack meant to alert the player more than anything
Updates the composition of the generated raid parties
Returns if a module needs reinforcements according to it's reinforcement settings
Generates a unit table of "missing units" that a module can then request to be provided. This takes the module's "ideal composition" and creates a unit list to fill the current composition back up to a portion of that ideal, as directed by the reinforcement settings.
Return a UnitTable of all the units currently in the request queue for a module. This helps to avoid double-ordering reinforcements - you can add the units requested to the units present when considering whether to reinforce
Once a reinforcement request has been made, this should be called in order to update tracking This also makes any threshold adjustements, etc, specified in the reinforcements table. You need to pass in the requestData so it can be tracked, too, and counted in further reinforcement requests. The skipAdjustments flag lets you force-skip the adjustments step (i.e. you're backfilling after giving up units to supply another request)
Sets a module's "ideal composition" to a given unit table, overriding what was there before
Updates a module's "ideal composition" to subtract an sgroup's units from the high water mark (used when those units are removed from an SGroup)
Updates a module's "ideal composition" to the high water mark of units it has or has previously had
Disable collecting and displaying render stats
Output the render stats to a CSV LogFile for viewing
Enable collecting and displaying render stats
Set the render stats refresh update interval (seconds)
Sort render stats by model instances (descending sort)
Sort render stats by render calls (descending sort)
Sort render stats by shader changes (descending sort)
Sort render stats by mesh triangles (descending sort)
Toggle collecting and displaying render stats
Populate stat tabs in the replay stat viewer. Refer the following xaml for template details: //cardinal/Mainline/assets/cardinal/ui/HUD/Controls/ReplayStatViewer.xaml
Register a callback fired right before the data contexts are set to all players In the callback, manually iterate through all players and pass in the necessary data to the scarModel table of each player
Register a callback fired right before the data context is set to each player In the callback, pass in the data for each player
takes a marker or locationName, and returns a marker. If it's a scarPos, return it
Cleanup resources in cache. Only for debug purposes, not in RTM.
Create a cache to load resources into giving its name and number of resources to hold Once cache is full, the oldest resource will get removed and clean itself up
Log resource references to log. Only for debug purposes, not in RTM. dumps inventory information to ResourceContainerLog file
Disables any resource income - useful to stop resources accruing during the opening movie
Disables any resource income - useful to stop resources accruing during the opening movie
Re-enables resource income.
Re-enables resource income.
Adds a target to the target list. Skip transition means it wont start attacking the new target, and should usually be false.
Adds the targets to the target list
Clears current targets completely
Counts how many targets have NOT been visited yet
Disbands the RovingArmy module entirely, optionally returning the module's units in the passed SGroup (which is NOT cleared)
Orders the module to attack it's next target, and disables withdraw behaviour
Returns the nearest seen squad or entity from a group to a Roving Army
Returns the average position of the rovingArmy, or the spawnLocation if it has no units.
Returns the units currently in the module as a percentage of the unit count the module started with
Returns the position that the module wants reinforcements to head towards.
Gets the rovingArmy's SGroup
Gets the current target, if there is one
Gets the target tables of the given Roving Army
Returns the difference between the current amound of units and the starting unit count
returns true if the module has any living units
Initializes a new RovingArmy module.
Returns true if the module is now empty, but once held units
Returns true if all the RovingArmy module's units are dead
Returns true if the module is now empty
Removes an SGroup from the module
Instructs the rovingArmy to send out a reinforcement request.
Resets a module to start at the begining of its target list
Sets the modules target, removing any previous targets in the process. Skip transition means it wont start attacking the new target, and should usually be false.
Clears any previous targets away, and sets new ones
sets withdrawThreshold
Orders the module to attack it's next target. Call this if the modules was previously given a pause command. Calling this on a module that has withdrawn will only result in it withdrawing again. Call RovingArmy_ForceStart if you want to override withdraw behaviour.
Add a rule to be executed every frame. Returns the ID of the rule just added.
Add a rule to be executed when the event of 'eventType' has happened on entities in the 'egroup' Event types are: GE_EntityKilled, GE_EntityParadropComplete, GE_EntityCommandIssued, GE_ProjectileFired, GE_AbilityExecuted, GE_SpawnActionComplete
Add a rule to be executed when the event of 'eventType' has happened on the 'entity' Event types are: GE_EntityKilled, GE_EntityParadropComplete, GE_EntityCommandIssued, GE_ProjectileFired, GE_AbilityExecuted, GE_SpawnActionComplete
Add a rule to be executed when the event of 'eventType' has happened, regardless of source Event types are: GE_PlayerBeingAttacked
Add a rule to be executed. Can include a start delay, an interval between rule calls and a count of how many times the rule is called. interval can be a number (the interval between subsequent rule calls) or a table with the keys: "delay", "interval" and "count". Returns the ID of the rule just added.
Add a rule to be executed once, after 'delay' seconds. Returns the ID of the rule just added.
Add a rule to be executed when the event of 'eventType' has happened on the 'player' Event types are: GE_PlayerBeingAttacked, GE_PlayerCommandIssued, GE_AbilityExecuted, GE_UpgradeComplete, GE_ConstructionComplete, GE_BuildItemComplete, GE_PlayerKilled, GE_SpawnActionComplete, GE_AIPlayer_EncounterNotification
Add a rule to be executed when the event of 'eventType' has happened on squads in the 'sgroup' Event types are: GE_SquadKilled, GE_SquadPinned, GE_SquadParadropComplete, GE_SquadCommandIssued, GE_AbilityExecuted, GE_SpawnActionComplete
Add a rule to be executed when the event of 'eventType' has happened on the 'squad' Event types are: GE_SquadKilled, GE_SquadPinned, GE_SquadParadropComplete, GE_SquadCommandIssued, GE_AbilityExecuted, GE_SpawnActionComplete
Change 'interval' seconds of all rules with LuaFunction f
Change 'interval' seconds of an existing rule with id
Test if a rule with LuaFunction f is currently active
Test if a rule with id is currently active. Only for TimeRules
Comparison is one of IS_LESS_THAN; IS_LESS_THAN_OR_EQUAL; IS_EQUAL; IS_NOT_EQUAL; IS_GREATER_THAN; IS_GREATER_THAN_OR_EQUAL. Triggers when the number of objects in the group, when compared to value by comparison, is true
Pause all rules with LuaFunction for
Pause all currently active rules. Ignores Unpauseable rules.
Pause all rules with with id. Only for TimeRules
Refreshes all Time and Event rules
Remove all currently active rules with LuaFunction f (this does not remove any event rules)
Kills all rules below a certain priority. The default is to remove ALL rules.
Remove an active event rule for entities in the 'egroup'
Remove an active event rule for the 'entity'
Remove an active event rule that's been applied 'globally'
Remove a currently executing rule (only works inside a rule function)
Remove an active event rule for the 'player'
Remove an active event rule for squads in the 'sgroup'
Remove an active event rule for the 'squad'
Remove a currently active rule with id (this does not remove any event rules)
Replaces the function callback for all currently active rules with LuaFunction f (This only applies to TimeRules)
Replaces the function callback for all currently active rules with an id (This only applies to TimeRules)
Unpause all rules with LuaFunction for
Unpause all rules
Unpause all rules with with id. Only for TimeRules
Activate the scar RulesProfiler
Enable the scar RulesProfiler so it runs in the background. Call this before RulesProfiler_Activate
Returns true if the scar RulesProfiler is active
Don't filter the RulesProfiler displayed rules.
Filter the RulesProfiler to filter displayed rules to given type. E.g., "SCAR", "AI"
Returns true if a squad blueprint exists with the given name.
Returns whether the squad blueprint is of specified race
Adds an ability to all squads in an sgroup.
Add a list of multiple sgroups into an existing group.
Adds a leader to all squads in a group that can take a leader. This function will bypass all cost and queue prereqs
Adds the amount of resource type for a squad. If SGroup contains multiple squads, it will add for all
Add to the list of slot items to drop when any one of the squads is wiped out example: local item = Util_GetSlotItemID( "slot_item/allies_m9bazooka.lua" )
Try group the given list of squads into clusters and returns the average distance between these clusters. Returns -1 if any error occurs.
Calls an Entity_ function on every entity in an sgroup The first parameter of the supplied function must be EntityID
Calls a Squad_ function on every squad in an sgroup The first parameter of the supplied function must be SquadID
Returns whether ALL or ANY squads in an sgroup satisfy a condition, using a Squad_ function to perform the query on each squad The first parameter of the supplied function must be SquadID
Return true if ANY or ALL of a group can reinforce now
Removes all entities from a group.
Clears any previous posture suggestions made to a squad
Instantly adds an upgrade to all squads in a given SGroup.
Check if a group contains ALL or ANY of the blueprints.
Returns true if SGroup contains a particular SquadID
Returns the total number of spawned and despawned squads in a group. NOTE: SGroup_Count does not count the individiual soldiers in an SGroup. For that, use SGroup_TotalMembersCount
Returns the total count of all squads in a given SGroup with the provided blueprint or type
Returns the number of despawned squads in a group.
Counts the total population cost of an SGroup by iterating over each individual Squad
Returns the number of spawned squads in a group.
Returns a new squadron group with the given name. Squad groups are used for all units and vehicles. You can issue orders such as move and attack to an entire squad group. If you want a group for buildings or objects such as trees, use an EntityGroupObs instead. Note that you are allowed to have unamed squadgroups or squadgroups with the samename. Be careful not to create duplicates of your squad group when you dont intend to. To be safe, you can check if the SquadGroupObs you want to create exists using SGroup_Exists( )
Find a squad group from name. Creates a new one with given name if it doesnt exist.
Returns a table of sgroups NOT in the world builder See Marker_GetTable for more info on format parameter
Returns an SGroup with a unique name, prefixed by the 'prefix' parameter.
Returns a new squad group with an autogenerated unique name, optionally prefixed by the string passed in. Use this if you want to create a new SGroup but don't necessarily care about the name.\n Squad groups are used for all units and vehicles. You can issue orders such as move and attack to an entire squad group.\n
Despawn all spawned squads in a group.
Manually destroy a group that you dont need anymore.
Destroys all spawned and despawned squads in a group.
Disables all current combat plans for the squads in the sgroup
Sets whether an entity pays attention to its surroundings
Enables or disables cheering on an Sgroup. Defaults to 60 second duration; pass in -1 for infinite. Defaults to short celebrate walla. WARNING: Units cannot move while cheering. Only works on bipeds. audioDelay delays audio but not animation.
Enable or disable the crown over leader units. The Leader must be the first squad in the sgroup.
Enable or disable minimap indicator on all squads in the sgroup
Enables or disables the surprise feature for an sgroup
Enable or disable decorators on all squads in the sgroup
Returns true if the squad group with the given name exists
Filters an SGroup by blueprint. A table of blueprints can be specified if you want to filter on more than one type. Setting filtertype to FILTER_KEEP results in the group only containing squads of the types listed in the blueprint table. Setting filtertype to FILTER_REMOVE will strip those same squads out and leave those that aren't of the types listed. Setting splitSGroup will move any squads being KEEP or REMOVE to it. This SGroup will NOT be cleared beforehand. SquadTypes can also be used in place of Blueprints. If you want a squad to match a bunch of SquadTypes at the same time (i.e. AND instead of OR) then they can be listed together in a sub-table.
Filters an sgroup base on proximity. Use FILTER_KEEP to keep the affected units, or FILTER_REMOVE to remove them. Set invertPosition to TRUE to affect the units outside the position.
Filters an SGroup by whether units are on screen or not. Percent refers to the screen area you are considering (0.8 is a good value to use - it won't include things that are right at the screen edge). Setting filtertype to FILTER_KEEP results in the group only containing those squads that are on screen.
Searches an SGroup and finds the first threat within the table (searching first to last) and removes all other SBPs.
Call a lua function for each item in a group. Function will recieve (groupid, itemindex, itemid) and should return true to break or false to continue. function Rule_Test( )  local DespawnSquad = function( sgroupid, itemindex, squadID )   Squad_Despawn( squadID )  end  SGroup_ForEach( SGroup_FromName("sg_Squads"), DespawnSquad ) end This functions iterates over spawned squads only.
Call a lua function for each item in a group. Function will recieve (groupid, itemindex, itemid) and should return a bool. Only use this to TEST conditions on squads. DO NOT use this to perform operations on all squads, since it may not call your function on all squads (due to short circuit evaluation). This is used for checking if ALL or ANY items in a group match a given predicate. (eg. Are all items in a group choas marines) This functions iterates over spawned squads only.
Same as SGroup_ForEachAllOrAny except you have a choice to iterate over spawned squads, despawned squads, or both.
Same as SGroup_ForEach except you have a choice to iterate over spawned squads, despawned squads, or both.
Find an squadron group with a given name.
Returns the average health ratio of all units in a squad group. It now uses the same health measure that's used by the UI, so it does take into account fallen members of a squad
Return the average health ratio, including shield strengths, of the squads in the SGroup
Returns the average loadout of all squads in a group as a percent [0.0, 1.0]. Example: A group of squads with loadouts of 4/8 and 1/1 would return 0.75
Return the average shield strengths of the squads in the SGroup (as a percentage)
Gets the COUNT closest squads to POSITION from SGROUP. Does NOT remove squads from the source SGroup
Check invulnerablity state for ALL or ANY squads in a squad group.
Returns the name of a given squad group.
Get the number of slot items with the same ID that the squads in the sgroup own
Gets the amount of resource type for a squad. If SGroup contains multiple squads, it will be the total of all
Builds a table of SGroupIDs that are named in a sequence. i.e. a name of "sg_killer" will find groups "sg_killer1", "sg_killer2" and so on, up until it looks for a group that isn't there.
Returns the distance from the centre of the group of the unit that furthest out.
Returns the squad at a certain position in the group. This is a one-based index (use index 1 to get the first squad in the group.) It is an error if index > SGroup_Count().
Get the suppression level for the first squad in the sgroup
Returns the total health of all units combined in a squad group.
Get the veterancy experience value for the first squad in the sgroup
Get the veterancy rank for the first squad in the sgroup
Returns a table of sgroups from the world builder See Marker_GetTable for more info on format parameter
Test whether ANY or ALL units in a group have a specified ability
Check if ALL or ANY squads in a sgroup have a leader
Check if ALL or ANY of the squads in a group have a specific blueprint. The blueprint can be a table of blueprints or types (see Squad_HasBlueprint() for details)
Returns true if ANY or ALL of the squads in an SGroup are carrying some kind of team weapon
Hide or show all entities in all squads in an SGroup Bool should be true to hide, false to show
Increase squad veterancy experience for all squads in the sgroup. Can do silent promotion (no sound/UI). Can skip modifiers, giving you direct control of experience gained.
Increase squad veterancy rank for all squads in the sgroup. By default, increases rank by 1. Can do silent promotion (no sound/UI. ex: mass rank insrease at mission start)
Same as EGroup_Intersection. Note: You cannot mix squad groups and entity groups. Only squads that are in both groups will be added to 'group'. The contents of 'grouptointersect' will not be changed. Example: group = (1,2,3,4,5,6) grouptointersect = (2,4,6,8,10) --> group will now equal (2,4,6)
Returns true if a named squad group is not empty and its average health is > 0.0
Returns true if ANY or ALL squads in an SGroup are attack moving.
Returns true if ANY or ALL of the squads in an SGroup are camouflaged
Checks if ANY or ALL squads in an SGroup are capturing
Returns true if ALL or ANY squads in a group are currently constructing a building. Set all to true to check for ALL or set to false to check for ANY
Returns true if ALL or ANY squads are attacking within the time.
Returns true if ANY or ALL of the squads in the SGroup is dug in (or in the process of digging in)
Returns true if a named squad group is empty
Returns true if ANY or ALL squads are female
Returns whether any entity in an SGroup has a hold on anything
Checks if ANY or ALL squads in an SGroup are idle
Returns the percentage of the SGroup members that are in cover. Alternatively, specify ANY or ALL as a second parameter to return true/false.
Checks if ANY or ALL squads in an SGroup are garrisoned in an entity (building)
Checks if ANY or ALL squads in an SGroup are garrisoned in a squad (transport vehicle)
Returns true if ALL or ANY squads in a group are infiltrated
Returns true if ANY or ALL squads in an SGroup are moving.
Returns true if ANY or ALL (use those keywords) of the squads in the group are present onscreen. You can pass in a percentage of the screen to check, so 0.8 would be a centered rectangle occupying 80% of the screen.
Returns true if ANY or ALL of a group is pinned
Returns true if ALL or ANY squads in a group are currently calling for reinforcments. Set all to true to check for ALL or set to false to check for ANY
Returns true if ANY or ALL of the squads in an SGroup are currently retreating
Returns true if ANY or ALL squads are setting demolitions
Returns true is ANY or ALL of a group is suppressed
Returns true if ALL or ANY squads are under attack within the time.
Returns true if ALL or ANY squads are under attack from a direction within the time. see ScarUtil.scar for types of directions. you can pass in a table of directions
Returns true if ALL or ANY squads in a group are currently upgrading. You can pass in nil for upgradeid if it doesn't matter what is being upgraded. Set all to true to check for ALL or set to false to check for ANY
Checks if ANY or ALL squads in an SGroup are using an ability Does not check WHAT ability a squad is using.
Check to see if an sgroup still exists without needing the name.
Kills all squads in an SGroup. This kills them 'naturally', as opposed to SGroup_DestroyAllSquads() which makes them blink out of existance.
Plays a speech file on the first squad in an sgroup. Pass in a string with the filepath of the audio file under Cardinal_Speech_Sources e.g. "Civ_Rus/rus_manatarms/rus_manatarms_attack_iHigh_cHigh_03"
Respawn all despawned squads in a group.
Removes an ability that was previously added by SGroup_AddAbility. You cannot remove static abilities (from AE: squad_ability_ext)
Removes upgrade(s) from an sgroup
Restore all current combat plans for the squads in the sgroup
Give action points to the squad
Trigger animation action for an SGroup. Please only use this for simple animations
Trigger animation event for an SGroup. Please only use this for simple animations
Set animation state of a state machine for an SGroup. Please only use this for simple animations
Sets whether a weapon will auto-target things or not
Sets the health of each squad in a squad group to a given percent [0.0, 1.0].
Sets the moral of each squad in a squad group to a given percent [0.0, 1.0].
Overrides crushable behavior for an sgroup
Enable/Disable invulnerablity for an entire SGroup. Use true and false for simple on/off, or use a number between 0.0 and 1.0 for more precise control on how much damage a squad can take before it takes no more. The optional reset_time is used to automatically remove invulnerability after a set time. If invulnerable, both health damage is disabled.
Set soldier mood mode. Mode could be MM_Auto, MM_ForceCalm or MM_ForceTense
Sets all squads in as sgroup to be recrewable or not when abandoned
Sets the amount of resource type for a squad. If SGroup contains multiple squads, it will set for all
Set player selectable state of squads in the sgroup
Enables shared team production on a building (teammates can build using THEIR resources)
Set the suppression level for all squads in the sgroup
Sets the targeting type of entities in an sgroup
Set team weapon in the squads to be capturable or not
Sets the visibility of in-game veterancy art for the squads in given SGroup
Makes an sgroup neutral
Splits an SGroup as cleanly as possible into X new SGroups, returning a table of the SGroups in question
Splits an SGroup as cleanly as possible into multiple SGroups.
Splits an SGroup enough even-sized groups that none is larger than the max size indicated
Suggests a posture to an SGroup, lasting the passed duration Posture of 0 is prone, 1 is kneel/crouch, and 2 is standing. Duration is in seconds, negative means indefinate.
Returns the total count of all members of all the squads in a given SGroup.
Register an init function with the scar system. This init function will be called when scar is started up. **Important: Make sure you do not register two functions with the same name; the init function names should be unique.
execute command string in cheat menu domain. Will only work if dev mode is enabled! (it's OFF by default in RTM builds)
execute console command string. Will only work if dev mode is enabled! (it's OFF by default in RTM builds)
Run the specified scar script file
Run the specified scar command
Toggle drawing debug info for scar markers
Toggle mouse over debug info on which group the entity belongs to
Toggle a list of all egroups and sgroups in the game
Lets lua tell the game when it has finished initializing
Returns true if an init function exists
Reload all scar scripts
Unregister an init function that was registered from Scar_AddInit
Fill table with win condition options - schema is loaded from .win file
Set the UI name of a given player.
Set the race for a given player. Use World_GetRaceIndex() to get the race index from the ME name.
Put a player in a team. Use TEAM_NEUTRAL as the team_id to set the player as neutral
Disable collecting and displaying render stats
Output the render stats to a CSV LogFile for viewing
Enable collecting and displaying render stats
Set the render stats refresh update interval (seconds)
Sort render stats by model instances (descending sort)
Sort render stats by model instances (descending sort)
Toggle collecting and displaying render stats
Create a shield wall stretching from posA to posB, using the units in the sgroup. Units stand in a line shoulder to shoulder, and excess units are used as backfill. PosA should be the left end (as you look at the line), PosB the right, so if the units are facing the wrong way then flip the two positions. If immediate is set to true, units start in wall formation, otherwise they move into position.
Release units from a shield wall
Adds units to the internal SGroups - siege weapons go into the engines group, everything else goes into crew
Can this module currently render military aid?
Stops the Siege module entirely and returns the units it contained
Returns the siege CREW only! We need this for interface reasons, but it doesn't play nicely with how Siege modules work
Returns true if all the Siege module's units are dead
Renders military aid against the target position or SGroup
Pings all nearby modules to see if they can come help - stops when it finds one that can
Attempts to acquire a group of units matching the given scar types; Siege modules do not yield their siege engines
Toggle check requirements information
Draw the current sim tick
Toggle drawing debug info for the attention system
Toggle the crush OBB
Toggle entity information
Toggle entity move state debug drawing
Toggle a list of all active abilities on the entity
Draw the per-entity decision delay if there is one
Toggle posture info text for selected entities
Toggle a list of all active modifiers on the entity
Toggle entity information
Toggle a list of all active modifiers on the entity
Draw the OBBs for the entity
Draw OOC target debug info
Toggle a list of all completed upgrades on the entity.
Is the Market info currently being drawn?
Add a settlement to the market trade manager with specified ID. Settlement will be marked 'not trading' with all players.
Attempts to execute a trade on behalf of the specified player, for the specified resource, of the specified type.
Toggle a list of all active player abilities
Toggle a list of all active player modifiers
Set/clear drawing of the market info.
Toggle simulation boxes for shot blockers only
Toggle simulation boxes for entities
Toggle a list of all active modifiers on the entity
Toggle squad information
Toggle squad suppression information
Play the specified movie.
Stop the currently playing movie.
Toggles the display of the terrain audio environment zones on/off.
for the cheat menu
Force set the combat intensity to be at least combatIntensity for a duration. Use a duration of -1 for an indefinite override. Use a duration of 0 to cancel the override. Does not trigger any music events.
for the cheat menu
Returns true if the sound associated with the handle is currently playing.
stops the music immediately and go into silence.
Plays a 2D sound from the Data:Sound folder. Use the path relative to Sound folder without the file extension. Returns handle to the sound container The sound needs to be 2D Example:  Sound_Play( "Blah/Mysound" )
Plays a 3D sound from the Data:Sound folder on the entity. Use the path relative to Sound folder without the file extension. Returns handle to the sound container The sound needs to be 3D Example:  Sound_Play( "Speech/SpaceMarine/AddOnComplete", TheActor )
Play a speech event based on the local player's race.
Play a speech event based on a player's race.
Plays a walla celebrate sound on the sgroup, respecting the size of the sgroup
Plays a walla charge sound on the sgroup, respecting the size of the sgroup
Plays a walla engage sound on the sgroup, respecting the size of the sgroup
Plays a walla fear sound on the sgroup, respecting the size of the sgroup
Plays a walla spearwall sound on the sgroup, respecting the size of the sgroup
Posts an event on an already playing sound. Returns a handle to the new sound event. Can be used to e.g. call a stop event or enable/disable effects on playing sounds. \Sound_PostEvent( "VictoryEvent", handle )\n
tells the music system if it should be trying to enter/stay in the playing music state
tells the music system if it should be trying to enter/stay in the silent state
Prevents the music system from automatically switching between layers and stopping for the duration.
Set the target combat intensity to at least the value of value combatIntensity for a duration. Use a duration of -1 for an indefinite override. Use a duration of 0 to cancel the override.
sets the scaling multiplier for the music intensity value
sets the race rtpc for controlling what race's music gets played
stops the music immediately and go into silence.
Stops sound associated with the container handle
Spawns groups of units at a numbered sequence of markers
Add a splat to the terrain. Returns a unique decal id allow for future removal via Splat_Destroy
Destroy a splat by unique id
Get the Splat ID that represents an invalid splat (useful to check if creation failed)
Allows the squad to use this ability
Add resources of all types to the specified squad by the specified amount, specifically to the SquadResourceExt.
Add to the list of slot items to drop when this squad is wiped out Squad_AddSlotItemToDropOnDeath( squadid, item, false )
Advance ability cooldown
Test whether a squad can be ordered to do this ability on the target squad
Test whether a squad can be ordered to do this ability on the target squad
Test whether a squad can be ordered to do this ability on the target squad
Checks whether a squad can hold any squad
Returns true if the squad is available to be reinforced
Cancels an item in a production queue. Index 0 is the currently producing item.
Clears any previous posture suggestions made to a squad
Clears a TargetHandle value in the squad's state model corresponding to the given key and table row index (0 based).
Clears a TargetHandle value in the squad's state model corresponding to the given key.
Instantly adds an upgrade to a given squad
Returns the number of units currently in a squad (spawned AND despawned!!)
Create a squad, spawn it and assign it to a player. This will create a squad of size 'loadoutCount' and of unit type 'unit_base' (from squad blueprint) Note: loadoutCount will be clipped to loadoutMin and loadoutMax from the squad blueprint. A loudoutCount of zero means create the whole squad as is.
Despawn the entire squad at its current position.
Remove an squad from the world and destroy it.
Sets whether a squad can produce anything (including upgrades)
Enables or disables the surprise feature on thie given squad
ZERO-BASED get of entities out of squads
Returns total squad extension count.
Returns true if the squad has the specific extension enabled.
Returns a string name of the given extension on the squad.
Tries to find cover within a certain radius of a position, traveling a max distance to get there, and possibly comparing against current position's cover. If no cover is found, it returns the position used for the search.
Get a squad from a mission editor ID.
Returns all active upgrades this squad has.
Returns the name of the squad blueprint (from the attribute editor)
Returns a number representing how good squad cover is -1 for awful, 0 for none, 1 for light, 2 for heavy
Returns the current health of a squad. The current health of the squad is the total health of each entity in that squad.
Returns the max health of the squad. The max health of a squad is the max health of each entity in that squad. This means that the max health of a squad may change when entities are added or removed from the squad.
Returns how much of an original squad's health is left, accounting for deaths (ex: a squad of 3 riflemen would be at 50% health, since they started with 6 members) Note: This is the same percentage that the UI uses.
Returns how much of the squad's health is left as a percentage.
Returns an integer containing the unqiue squad ID for this squad.
returns the Encounter that controls the Squad
Check if the squad is invulnerable or not
Returns the number of invulnerable member
Returns the highest invulnerable min cap percentage from members of the squad.
Returns the max number of units allowed in the squadron (from squad_loadout_ext)
Returns the sum of all entities in a squad's resourceDropOffDistance state model value if it exists and the entities have a state model ext. Otherwise it will return 0.0f
Returns the current minimum armor of a squad. The current armor of the squad is the minimum armor amongst all entities in that squad.
Returns the command ID of the most recent queued command on the Squad.
Get the number of slot items with the same ID that the squad has Squad_GetNumSlotItem( squadid, item )
Returns the production type (PITEM_Upgrade, PITEM_Spawn, PITEM_SquadUpgrade, PITEM_SquadReinforce, PITEM_PlayerUpgrade) for a production queue item with index.
Returns the number of items in the squad's production queue. It is an error to call this function on a squad that does not have a production queue. Use Squad_HasProductionQueue to check that the squad has a queue.
Returns the race property bag group for the given squad
Returns how much of the squad's shield is left as a percentage.
Returns the ID of the slot item. Use Squad_GetSlotItemCount to determine how many slot items the squad has. The first index is 1
Returns how many slot items this squad has
Returns a table of SlotItem ID's that this squad currently owns
returns the Squad that sent the passed squad in a disable state Disable states are: knocked back, stunned, levitate, stasis
Returns a boolean value from the squad's state model corresponding to the given key.
Returns an Entity value from the squad's state model corresponding to the given key.
Returns a boolean value from the squad's state model corresponding to the given key and table row index (0 based).
Returns an Entity value from the squad's state model corresponding to the given key and table row index (0 based).
Returns a float value from the squad's state model corresponding to the given key and table row index (0 based).
Returns an integer value from the squad's state model corresponding to the given key and table row index (0 based).
Returns a Player value from the squad's state model corresponding to the given key and table row index (0 based).
Returns a Squad value from the squad's state model corresponding to the given key and table row index (0 based).
Returns a Vector3f value from the squad's state model corresponding to the given key and table row index (0 based).
Returns a float value from the squad's state model corresponding to the given key.
Returns an integer value from the squad's state model corresponding to the given key.
Returns a Player value from the squad's state model corresponding to the given key.
Returns a Squad value from the squad's state model corresponding to the given key.
Returns a Vector3f value from the squad's state model corresponding to the given key.
Check current squad suppresion level. Return value from 0 to 1
Gets the mobile driver squad from a vehicle squad
Get current squad veterancy
Get current squad veterancy rank.
Gives a slot item to the squad. Can fail due to not enough slots left
Gives all slot items in a table to the squad. The table should come from Squad_GetSlotItemsTable
Tests to see if a squad has an ability
Returns true if there's an active command currently for the squad
Checks whether a squad is of any of the Blueprints or SquadTypes specified. Blueprint can be a single Blueprint, a single SquadType, or a table of multiple Blueprints or SquadTypes. If you want to see if a squad has ALL of a set of SquadTypes, then wrap them all in a sub-table.
Returns true if the given squad has a building in it (includes team weapons)
Returns whether this squad is moving and has a destination
Returns if squad contains an entity with at least minAttachedCount attached interactibles of interactionTypeName type
Returns true if the given squad has a heavy weapon (non moving setup weapon)
Returns true if the given squad has at least one infantry unit in it (includes team weapons)
Returns true if a squad has a production queue.
Returns true if the given squad has team weapon setup for attack
Check if a squad has a specific slot item
Returns true if the squad is carrying some kind of team weapon
Return true if the squad has purchased the specified upgrade.
Returns true if the given squad has a vehicle in it (includes team weapons)
Returns true if the given squad has at least one Entity who has the specified weapon hardpoint.
Increase current squad veterancy
Increase current squad veterancy rank
Stops current squads activity and instant setup the team weapon if they have one
True if the ability is active
Check if the squad is alive
Returns true if the squad is currently attack-moving.
Returns true if any unit in the squad is attacking within the time Time is in seconds
Returns whether ANY entity in the squad is camouflaged
Returns true if the squad is currently capturing.
Returns true if any spawned entity in the squad is a casualty
Returns true if the squad is currently constructing.
True if squad is currently performing the given ability
Returns whether the passed in squad is female
Returns if squad contains an entity that is performing a specific unit role
Check if the squad has a hold on anything (use this on vehicles)
Returns true if Squad is holding position.
Returns true if the squad is idling
returns true if the Squad is in an Encounter
Returns whether or not the squad is in the background. Default returns false (if the squad is empty)
Returns true if ALL or ANY troopers in a squad are in cover. Set all to true to check if all troopers are in cover or set to false to check if any.
Check if the squad is garrisoned in entity (building)
Check if the squad is loaded in squad (vehicle
Returns true if the squad is in melee combat
True if the squad is currently being knocked back
Returns whether any entity in the squad is moving
Determines if this squad is of the given type. Types are defined in squad_type_ext/squad_type_list
Returns true if any entity of a squad (all=false) or the whole (all=true) squad is on walkable wall.
True if squad is currently pinned
True if squad is currently pinned or suppressed
Returns true if the squad is currently reinforcing. This function will return false if the squad does not have a reinforce ext.
Returns true if the squad is currently retreating
Returns true if the given blueprint is of the given type. Types are defined in squad_type_ext/squad_type_list
Returns true if the squad is currently placing charges.
Returns true if the supplied squad pbg is a siege unit
True if the squad is currently stunned
True if squad is currently suppressed
Returns true if any unit in the squad is under attack within the time Time is in seconds
Returns true if the squad was under attack from a certain direction (8 offset types, see LuaConsts.scar)
Returns true if the squad is currently upgrading something specific.
Returns true if the squad is currently upgrading anything.
Check if a squad with the given ID can be found in the world
Kill whole squad. Sets health to 0, and triggers death effects.
Returns the number of upgrades that this squad has.
Precache squad resources and listen for event GE_EntityPrecached that it is done callback example: Rule_AddGlobalEvent(EntityPrecacheComplete, GE_SquadPrecached) Params: sbp - squad blueprint skinID - this is the server item id for a skin, it will precache and equip it player - the player that we want to precache the entity or squad for cacheName - name of cache where resource will be loaded into source - helps identify who requested the precaching id - id to table of data that will be used once entity/squad is loaded
Removes an ability that was previously added by Squad_AddAbility. You cannot remove static abilities (from AE: squad_ability_ext)
Removes a slot item from the squad.
Removes a boolean value in the squad's state model list corresponding to the given key.
Removes a float value in the squad's state model list corresponding to the given key.
Removes an integer value in the squad's state model list corresponding to the given key.
Removes an upgrade from a squad
Give squad action points
ZERO-BASED get of entity blueprints out of squad blueprint
Returns the max number of units allowed in the squad blueprint
Trigger animation action for a squad. Please only use this for simple animations
Trigger animation event for a squad. Please only use this for simple animations
Set animation state of a state machine for a squad. Please only use this for simple animations
Sets the squad to be in the background or foreground. By default, all squads are in the foreground
Enables or disables the squad's UI extension (which controls all UI elements related to the squad)
Set the health of all units in a squad. Health must be in range [0.0, 1.0]
Set invulnerability on the squad. Reset time is in seconds. If it is non-negative, the invulnerability will expire after this time.
Make a squad invulnerable to physical damage when number of members drop to or below specified count. member count, 0 means squad is vulnerable; above 0 means number of alive entities will not go below this count resetTime is the time in seconds that vulnerability will be restored.; zero time for reset time means the buff will last forever
Make a squad invulnerable to physical damage. resetTime is the time in seconds that vulnerability will be restored.; zero time for reset time means the buff will last forever
Set soldier mood mode. Can be MM_Auto, MM_ForceCalm and MM_ForceTense
Sets the squad's move type
Moves the squad to an arbitrary new 3D position. Note that the squad will still have the same properties, so any squad that snaps to the terrain (most land based squads) will interpolate to the terrain height immediately after this move. This function should really only be used for skimmers and other units that require the y axis to be specified. Use Squad_SetPosition() otherwise.
Set entity inside the squad to be recrewable or not when it becomes abandoned
Enables shared team production on a building (teammates can build using THEIR resources)
Sets a boolean value in the squad's state model corresponding to the given key.
Sets a boolean value in the squad's state model corresponding to the given key and table row index (0 based).
Sets a float value in the squad's state model corresponding to the given key and table row index (0 based).
Sets an integer value in the squad's state model corresponding to the given key and table row index (0 based).
Sets a float value in the squad's state model corresponding to the given key.
Sets an integer value in the squad's state model corresponding to the given key.
Sets a boolean value in the squad's state model list corresponding to the given key.
Sets a float value in the squad's state model list corresponding to the given key.
Sets an integer value in the squad's state model list corresponding to the given key.
Set current squad suppresion level. Suppression value value from 0 to 1
Turn on/off display of the unit portrait veterancy stars
Makes a squad neutral
Abruptly stops an active ability
Suggests a posture to a squad, lasting the passed duration Posture of 0 is prone, 1 is kneel/crouch, and 2 is standing. Duration is in seconds, negative means indefinate.
Run a global state tree on an entity The state tree will be queued to run when safe to do so. A global state tree has its own lifetime, separate from any other state trees running on the target. parameters: - keepAlive: whether the state tree should restart if it finishes running - openingBranchName: name of state tree node to run - entity: the entity to run the tree on. This will be the context owner for the spawned state controller
Run a global state tree on a player The state tree will be queued to run when safe to do so. A global state tree has its own lifetime, separate from any other state trees running on the target. parameters: - keepAlive: whether the state tree should restart if it finishes running - openingBranchName: name of state tree node to run - player: the player to run the tree on. This will be the context owner for the spawned state controller
Run a global state tree on a squad The state tree will be queued to run when safe to do so. A global state tree has its own lifetime, separate from any other state trees running on the target. parameters: - keepAlive: whether the state tree should restart if it finishes running - openingBranchName: name of state tree node to run - squad: the squad to run the tree on. This will be the context owner for the spawned state controller
Prematurely finish all queued speech This is useful for skipping all speech events that may have been queued
Prematurely finish currently playing speech and advance the next one in queue This is useful for skipping speech events
Plays a narrative event as a series of subtitled speech transitions when given the event's reflect ID. Pass in the reflect ID (make sure it is represented as an integer) of a NarrativeEvent which is authored in a NarrativeCollection data object. This function will add a wait object which will terminate when all transitions are complete.
Plays a global speech with subtitle and actor icon specified in the narrative line with given ID. The line should be present in an authorable narrative collection and referenced by the reflect ID Adds a wait object if successful. Returns the title ID, call UI_TitleDestroy to remove.
Plays a global speech with subtitle and actor icon in the overlay with speech bubbles on squad decorators. localization id is used for both subtitle text and speech If the speech file is 3D, make sure that is3D is set to true. Shows speech bubble indicator on squad decorator. Call UI_TitleDestroy to remove.
Plays a global speech with subtitle and actor icon in the overlay localization id is used for both subtitle text and speech please make sure that the the speech file is 2D Call UI_TitleDestroy to remove.
Removes "sticky" state from currently playing speech (if any)
Checks whether a sync weapon can attack a target without moving or turning.
Returns true if a sync weapon still exists in the game world
Returns the EntityID of a sync weapon, or nil if it's been destroyed
Registers the sync weapon in the egroup and returns a SyncWeaponID you can use to keep track of it
Registers the sync weapon in the sgroup and returns a SyncWeaponID you can use to keep track of it
Returns the position of a sync weapon, or nil if it's been destroyed
Checks whether or not the actual sync weapon in a squad attacking.
Returns true if the specified player owns the sync weapon. Use a playerid of nil to see if it's unonwed. If player is not specified, then the code will check to see if the SyncWeapon is owned by the world.
Sets whether a weapon to auto-target things or not
Send a player ability command (PCMD_Ability) to a player. Only use this function from code which is executed for a single player (such as UI button callbacks).
Send a positional ability command (PCMD_Ability) to a player Only use this function from code which is executed for a single player (such as UI button callbacks).
Send a positional/directional ability command (PCMD_Ability) to a player Only use this function from code which is executed for a single player (such as UI button callbacks).
Creates a third table that points to every element in table1 and table2, in that order
Copies the contents of the original table returns a new table with the contents of that table
Copies the contents of the original table returns a new table with the contents of that table
Updates myTable by applying default values from the myDefaults table for any items that are not explicitly declared already If the myDefaults table has any item with the value REQUIRED_DATA, then you are declaring that there is no default for this item and that you REQUIRE the user provides a value. You will get a Fatal Scar Error if these are left out, listing exactly which required keys are missing.
Returns a random item from a table. You can return multiple items (without duplicates) by passing in an optional number parameter.
Returns a random item from a table. You can return multiple items (without duplicates) by passing in an optional number parameter.
Takes a table of key-value pairs, where the keys are the items, and the values are the weights. The chance that a particular key is chosen is proportional to its associated weight. Weights should be integers.
Makes a table read-only. This can be done recursively to also apply to any subtables. Any attempts to write to this table after this has been called will trigger a Fatal SCAR Error. You can customize the error message that will be given with the "error" parameter.
Makes a table read-only. This can be done recursively to also apply to any subtables. Any attempts to write to this table after this has been called will trigger a Fatal SCAR Error. You can customize the error message that will be given with the "error" parameter.
Finds the first instance of a given item in the given table and removes it
Reverse the order of items in a table.
Randomizes the order of items in a table.
Returns whether the taskbar is visible
sets taskbar visibility!
Add resource to each member of a team, as opposed to just setting it. Possible resource types are RT_FOOD, RT_WOOD, RT_STONE, RT_GOLD, RT_ACTION
For the given team, get all of the squads gathered into a squadgroup of your naming. This will add all squads for the entire team to one group. To do so for each player, iterate the team table Squads will be added to given squad group. If the given squad group does not exist it will be created.
Any of the team's units in the marker area move out of the area, and can be made invulnerable for a bit whilst they do it You can replace the marker with a position and a range - i.e. Team_ClearArea(team, pos, range, invulnerable)
Returns total number of players on a team
Returns 4 playerIDs (player1, player2, player3, player4) for Humans/Allies
Returns 4 playerIDs (player5, player6, player7, player8) for Enemy Players
Returns the TeamID for a given race. See LuaConsts for constants to use. You can pass in multiple races, for example: allies and commonwealth.
Tests a condition on teams. Calls your function for each player. Parameters of your function: (TeamID, player index, PlayerID). Your function must return true or false to indicate whether the player meets the condition.
Creates/Clears groups that contain all of a team's units and buildings. Defaults - sg_allsquads and eg_allentities Fills an SGroup with all of the given team's squads, and an EGroup with all the team's entities. If you don't provide and groups, then it defaults to using sg_allsquads and eg_allentities.
Gather together all of a teams's entities that are in proximity to a marker, a position, or within a territory sector into an EGroup. The EGroup is cleared beforehand. You can override a marker's normal proximity by specifying a range.
Gather together all of a teams's squads that are in proximity to a marker, a position, or within a territory sector into an SGroup. The SGroup is cleared beforehand. You can override a marker's normal proximity by specifying a range.
Returns the entityID of the first team owned building listed in the table. This only looks at completed buildings Use ALL to return a table containing the first building listed for each player on the team
Returns the total number of buildings owned by this team.
Returns the total number of buildings owned by this team (with exclusions).
Returns the number of buildings owned by this team (inclusive).
Finds the greatest (or least) concentration of entities owned by a team. This function is slow, so don't call it very often
Returns the relationship between 2 teams.
Finds the greatest (or least) concentration of squads owned by a team. This function is slow, so don't call it very often
Returns true if this team owns any buildings listed in the table. Use ALL to check if all players on the team have this building This only looks at completed buildings - use Team_HasBuildingUnderConstruction to see if the team is building something
Returns true if this team owns any buildings listed in the table currently under construction. Use ALL to check if all players on the team have this building under construction
Returns true if this team owns any buildings. (with exclusions). Use ALL to check if all players on the team have buildings EXCEPT this one
Returns true if this team has any players that are human.
Returns whether a team is still alive or not (all member players must be 'alive')
Returns whether a team has surrendered
Restrict a list of addons. list should contain an array of strings to restrict.
Restrict a list of buildings. list should contain an array of strings to restrict.
Restrict a list of research items. list should contain an array of strings to restrict.
Sets the availability of an ability. Availability can be either ITEM_LOCKED, ITEM_UNLOCKED, ITEM_REMOVED or ITEM_DEFAULT
Sets the availability of entity, squad and player commands. Availability can be either ITEM_LOCKED, ITEM_UNLOCKED, ITEM_REMOVED or ITEM_DEFAULT
Sets the availability of a construction menu. Availability can be either ITEM_LOCKED, ITEM_UNLOCKED, ITEM_REMOVED or ITEM_DEFAULT
Sets the availability of an entity production item. Availability can be either ITEM_LOCKED, ITEM_UNLOCKED, ITEM_REMOVED or ITEM_DEFAULT
Sets the current personnel or vehicle max-cap for each player on a team. The captype is either CT_Personnel or CT_Vehicle (you can't adjust Medic caps just yet). you will have to call Team_SetMaxPopulation to adjust the current max population to do this. Note that any modifiers that adjust the current max cap will be applied on top of this. Also note, this is only adjusting the max cap, not the current cap,
Sets the current personnel or vehicle cap for each player on a team. The captype is either CT_Personnel or CT_Vehicle (you can't adjust Medic caps just yet). Note that any modifiers that adjust the current cap will be applied on top of this. Also note, the current cap cannot go higher than the max cap.
Sets the availability of a squad production item. Availability can be either ITEM_LOCKED, ITEM_UNLOCKED, ITEM_REMOVED or ITEM_DEFAULT
Sets up the tech tree for a whole team based off the year
Sets the availability of an upgrade. Availability can be either ITEM_LOCKED, ITEM_UNLOCKED, ITEM_REMOVED or ITEM_DEFAULT
Hide metadata layer overlay on terrain
Display metadata layer on terrain. Replaces previously displayed terrain highlight
Create a splat on the terrain
Draw a grid on the terrain with tunable increment
Draw lines on a grid on the terrain with tunable spacing
Draw terrain material map cells
Takes a ScarPosition and returns a number representing the cover type at this position
Takes a ScarPosition and returns a string representing the cover type at this position
Load the saved terrain height map. This will restore the state of the terrain height map to
Save the current terrain height map. It can be restored to that state by using Terrain_LoadHeightMap.
Returns true if the Territory contains the given SectorID.
Returns the SectorID of the closest Sector Generator point to the given ScarPosition.
Returns a table of SectorIDs that are adjacent to the given SectorID.
Returns the primary entity in the given sector, if one exists, and nil otherwise.
Returns the sector containing the given ScarPosition.
Get the creator entity of the sector by sectorID
Returns the generator point of the given sector, snapped to the surface of the terrain.
Get the ID of the owner of the sector
Returns true if the territory is a HexagonTerritory.
Auto generates a test configuration template and stores it for later saving. This is a debug feature. The system tries to gather the parameters of the calling function and auto generates a template for it. The resulting template is added to a list which is written to cache:AutoConfig.json (see TestConfig_SaveCachedTestTemplates() above). If you use a non json compatible type you need to update _SerializeParameters above. See example for ScarPos.
Tries to load the test configuration from the command line argument. See TEST_CONFIG_ARGUMENT_TEST_CONFIG above. See definition of TestConfig_LoadFromFile.
Tries to load the test configuration from the given file. The test configuration file is a json file containing groups of tests. Each test is defined with a function to call and its parameters. The system parses the file and tries to invoke the functions in the global space (by calling _G[function_string] ). Tests marked as active: false are skipped. Parameters either need to be json compatible (strings, numbers, boolean) or have a 'constructor' function associated to them. e.g: 2D positions { "parameters": [ 0, -20 ], "func": "Util_ScarPos" }
Writes the tests to a json file.
expect_destruction=nil will let the test determine this value based on entity targeting settings expect_destruction=nil will let the test determine this value based on entity targeting settings
idx used to should be unique per run to prevent entity stacking expect_destruction=nil will let the test determine this value based on entity targeting settings
small version of TestGroup_SquadBasics() without the combat-specific tests
spawns instances of an unit in a grid, then kills it to trigger physics destruction. Fails if to rigid bodies where created. params table : testName, unitPath, quantity, spacing, slowdown, timeout_seconds, use_telemetry
Calls given method/parameter combinations one at a time to avoid blocking for long calls.
Expects to receive a table in the format of {{func=
Destroy neutral entities like wrecks, gaia, etc
Destroy player squads and entities
Destorys all player owned squads and every player or neutral entity
Destroy specified player squads and entities from the blueprint list Destroys all squads and entities belonging to player that match one of the
Returns all blueprints that match the given filters. Filters the property bags inside attrib/instances and returns the paths that match the filters. After matching the base filter this part of the path is removed and the detail filter is applied. Example: base_filter "sbps\races\eng\" will match all english units. detail filter "archer" will return return a table with "unit_archer_2_eng", "unit_archer_3_eng", "unit_archer_4_eng"
Draws a circle at the given location. calls a render debug function in a way that creates a visible outline on terrain. Any provided colour value that isn't within the char bit range (0 - 255) will be adjusted. The colour, segment and thickness parameters are optional and will default to reasonable values if excluded.
Applies a modifier making player 1 build the given ebp faster. The modifier is returned.
Prints the location and health of all player owned squads and entities Iterates over all players and prints the position and health of all squads and entities the player owns.
Prints the location and health of all entities owned by a player Iterates over all entities a player owns and prints their blueprint name, position and health.
Prints the location and health of all squads owned by a player Iterates over all squads a player owns and prints their blueprint name, position and health.
Create a new unit test and add it to the given table Once all tests have been added using this function, the test group passed to t_test_group should be passed
Spawn entities in a grid based on a list of blueprint names. Grabs one entry of the given blueprint list each iteration and spawns it. Then it creates a new timed rule requesting to be called again as soon as possible. This gives the engine time to update in between calls so that the other threads are not blocked in case a huge list of units needs to get spawned. Once every unit is spawned the given callback function will be called. The spawning grid starts at the given top left corner and spawns in an axis aligned grid based on the given spacing. The grid expands towards positive x/z
Spawn squads based on a list of blueprint names. Grabs one entry of the given blueprint list each iteration and spawns it. Then it creates a new timed rule requesting to be called again as soon as possible. This gives the engine time to update in between calls so that the other threads are not blocked in case a huge list of units needs to get spawned. Once every unit is spawned the given callback function will be called.
Compare two values and print to standard_test if they are close enough Uses equality if acceptable_difference is nil or 0
Compare two values using the given comparator
Compare two values and print to standard_test if they are equal Uses equality if acceptable_difference is nil or 0
Destroy all threat groups
Destroy a threat group
Add a timer to be triggered every 'freqInSec'. the timer will then run the passed-in command
Add a timer to be triggered every frame the timer will then run the passed-in command
Add a timer to be triggered once after 'freqInSec' has elapsed. the timer will then run the passed-in command
Remove specified timer
Add the amount of time to the specified timer
Advances the timer by the specified amount of time
Display (in the console) the amount of time remaining in the specified timer.
Displays a timer on the screen - You need to call this regularly (i.e. every second) to update the onscreen display. THIS IS A TEMPORARY FUNCTION - WELL GET PROPER UI SUPPORT LATER ON
Stop the specified timer.
Returns whether the timer with this ID exists
Returns how much time has elapsed since this timer has been started
Returns TWO values: minutes and seconds. Provide it a function like Timer_GetRemaining or Timer_GetElapsed
Get the remaining time for the specified timer.
Check if the timer is paused.
Pause the specified timer. Pause and Resume calls are ref-counted: if you have called Pause twice on a timer, you will also need to call Resume twice in order to start the timer up again.
Resume the specified timer. Pause and Resume calls are ref-counted: if you have called Pause twice on a timer, you will also need to call Resume twice in order to start the timer up again. Set the force parameter to true if you want to bypass the refcounting and make sure a timer starts up again.
Start a timer with the specified id, taking the required period ( in seconds )
Toggle physics debug drawing
Toggle physics debug drawing
Toggles the scanning info from the ScanForTarget track for the debug entity
Stops the TownLife module entirely and returns the units it contained
Returns true if all the TownLife module's units are dead
Changes the player owner
Starts a rule which will monitor the mission for trade cart deaths belonging to the specified players, and has a 1/3 chance of dropping a random resource pickup.
register two callbacks to a goal. One fires when starts while the other fires when completes.
add an extra tag to an existing goal.
Adds a sequence of goals to the training system, also starting the sequence's timer
Enable/disable goal sequence Also restarts the timer for the goal sequence
Enable/disable goal sequence with given id
Terminates a goal sequence
Creates a goal object A goal represents one step in a training sequence. Each goal gets one hint popup. Only one goal hint will be displayed at a time. key is the object to visually anchor the hint to. This can be: - the name of an adornable UI element - an entity - a squad - the pbg of a production button - a squad or entity unique id - UniqueSquadButton will anchor to the hero selection - UniqueRespawningSquadButton will anchor to the respawning hero element - CenterLeftSecondaryInfo will anchor to the information panel left of the command card. data is a table of arbitrary information for use in the isCompletePredicate and is routed to the ui. It should include: Message: Localized text to display on the hint pop-up. Use DataTemplate: template for the UI hint. Options are: - LeftClickTrainingDataTemplate: a box displaying an image of a left clicking mouse and message text - RightClickTrainingDataTemplate: a box displaying an image of a right clicking mouse and message text - PanCameraTrainingDataTemplate: a box displaying an image of a middle clicking mouse and message text - GenericTrainingDataTemplate: a box displaying message text - LargeGenericDataTemplate: a larger box dislpaying message text isComplete predicate to run on the goal. It should return true if and only if the goal is complete.
Creates a goal sequence A Goal Sequence represents the a single high-level task to prompt the user to do, composed of one or more goals. The goal sequence will begin when its trigger predicate is met, assuming its ignore and bypass conditions aren't met first. Only one goal sequence will be run at a time. id - unique string id to identify or reference the goal seqeuence repeatMax - if the goal sequence has been completed less than repeatMax times and its triggerPredicate passes, the goal sequence will run again. Infinite if less than 0. remindMax - if the . Infinite if less than 0. trigger - predicate to run on the goal sequence. If it returns true, start the goal sequence. ignore - predicate to run on the goal sequence. If it returns true, don't show the goal sequence even if trigger passes. remind - predicate to run on the goal sequence. It should indicate that the player needs a reminder on how to do the task. If it returns true, show the goal sequence again. bypass - predicate to run on the goal sequence. It should indicate whether the player has completed the goal without prompting. If true, the goal sequence will be ended and its completion count incremented. canRegress - if the complete condition for the current goal in the sequence stops passing, back up to the previous goal goals - list of goals to proceed through to as part of this goal sequence repeatMax and remindMax will be infinite if less than 0.
Transfers all units from one module to another module, without destroying the source module
Displays a breif UI warning in the critical alert message area.
Add a new child named childName and of type typeName to elementName.
Adds a command binding for groupName.bindingName to global function callbackName.
Adds the event handler on elementName for event eventName to global function callbackName(elementName, eventName). The callback function should take two arguments, the element name and the event name.
Creates and flashes an ability button on the taskbar if the unit is selected Length parameter determines how long to flash the item, and the blueprint filter is used if certain squad types need to be selected before flashing the button.
Add text to elementName.
Toggle off all territory lines. Each call to UI_AllTerritoryHide must be matched by a call to UI_AllTerritoryShow
Toggle on all territory lines. Each call to UI_AllTerritoryShow must be matched by a call to UI_AllTerritoryHide
DEPRECATED! Removes a message added by UI_AutosaveMessageShow.
DEPRECATED! Shows a message indicating that the game is autosaving. DEPRECATED! Call UI_AutosaveMessageHide to remove the message.
Toggle off capture-point boundary lines. Each call to UI_CapturePointLinesHide must be matched by a call to UI_CapturePointLinesShow
Toggle on capture-point boundary lines. Each call to UI_CapturePointLinesShow must be matched by a call to UI_CapturePointLinesHide
Clear the contents of elementName.
Clears an event cue with a specific ID. The ID is obtained as a return value from either UI_CreateEventCueClickable or UI_CreateEventCueClickableByType.
Clears all active event cues
Clears the ability phase callback
Clears the construction phase callback.
Clears the construction phase callback.
Clears the try-to-skip-NIS callback
Set the numner of columns in the command card.
Set the numner of rows in the command card.
Toggle off cover preview. Each call to UI_CoverPreviewHide must be matched by a call to UI_CoverPreviewShow
Toggle on cover preview. Each call to UI_CoverPreviewShow must be matched by a call to UI_CoverPreviewHide
Create a table that will be interpreted as a command for UI properties.
Create a table that will be interpreted as a data context for UI properties.
Creates an event cue without a callback (you won't know when it's clicked).
Creates a event cue with custom lua callback function when icon is clicked. Lifetime of -1 means use the default. The return value is an event cue ID. The callback receives one parameter: the ID of the event cue that was clicked. the lua function is executed when the event cue icon is pressed example: UI_CreateEventCueClickable( "event_cue_icons/icon_player_attacked", "General_alert", 42761, 42762, prt, -1 )
Creates a named event cue. Returns the ID associated to the created event cue item. This ID can be used to clear the event cue item with UI_ClearEventCueFromID. The Lua function callback passed in takes an ID as an argument which can be used to clear the event cue with UI_ClearEventCueFromID.
Create a position tag.
Hides the mouse cursor
Shows the mouse cursor if it has been hidden
Removes a blip already created on the minimap
Destroy a position tag.
position: same of or extremely close (std::numeric_limits
Enable or disable entity decorator. The default is decorator enabled.
Turn on or off entity minimap indicator. The default is enabled
Enable or disable entity selection visuals. The default is visuals enabled.
Enables or disables event cues.
Enables or disables resource kickers. Possible resource types are RT_Manpower, RT_Fuel, RT_Munition, RT_Action, RT_Command.
Turn on or off squad decorator. The default is decorator enabled
Turn on or off squad minimap indicator. The default is enabled
Enables or disables event cues.
Triggers an event cue to start its fadeout animation. The animation is determined in XAML.
Begins flashing an ability widget. Flashes a taskbar binding associated with a specific ability ID.
Flashes a construction button associated to a building EBP.
Flashes the entity using attributes from [tuning][ui]
Flash an entity order command button. Pass the return value to UI_StopFlashing to stop flashing the button.
Flashes an event cue icon
Flash a menu command button. Pass the return value to UI_StopFlashing to stop flashing the button.
Flashes an objective counter
Flashes an objective icon
Flash a production building button. Pass the return value to UI_StopFlashing to stop flashing the button. Type should match the unit_class of a Production Building in the army bag for the player's race
Begins flashing a production widget. Flashes a taskbar binding associated with a production type and PBG id. Use PGB id of -1 if you only care about the production type. Type may be one of PITEM_Spawn, PITEM_SquadUpgrade, PITEM_Reinforce
Flash a squad order command button. Pass the return value to UI_StopFlashing to stop flashing the button.
Flash a button on the USS for this entity. Pass the return value to UI_StopFlashing to stop flashing the button.
Flash a button on the USS for this squad. Pass the return value to UI_StopFlashing to stop flashing the button.
Returns the icon name for a given ability
Converts a colour table to an ARGB hex string (e.g. {a=0, r=255, g=204, b=136} => #00FFCC88).
Gets an enum value indicating the visibility of decorators for an entity.
Gets an enum value indicating the visibility of decorators for a squad.
Returns whether all decorators are enabled or not
Highlights an SGroup in the UI for the given duration
Turn on squad highlight UI feature for the duration
Is a replay match currently.
Fades the letterbox to a given RGBA colour over a number of seconds by a given aspect ratio. Call UI_TitleDestroy to remove.
If the message box is activated, close it. The callback will receive the button parameter given.
Reset message box data set by previous calls (to display a new message box).
Set the text/tooltip/enabled state of a button on the dialog.
Set the title and message body of the dialog.
Create a reticule
Destroy a modal visual
Brings up a message and arrow pointing to a HUD feature. Accepted parameters are: HUDF_AbilityCard, HUDF_MiniMap, HUDF_Upgrades, HUDF_CommandCard, HUDF_None Call UI_TitleDestroy to remove.
Toggle off terrain out of bounds lines. Each call to UI_OutOfBoundsLinesHide must be matched by a call to UI_OutOfBoundsLinesShow
Toggle on terrain out of bounds lines. Each call to UI_OutOfBoundsLinesShow must be matched by a call to UI_OutOfBoundsLinesShowHide
Remove elementName from its parent.
Removes a command binding for groupName.bindingName.
Removes the event handler on elementName for event eventName to global function callbackName(elementName, eventName). The callback function should take two arguments, the element name and the event name.
Only allow buildings to be placed inside a marker
Fades the screen to a given RGBA colour over a number of seconds. mouse input is blocked during the fade, and you can control whether the input keeps being blocked after the fade has ended (be careful!)
Toggle off sector lines. Each call to UI_SectorsHide must be matched by a call to UI_SectorsShow
Toggle on sector lines. Each call to UI_SectorsShow must be matched by a call to UI_SectorsHide
Sets the game to allow allied squads to be selected at the same time as your own squads
Enables or disable load and save features at the pause menu
Sets the visibility of the Command Point meter.
Sets a callback firing when user select a control group either by hotkey or by control group button
Converts table to a data context for bindings of elementName.
Enables or disables all decorators
Enable/Disable pause menu showing up when the pause menu hot key is pressed.
Converts table to a data context exposed through entity models.
Explicitly set the decorator a squad should use.
Sets the game to force show subtitles even if the player has them turned off.
Sets the angle of True North for the minimap in degrees
Sets a function to be called when the player clicks an ability and gets a targetting UI. Your function will have 2 arguments: [Blueprint] ability blueprint, [Real] phase: MAP_Placing, MAP_Facing (only if ability requires facing) or MAP_Confirmed
Sets a function to be called when the player clicks a construction item and gets a targeting UI. Your function will have 2 arguments: [Blueprint] ability blueprint, [integer] phase: TP_Position, TP_Facing (only if ability requires facing), TP_Issued (not strict) or TP_Cancelled (for all issuables)
Sets a function to be called when the player clicks a construction item and gets a targeting UI. Your function will have 2 arguments: [Blueprint] ability blueprint, [integer] phase: TP_Position, TP_Facing (only if ability requires facing), TP_Issued (not strict) or TP_Cancelled (for all issuables)
Converts table to a data context exposed through player models.
Sets the property propertyName on elementName to value stackVar.
Sets the properties on elementName to the key/value pairs in propertyTable.
Sets a level decorator that's defined in all of the squads squad_ui_ext in the target SGroup if level value is -1 it will hide the special decorator, if no level is defined -1 is default
Sets a callback firing when user try to skip the NIS
Converts table to a data context exposed through squad models.
Explicitly set the decorator a squad should use.
Turn on of off the squad decorator being always visible. The default is decorator not always visible.
Stops a flash handler of a given id. If the given flash handler doesn't exist, then there is no effect.
Removes a message added by Game_ShowSystemMessage.
Shows a system message in the area where Game Paused text appears. Call Game_HideSystemMessage to remove the message.
Removes a title using an id returned by the title creating function.
Toggles all decorators on or off.
Removes the restriction on building placement
Forces ALL in-process deployments to complete instantly.
Forces all in-process spawns / deploys to complete instantly.
Forces a specific in-process deployment to complete instantly.
Forces a specific index of the deploy table to complete instantly.
Create and spawn a set of units (a "deployment") in one go. See details here: http://relicwiki/display/EE/Core+Unit+Entry+Framework
Forces all in-process exits to complete instantly.
Returns a spawnLocation and Facing. If the unit has a custom spawn, it uses that, otherwise it gets it from deployment
Forces all in-process exits to complete instantly.
Checks if a non-townLife module has units to fulfill a request, and is willing to give those units up according to its unitProvider data
Unit spawners can't be defeated, for now
Add all of the units in a UnitTable to another UnitTable
Add units of a specific type to a UnitTable
Count how many units of a given type there are in the UnitTable
Returns the count of the units in a UnitTable
Remove all of the units in a UnitTable from another UnitTable
Removes units of a specific type from a UnitTable
If there's a squad under the mouse cursor, this adds it to a unique SGroup. Return value is the SGroup it was added to, or nil if there was no squad under the mouse cursor. Pass in true for 'clearGroup' to clear the sgroup before adding the squad.
Applies any modifier to the target SGroup, EGroup, or Player Valid applytypes are MAT_...(Entity, Squad etc.), if left default assumption is default type for the target Cases you want to define applytype: Weapon Modifiers, Enable Modifiers, or a player modifier for all entity or squad types Valid mathtypes are MUT...(Addition, Multiplication, etc.) Exclusive modifiers will replace all pre-existing modifiers of that modifier type on the target
Auto-generate an Ambient Event. These are Low priority, and will hopefully interrupt nothing. Takes a table of Actors and LOC numbers
Auto-generate an Intel Event. These are medium priority, and will interrupt ambient, but not an NIS. Takes a table of parameters defining speaker(s) and line(s)
Auto-generate an NISlet Event, a simple NIS meant to convey mission location. These are high priority, and will interrupt ambient and Intel Events. Takes an NISLET type and a table of parameters defining speaker(s) and line(s) NISLET_BLACK2GAME = 1 -- starts in black and fades up, ends in gamplay NISLET_GAME2GAME = 2 -- transitions from game play to letterbox and backto gameplay NISLET_GAME2BLACK = 3 -- starts in gameplay and ends in black NISLET_GAME2LETTER = 4 -- starts in gameplay and ends in letterbox mode (for transition to sitrep) NISLET_TIME = 1 -- use seconds to wait on camera movements NISLET_VO = 2 -- use voice to wait on camera movements t_eventes.nislet_start = { {camPos = pos1, waitType = NISLET_TIME, waitValue = 5}, {camPos = pos2, waitType = NISLET_VO, waitValue = {ACTOR.GenericAlly, 000000}}, }
Automatically save the game for the player. The savegame name is built using the abbreviated mission name + checkpoint. You can optionally have it wait until the player is out of combat. This function checks the user setting regarding autosaves (so you don't have to!), and does nothing if the player has them disabled.
Plays a speech file on the first squad in an sgroup. Pass in a string with the filepath of the audio file under Cardinal_Speech_Sources e.g. "Civ_Rus/rus_manatarms/rus_manatarms_attack_iHigh_cHigh_03" Destroy all Squads and disable Mission_Fail rules
Clears vehicle wrecks from a given area. Area can be a marker (with or without a range override), a position and range combo, or a territory sector ID. Uses EBP.WRECKED_VEHICLES unless wrecksList is defined.
Helper function to process comparisons that use the Comparison enum... i.e. return true if value1 IS_LESS_THAN value2 Comparison type can be IS_EQUAL, IS_LESS_THAN, IS_LESS_THAN_OR_EQUAL, IS_GREATER_THAN, IS_GREATER_THAN_OR_EQUAL or IS_NOT_EQUAL
Spawn (and immediately kill) a series of units to create a field of corpses for outro cameras. units_table can either be a single SBP or a table/tables in the same basic format as UnitDeploy functions. Each entry in that table can optionally have numSqauds (defaults to 15), spawn (an override spawn location), rad_min (radius from center not to spawn in; defaults to 2), rad_max (defaults to marker radius or 20), player (defaults to player 2). cleanLocation allows you to have a marker that will be cleared of corpses.
Creates a given number of entities at a location and adds them to an egroup. A PlayerID of nil will create the entities as world objects. The skipForceConstruct parameter allows you to skip the step that normally spawns buildings fully constructed, so you can spawn buildings that self-construct. The toward parameter should be a world location that the entity should look at, NOT a direction. Leave it blank if you want the location's orientation to be used for a direction (assuming location is a marker). The useMarkerTransform parameter, if no toward is passed in, will determine if the marker's transform should be used for the entity OR if the marker's direction should be used in which case the entity will face the same way as the marker.
High level function to create squads and give them basic orders upon spawning. Detailed explanation found in ScarUtil.scar
High level function to deploy squads in different ways. Details can be found in UnitEntry.scar Spawntype spawntype - enum of the spawn type (ex: SPAWN.Race_Teleport). SPAWN.No_Type can be used to force a spawn with no type\n
Takes in a table and chooses the right variable for the difficulty setting. 1-4 elements. Acquires current difficulty by default.
Wrapper to trigger proper audio and video settings for entering or exiting intro and outro cameras. Setting enable to true enters the camera mode; false exits. Pass in CAM_INTRO or CAM_OUTRO for camera_type. Keep_gampelayunits_forOutro removes gameplay units by default unless set to true. fowUnRevealDelay sets the delay for when to hide units in FoW (3.825 seconds is the default).
Enters Cinematic mode
Checks the entity count for the world and returns true or false depending on the result. A specific value can be passed in to override the default amount.
Exits Cinematic mode
Try to garrison a loadable building within radius that is closer to the first squad of the sgroup than enemy The squad suppression would be resetted before fallling back so that they would not succumb to pinned state Returns the entity id of the building that the squad try to garrison into. Return nil if nothing is found
Enters Fullscreen mode
Returns the closest MarkerID to the entity/marker/pos/egroup/sgroup/squad from the table of markers provided
Wrapper function for command line arguments. DO NOT USE MORE THAN ONCE PER ARGUMENT. It is impossible for them to change after application start, so save the result and reuse it.
Returns the squared distance between two objects This is much cheaper to calculate that Util_GetDistance(), and fine for when you're only comparing results against other squared distances (i.e. to find the closest item)
Find all the entities with a given blueprint in sourcegroup and add them to destgroup. See also: EGroup_Filter()
Returns a unique SGroup used to hold mouseover squads obtained from Util_AddMouseoverSquadToSGroup
Returns a position from entity/marker/pos/egroup/sgroup/squad
Returns a random position within an area that is not near a player searchRadius is the area to look for the location in. Distance is how far from the player's units the position must be. Useful for dropping artillery NEAR a player, but not on him, for example.
Returns a random position either within the marker's proximity or with a pos and range provided. Range is ignored for rectangular markers
Gets the relationship between two of: entity, squad, egroup, sgroup, player. for groups, the first item is used. returns R_ENEMY, R_ALLY, R_NEUTRAL, R_UNDEFINED, or nil (if world owned or invalid parameters)
Find all the squads with a given blueprint in sourcegroup and add them to destgroup. See also: SGroup_Filter()
Returns trailing numbers from a string, if it exists, nil otherwise. E.G. "marker23" would return 23.
Grabs the selected squads/entities and returns them in a group. Only works with -dev. Tries to return an SGroup first. If it's empty, it will return an EGroup. (Both types can't be selected at the same time)
Returns true if given entity/marker/pos/egroup/sgroup/squad has a position; if false, Util_GetPosition will fail.
Hides all of a player's squads and/or buildings Doesn't hide buildings a player is in, or any base structures. Only items like sandbags, tanktraps, mg nests, etc. Put multiple playerIDs in a table to hide many players together, or use ALL for the playerID to apply to all players at once.
Returns whether cinematic mode is active
Returns whether the currently running sequence has been skipped
Tracks a syncweapon ID and destroys it (by default) or makes it uncapturable (if kill is set to false)
Play an events file at a given markers location
Play the mission title fade.
Calls UI_NewHUDFeature() as an IntelEvent. Will get queued as any other event. See UI_NewHUDFeature() for parameter details.
Enters Normal mode
Run a series of camera splines, each with optional speech lines and functions
Play a movie. If onCompleteAfterMovie is true, the onComplete function will play as soon as the movie is over, instead of after the fade-in Plays a movie file after fading out the screen. Fades back in and triggers onComplete once it ends. If fadeIn < 0, does not face back in once complete.
Plays music from the Data:Sound folder, and stores the music track so it can be resumed after a save/load The new music will phase out the old one. There can only be one music playing at anytime.
Simply prints something if the first variable is true
Prints out the entire contents of an Object Objects can be anything (Player, SGroup, Int, Table, String, etc.), but this is most useful for Tables This is most useful when used in conjunction with fatal() or bug() to populate the log file.
Simply prints out everything in a table including nested tables
Prints out a unit table. indent is the number of tabs at the beginning of each line
Reloads the running scar script. Current running rules would also be updated to the redefined functioin.
Resumes playing the music track that was last triggered i.e. after a save/load
Reverses the entries of the table that is passed to the function This function will iterate over a 1D array/table and flip it, so that the first element is the last, the last is the first, and so on.
Converts a 2D top down position to a 3D ScarPosition. returns Position, if y-height is nil, y-height = ground height, terrain ground or walkable
Sets it so that a player can skip a scripted sequence. When the skip key is pressed, calls back the given function as a post-sequence setup. noFadeIn stops the system from fading back into gameplay when finished. Call Util_SetPlayerUnableToSkipSequence() when the sequence is finished to disable
Disables Util_SetPlayerCanSkipSequence
Returns a table of positions sorted from closest to furthest (or furthes to closest if reverse is true) from the origin
Play a Speech Ambient. These are the lowest priority, and will be bumped by Intel Events or NIS's. This function should used instead of Event_Start because it handles priorities.
Play an Intel Event. These are medium priority, and will interrupt a ambient, but not an NIS. This function should used instead of Event_Start because it handles priorities.
Plays an NIS. The NIS should have a call to NIS_START(details) at the beginning, and NIS_END() at the end. Example details table keys: {style = NIS_OPENING, NIS_MID or NIS_CLOSING, exemptions = {sg_unit_to_not_despawn}, revealFOW = true, callbackStart = func, callbackEnd = func}
Play a quick, one-line Intel event. These are medium priority, and will interrupt ambient, but not an NIS. Use this when playing a single line. For multi-line events, use Util_StartIntel
Splits a string into a table of substrings based on a given separator. Comma is used as the default separator if none is provided.
Checks the first layer of a table and looks for a specified Object, returns true if found. Objects can be anything (Player, SGroup, Int, Table, String, etc.)
Debug function used to toggle whether or not IntelEvents are played. Only works with -dev parameter
Library function to trigger NIS event under a certain sets of conditions. NOTE: if checking against a marker DO NOT specify a range. The range of the marker set in the WorldBuilder will be used. onscreen_only set to TRUE means the squad must be onscreen if the event is to be triggered. non_combat set to TRUE means the squad cannot be in combat if the event is to be triggered. 6 arguments when using marker, 7 arguments when using position, egroup and sgroup with the additional range value triggering event when one of the player's squads come near a particular SGroup, EGroup, Marker, or Position and that squad is onscreen, and that squad is not in combat.
Returns a table containing either the total or a specific player's squad count, entity count, and vehicle count. table can be accessed as scene below Get Player Example:\n local t = Util_UnitCounts(player1)\n print(t.squad)\n print(t.entity)\n print(t.vehicle)\n Get World Example:\n local t = Util_UnitCounts(true)\n print(t.squad)\n print(t.entity)\n print(t.vehicle)\n Alternate Format:\n print(Util_UnitCounts(true).squad)\n
Spawn a series of units and have them move along a path in a parade. Useful for bringing in or out units in a long line rather than a broad formation. marker_table should be the path of the parade. unit_table should follow the format for UnitEntry functions; each entry is a "row" in the parade. Preferably each should have separate spawn point. If there is a destination defined in a unit entry, that row will go to the destination after completing the parade.
Returns the game time as a string. Formatted as mm:ss
Returns the game time as a string. Formatted as mm:ss
Toggles on or off vaulting debug drawing
Calculates the length of the provided vector
Ensures that all pending dissolves are processed
Add some new villagers to a VillagerLife. If job is left as nil, villagers will roam. Or you can specify "roaming", "wood", "food", "gold", or "stone".
Private function. Orders the villagers to attack the player.
This is the proper way to create a VillagerLife at runtime. Villagers can be assigned to 5 different jobs, and you can provide an sgroup for each job. villager_response can be "none", "flee", or "attack". "mkr_flee" is only required if villager_response is "flee". "mkr_flee_backup" is only required if villager_response is "flee" and b_require_garrison is true. SGroups can be nil if you don't want villagers in those roles.
Private function. Despawns any villagers in the sgroup that have gotten close enough to the specified position.
Private function. Checks if mkr_flee has a valid garrisonable building nearby.
Private function. Orders the villagers to harvest resources. Any villagers who can't find something to harvest will end up roaming.
Private function. This is the main loop that keeps villagers working. It only stops running when the villagers are attacking, or when they all die.
Private function. Called when the attack encounter ends in failure.
Private function. Called when the attack encounter ends in success.
Private function. Orders a single villager to wander to a random building or random location.
Adds units to the wave's unit table. These units will be produced whenever prepare is called
Returns an array containing all the categories that this spawn is capable of producing
Transfers all the units from the staging module into the assault module. If the wave is still spawning from a prepare, it will stop. Index defaults to 1.
Sets up a new wave see http://relicwiki/display/CARD/Waves to learn more about creating a wave
Sets which unit categories can be built by a building. Categories are "infantry", "ranged", "cavalry", "siege", "town_center", and "religious"
Sets how long a wave spawner will be on cooldown after spawning a certain unit type
Orders a wave to start spawning units. Units will go into the staging module, or into the assault module if no staging module is defined. You can optionally pass in an sgroup. All units that are spawned will go into it.
Searches the spawn area for any new buildings and adds them to the list of spawns
Updates the wave with a new unit table. These units will be produced whenever prepare is called
Toggle enabling all weapon gound attack
Toggle weapon animation information
Toggle weapon attack radii around the entities
Toggle weapon firing lines
Toggle weapon hard point information
Toggle weapon state and calculation information
Toggle weapon best target result
Toggle weapon priority information (must TAG entity you want info about)
Toggle weapon projectile denotation timer
Toggle weapon projectile information
Toggle weapon scatter target information
Toggle weapon tracking lines and maximum angles
Triggers a UI event cue and an audio cue that the player is about to lose the game. The lower the warningLevel, the closer the player is to losing and the more intense the warning is
Call UI_TitleDestroy to remove.
Returns the average positions of the entities in the area Owner type could be OT_Player, OT_Ally, OT_Enemy or OT_Neutral It filters out entities not belonging to a squad, when onlyEntitiesInSquads is true
Changes target interactivity zones to adjusted interactivity (255 max), probably only safe to use post NIS
Kill off a specific player's dead bodies (enter ALL to clean them all up)
Destroys walls (entities with a wall_ext) near a marker
Get the distance between a squad group and a point. Pass in true for 3rd parameter to get the closest point and pass in false to get the furthest point. The closest/furthest point is calculated on a per entity basis. So the closest distance would be that of the closest entity. Also note, it is an error to call this function with an empty group.
Get the distance between a squad group and a point. Pass in true for 3rd parameter to get the closest point and pass in false to get the furthest point. The closest/furthest point is calculated on a per squadron basis. So the closest distance would be that of the closest squadron. It is an error to call this function with an empty group. Check the group size with SquadGroup_Count( ) first.
*** You must call this from OnGameSetup, otherwise it's too late *** Determines whether empty players get converted to null resource points. see Attribute Editor under tuning/player/empty_player_replacement_object
Wins/loses a single team mission for the local teams
Clears the egroup, then finds and adds all neutral entities to it Returns the number of entities found
Returns all entities with this blueprint - warning this function iterates over all entities so it is slow
Returns the closest object from the table of marker/pos/egroup/sgroup to the closest marker/pos/egroup/sgroup specified The table may mix together objects of different types.
Appends all cover points to an egroup. Takes an egroup where you want to put the points. If this 'group' already contains a cover point, this cover point will not be added a second time. This function does not clear the contents of 'group'.\n
Returns the furthest object from the table of marker/pos/egroup/sgroup to the furthest marker/pos/egroup/sgroup specified. The table may mix together objects of different types.
Return the total number of game (simulation) ticks elapsed.
Return the total game time in seconds.
returns the height of ground at 2D pos x,y
Find a position on a path hidden from view, as close to the destination as possible whilst still satisfying your hidden checktype. Checktype can be either CHECK_IN_FOW, CHECK_OFFCAMERA or CHECK_BOTH. The path is always calculated as if it were plain infantry. This function returns nil if it can't find a suitable position, so you can do a backup plan.
Returns the interaction stage of the cell in the provided position Returns a value between 0 - 63
Returns the total playable length of the game world (z coordinate) Since the center of the map is 0,0 the world z range is (-l/2 -> l/2)
Get the Biome PBG's name of the specified terrain metadata layer and the specified coordinates.
Get the boolean value of the specified terrain metadata layer and the specified coordinates.
Get the integer value of the specified terrain metadata layer and the specified coordinates.
Get the numeric value of the specified terrain metadata layer and the specified coordinates.
Get the PBG of the specified terrain metadata layer and the specified coordinates.
Get the PBG of the specified terrain metadata layer and the specified coordinates.
returns the nearest intractable position to the supplied position
Find and add neutral entities within the territory sector to the egroup Entities belonging to a squad would not be added to the egroup
Return the number of entities of the same ebp in the sphere volume
Returns the number of strategic points on this map (does not count strat. objectives)
Return the total number of players in the world
Returns the blueprint of a chosen squad for a race
Returns the number of types of squads a race can build
Returns the race index of a race, given its name (from the ME).
Returns a random Real with range [min, max] It is recomended you use this instead of luas math.random function
Returns maximum number of players in this match
Appends all the strategic resource points to an egroup. takes the egroup where you want to put the points, and 2nd parameter is a bool which indicates if you want to include VPs or not If 'group' already contains an entity from 'grouptoadd' it will not be added.\n This function does not clear the contents of 'group'.\n Example: World_GetStrategyPoints(mypointgroup, true) --puts all the points including vps into mypointgroup
Returns one or more sector IDs that would connect two unconnected pieces of territory. return value is through a table (since there can be more than one way to connect territory) - each entry in this table is a table of sector IDs. Currently only finds single gaps - i.e. if two territories are 'almost' connected.
returns the cell type of the cell in the specified coordinates. 0 = Sky, 1 = Land, 2 = Water.
Return the sector ID from the position
Returns the position of a sector based on the capture entity (ex: the fuel point's position)
Returns the total playable width of the game world (x coordinate) Since the center of the map is 0,0 the world x range is (-w/2 -> w/2)
Returns whether the interaction stage is currently active
Returns whether or not the game type of this world is multiplayer
Returns if a position is on walkable wall
Returns TRUE if the game is currently in a replay state.
Find if player has ownership to this territory sector. Other players on the same team would also have the ownership to the sector
Kills ALL world entities near a marker
Kills the player with a reason.
Quit the game without declaring it over and return to frontend.
Returns whether ANY or ALL of the entities in the group are owned by the world (i.e. neutral)
Returns true if the squad is owned by the world
Returns whether ANY or ALL of the squads in the group are owned by the world (i.e. neutral)
Returns true if the squad is owned by the world
Creates a new Position object. A position object is basically a table with an x, y, and z attribute. You can directly access the individual components in the same way that you would access a field in a table. Example: --* lua script snip local pos = World_Pos(2, 0, 0) pos.x = pos.x + 1 print pos.x -- this will print 3 --* lua script snip
Returns if given position is in playable area.
DO NOT CALL UNLESS YOU DO AUTOMATED TESTING This resets the world into a state comparable to a fresh scenario start. Used in automated testing to avoid tests being dependent on each other.
Unlocks all the interaction stages
Sets a particular sector in the world as a supply provider (or not)
Set current interaction stage to value supplied, must be >= 0
Sets the player to a lose state, with a reason for losing, and kills the player
Sets the player and all the members allied to player to a win state, with a reason for winning. Also sets all other players to a lose state, and kills them (if they're not already dead)
Sets every player on a team to a win state, with a reason for winning. Also sets all other players to a lose state, and kills them (if they're not already dead)
Composes an assert message
Verifies the basic stuff all Audio Triggers need
Plays the next intel event in the debug queue. IntelEvents are played sequentially as they are defined in a mission's .events file.
Plays the next intel event in the debug queue. IntelEvents are played sequentially as they are defined in a mission's .events file.
Replays the last intel event that was debugged.
For checking whether a hinted BP is already being produced
Monitors abilities that have been flagged for usage-based hint resolution
A predicate for detecting whether a BP has been hovered over
After a timer, OnHover hints should go away
A predicate for detecting whether a BP has been hovered over
A predicate for detecting whether an ability has been hovered over
Get race name, and convert campaign-only races to base races.
Enables or disables cheering on an Sgroup. Defaults to 60 second duration; pass in -1 for infinite. Defaults to short celebrate walla. WARNING: Units cannot move while cheering. Only works on bipeds. audioDelay delays audio but not animation. Enable or disable the crown over leader units. The Leader must be the first squad in the sgroup.
Finds any idle raid parties
Creates a unit list based on provided composition data
Gets one of the valid spawn locations
Initiates a raid against a given position
Sometimes spawns a scout to attack-move around the map, looking to engage the player
Resets the raid timer
Resets the scout timer
Called when the module goes above its threshold while defending
instructs the module to begin attacking it's next target.
Called when the module falls below its withdraw threshold while attacking
Called when the module completes its last target and there are none left
Creates a new attack encounter for this army to attack its next target
Orders the modules to defend an area. This can be when the module starts, when it falls back, or when it completes
Called when all units in the module have died
Orders the rovingArmy to defend it's current average position
Orders the rovingArmy to defend the current target.
Instructs the RA to defend the nearest fallback if there is one, or the spawnLocation if there isn't one
Called on complete. Orders the rovingArmy to defend the last completed target.
orders the RovingArmy to defend its spawnLocation
Called if the module died or fell below threshold while attacking
Finds what Roving Army module is currently using a given encounter
Gets the current target, if there is one
Selects a random target index from the three closest targets
Returns the target index for the nearest target to the homeLocation. Returns nil if there are no targets
returns a random index to a target other than the current one. Returns nil if no valid targets exist
Checks if the module should be defending. Returns true if any of the 3 possible reasons are true.
returns true if rovingArmy.fallback[rovingArmy.fallbackIndex] is a valid fallback.
returns true if rovingArmy.targets[rovingArmy.targetIndex] is a valid target.
Ensures that all fallbacks are set properly
Ensure that all targets are set properly
Returns true if the rovingArmy is above the withdraw threshold, or if ignoreWithdrawThreshold was set to true
Returns true if the rovingArmy is below the withdraw threshold, and ignoreWithdrawThreshold is false
Called when a target has been cleared successfuly
Stops the RovingArmy from attacking its target
Stops the RovingArmy from defending
Used to determine if target should be handled with enRoute behavior. May need more logic to handle non-linear targetting types
This checks to see if the RA has died, and calls the appropriate callbacks if it has
Updates fallback and fallbackIndex
Updates targets, targetIndex and targetShift according to the targetingType. After running this, call _RovingArmy_HasValidTarget to find out if a new target was established.
DO NOT call this function directly, use Event_Save(STT_Auto) instead
DO NOT call this function directly, use Event_Save(STT_Quick) instead
DO NOT call this function directly, use Event_SaveWithName(STT_Standard) instead
DO NOT call this function directly, use Event_SaveWithName(STT_Dev) instead
Wrapper to trigger proper audio and video settings for entering or exiting intro and outro cameras. Setting enable to true enters the camera mode; false exits. Pass in CAM_INTRO or CAM_OUTRO for camera_type. Keep_gampelayunits_forOutro removes gameplay units by default unless set to true. fowUnRevealDelay sets the delay for when to hide units in FoW (3.825 seconds is the default).
This is a global function that needs to exist for other things to work correctly. It used to be in module_defend.scar, but wasn't relevant to that particular chunk!
Return the current app time
Set the ideal frame rate for the game. Set to 0 if an unbounded frame rate is desired.
E-mails a warning out with logfiles at the end of the game. Example: bug( "This shouldn't happen, fix "..problem.here)
Returns how many times this instance has been triggered
Start triggering the items listed in the CanSeeTrigger prefab This prefab can only be triggered once, either by the trigger zone or by script, whichever is first
Get the value for a command line arg.
Hide the cursor
Set the cursor position
Show the cursor
Get dca variable value for an entity. Can be used to validate presentation state from lua.
Clear debug rendering.
Draw a circle, positioned in 3D, aligned to scren.
Set auto clear for named frame.
Set display of named frame.
Draw circle on terrain.
Draw circle on terrain with lifetime.
Draw rectangle on terrian.
Draw text, positioned in 2D, aligned to the screen. (x,y) gives position in normalized screen coordinates cmd is the text to print r,g,b give colour values from 0-255
Draw text, positioned in 3D, aligned to screen.
force the gamma
force the LOD of the FX system (use 0 to enable dynamic LOD)
enable logging of fx, it it wasn't already
Force effects to be recreated.
toggle effects on or off
toggle effects rendering on or off
use the debugshader, which will render all fx green
Gets the type of game we are playing ( GT_SP = 0, GT_MP = 1, GT_Skirmish = 2)
Returns the local player index
Returns the scenario name (shortname version eg. "2P Semois")
Returns the current simulation rate.
Start running the HealthTrigger prefab
Start triggering the items listed in the HealthTrigger prefab This prefab can only be triggered once
Dump content of inventory to a file
Print all players information.
Run simulation and presentation in lockstep, with simulation ticked every frame (useful for debugging sync errors)
Write the OS map of allocated memory to the log folder
Write the OS map of allocated memory to the log folder
Returns the numbers of memory pools
Given a poolID it will return the current memory in use
Given a poolID it will return the max amount of memory this pool has allocated
Given a poolID it will return the name of the pool
Ask the OS to reduce the memory allocated to the game
Write to a file all allocation content for specified pool
toggle the outstanding network call information
toggle the network statgraph
Start running the CanSeeTrigger prefab
Start running the PlayerTrigger prefab
Returns how many times this trigger zone instance has been triggered
Start triggering the items listed in the PlayerTrigger prefab This prefab can only be triggered once, either by the trigger zone or by script, whichever is first
Exit to windows
Disable rendering and render update
Restart a single player game, skirmish game, or the front end. (doesn't work in multiplayer games)
Returns ST_NIL,ST_BOOLEAN,ST_NUMBER,ST_STRING,ST_TABLE,ST_FUNCTION,ST_SCARPOS,ST_EGROUP,ST_ENTITY,ST_SGROUP,ST_SQUAD,ST_TEAM,ST_MARKER, ST_PBG, or ST_UNKNOWN
Returns a string representing the scartype when passed a scartype enum value
Returns a string representing the scartype
Set the simulation rate
Pause the simulation.
Set the simulation rate
A closure-based class-like object for performing unit-tests and outputting test-results unique_name A name used as identifier in the json result file unit_tests A table containing UnitTest objects which this driver manages is_long_test (Optional, default is false) The driver will only run if the command line argument -TestLong is set
A closure-based class-like object defining a single unit test unique_name - Unique name of the test. It is used as a key in the JSON result file. description - Description of this test and the feature it tests. start_function - Executed at test start to setup any preconditions to running the test (e.g. spawning a unit) update_function - Function which is repeatedly executed to test when the test should end. Should return true when the test needs to continue and false when the test needs to end. e.g. a timer which returns true until 5 seconds have elapsed, a predicate which returns true while a unit is still alive etc. finish_function - A predicate which tests the success of the test. This is invoked when the test is finished (indicated by the update function). If finish returns true then the test is successful otherwise the test is a failure. timeout_seconds - A timeout will result in test termination and the test will be considered a failure.
Save the statgraph output to a file
Predicate testing if a value is of specific type e.g. f = std.TypePredicate(); f() => 1; f() => 2 ...
Performs basic type-checking on [value] e.g. foo = 7; std.Validate(foo, 'foo', T_NUMBER, false)
Makes an assertion. If the assertion turns out to be false, raises an error. e.g. foo = 7; assert(foo ~= nil, 'foo should not be nil!', 'If foo is nil we don't know how many bars to spawn!'') This is intended to be a more scripter friendly version of LUA assert.
Change the local player.
Private function. Do not call this function in mission scripts, call VillagerLife_Create instead. VillagerLife_Create calls this, and the prefab system calls this when it creates a VillagerLife during startup.
Generated using TypeDoc