SC2Mapster Wiki
Register
Advertisement
Bot
Don't create new Links from this page Discuss
All Links here are being Corrected to match with the ones in Triggers/Functions#AI_Advanced Triggers/Actions#AI_Advanced

Construction[ | ]

Build[ | ]

  • Action. Instructs the AI to build some buildings of the specified type.

Clear Build Queue[ | ]

  • Action. Clears all build requests currently planned (but not yet started) for a player.

Clear Research Queue[ | ]

  • Action. Clears all research requests currently planned (but not yet started) for a player.

ClearStock[ | ]

  • Action. Clears the stock lists of units and buildings to make for a player.

Clear Train Queue[ | ]

  • Action. Clears all train requests currently planned (but not yet started) for a player.

Default Economy[ | ]

  • Action. Sets stock for a player's economic buildings and units based on the specified parameters.

Default Expansion[ | ]

  • Action. Attempts to make the specified player expand. There are certain conditions under which the AI will not expand, such as if the player does not have enough workers. The Minerals and Gas parameters are thresholds that the player must be under in order to expand (unless the player has too many extra workers).

Enable Stock[ | ]

  • Action. Instructs the AI to make all the units and buildings specified by previously executed Set Stock commands for a player.

Make Always[ | ]

  • Action. Instructs the AI to make the specified unit or building.

Make Once[ | ]

  • Action. Instructs the AI to make the specified unit or building only if the AI has 0 of them built or in queue.

Research[ | ]

  • Action. Instructs the AI to research the specified upgrade.

Set Stock[ | ]

  • Action. Set stock for a player to make units of the specified unit type.

Set StockAlias[ | ]

  • Action. Adds a unit into the stock with consideration for the Alias Type parameter. This alias is used for some internal functions. Note: This is an advanced AI concept. In most cases Set Stock is a more efficient choice.

Set StockEx[ | ]

  • Action. Set stock for a player to make units of the specified unit type. (More advanced than Set Stock)

Set StockExpand[ | ]

  • Action. Adds an expansion into the stock for an AI player. When the AI reaches this point in the stock list, it will build the specified TownHall type at an expansion point rather than spending money on units or other buildings.

Set StockFree[ | ]

  • Action. Adds a unit to the AI player's stock if the Prereq parameter is met. An example of this would be telling the AI player to add Stalkers to their stock, but only if they have Blink researched.

Set StockOpt[ | ]

  • Action. Set stock for a player to make units of the specified unit type using the 'optional' Stock Flag.

Set StockTown[ | ]

  • Action. Adds Town into the stock for an AI player. When the AI reaches this point in the stock list, it will ensure that every Town it owns has two refineries and a town hall of the specified types. This ensures that AI towns are never without these buildings.

Set StockUnitNext[ | ]

  • Action. Increments the stock count for the specified unit type by one if the Count parameter is set to 0, or the number of those units that are in progress or better is less than the specified Count. Does nothing if the Ignore If Queued parameter is set to true and the number of queued and in progress units of the specified type is greater than 0.

Train[ | ]

  • Action. Instructs the AI to train some units of the specified type.

Get Default Build Flags[ | ]

  • Function. Returns the default build flags for a type of building made by a player.

Player Has Resources[ | ]

  • Function. Returns whether a player has at least the specified amounts of Minerals and Gas.

Known Unit Count[ | ]

  • Function. Returns the number of units of of the specified unit type owned by another player that have been seen by the specified player.

Tech Count[ | ]

  • Function. Returns the number of units of the specified unit type that are in progress/made by a player. Includes units in AI queues.

Difficulty[ | ]

Set Difficulty Parameter[ | ]

  • Action. Enables or disables a particular difficulty parameter for a player.

Get Difficulty Parameter[ | ]

  • Function. Returns the state of a particular difficulty parameter for a player.

Filters[ | ]

Tactical AI Filter Alliance[ | ]

  • Action. Sets the specified AI Filter to only include either enemy or allied units. Use this and the other "Tactical AI Filter" actions to set up an AI Filter, which can then be used in a "Tactical AI Filter - Run" function to filter a unit group.

Tactical AI Filter Unit Filter[ | ]

  • Action. Sets the specified AI Filter to only include units that match the criteria of the specified target filter. Use this and the other "Tactical AI Filter" actions to set up an AI Filter, which can then be used in a "Tactical AI Filter - Run" function to filter a unit group.

Tactical AI Filter Life[ | ]

  • Action. Sets the specified AI Filter to only include units whose life is within the specified range. Use this and the other "Tactical AI Filter" actions to set up an AI Filter, which can then be used in a "Tactical AI Filter - Run" function to filter a unit group.

Tactical AI Filter Life Modifier[ | ]

  • Action. Sets the specified AI Filter to modify the way it calculates life values for units with the specified attribute. For example, if the attribute was set to Armored, and the Amount set to 100, then the filter would consider Armored units to have 100 more life than they actually have. This can only be set once per AI Filter, so calling this action multiple times with the same AI Filter will simply override previous calls. Use this and the other "Tactical AI Filter" actions to set up an AI Filter, which can then be used in a "Tactical AI Filter - Run" function to filter a unit group.

Tactical AI Filter Life Per Marker[ | ]

  • Action. Sets the specified AI Filter to only include units whose current life is greater than the number of specified markers currently on them times the value specified in the Each parameter. In this context, markers are an AI system construct used to mark targets of abilities before the ability's effects execute. Use this and the other "Tactical AI Filter" actions to set up an AI Filter, which can then be used in a "Tactical AI Filter - Run" function to filter a unit group.

Tactical AI Filter Markers[ | ]

  • Action. If a "marker per life" has not been set then a counting marker may be used. A counting marker ensures the indicated range of tactical AI markers exist on a candidate or else the unit will be filtered out. A range of 0 to 1 will prevent more than one unit from casting on the same target at the same time.

Tactical AI Filter Movement Plane[ | ]

  • Action. Sets the specified AI Filter to only include either air or ground units. Use this and the other "Tactical AI Filter" actions to set up an AI Filter, which can then be used in a "Tactical AI Filter - Run" function to filter a unit group.

Tactical AI Filter Range[ | ]

  • Action. Sets the specified AI Filter to only include units within the specified range of the specified unit. Use this and the other "Tactical AI Filter" actions to set up an AI Filter, which can then be used in a "Tactical AI Filter - Run" function to filter a unit group.

Tactical AI Filter Remove Self[ | ]

  • Action. Sets the specified AI Filter to exclude the specified unit. Use this and the other "Tactical AI Filter" actions to set up an AI Filter, which can then be used in a "Tactical AI Filter - Run" function to filter a unit group.

Tactical AI Filter Shields[ | ]

  • Action. Sets the specified AI Filter to only include units whose shields is within the specified range. Use this and the other "Tactical AI Filter" actions to set up an AI Filter, which can then be used in a "Tactical AI Filter - Run" function to filter a unit group.

Tactical AI Filter - Create Filter[ | ]

  • Action. Create an AI filter for use with tactical AI routines. Check Link

Tactical AI Filter - Run[ | ]

  • Function. Use a tactical AI filter to trim a unit group and return a new one.

Tactical AI Filter - Create Marker[ | ]

  • Action. Create a marker for use with the tactical AI functions. Check Link

Requirements[ | ]

Count Object As Already Made[ | ]

  • Action. Instructs the AI requirements code to treat the specified Unit for a player as already made for the purpose of meeting prerequistes,

Default/Code Get First Missing Req[ | ]

  • Function. Returns the first completely missing requirment to make an object for a player. Same as the script version, except this version cannot be modified to handle custom requirements.

Default/Code Get First Unfinished Req[ | ]

  • Function. Returns the first unfinished requirment to make an object for a player. Same as the script version, except this version cannot be modified to handle custom requirements.

Default/Code Get Full Make Time[ | ]

  • Function. Returns the total amount of time required to make the specified object (including the time it would take to tech up to that object's requirements). Returned value is in sixteenths of a second. Same as the script version, except this version cannot be modified to handle custom requirements.

Default/Code Get Maker[ | ]

  • Function. Returns the ID of the unit type that directly makes the specified object for a player. Same as the script version, except this version cannot be modified to handle custom requirements.

Default/Code Get Object Type[ | ]

  • Function. Takes an Object ID and returns 0 if it is a unit, 1 if it is a building, 2 if it is an upgrade, and -1 if it does not fall into any of those categories. Same as the script version, except this version cannot be modified to handle custom requirements.

Get Base Name[ | ]

  • Function. Returns the internal string ID of the object specified by the String parameter.

Get BuildAt Name[ | ]

  • Function. Returns the build at name contained in the specified string.

Script Get First Missing Req[ | ]

  • Function. Returns the first completely missing requirment to make an object for a player. Same as the default/code version, except this version could potentially be modified to handle custom requirements.

Script Get First Unfinished Req[ | ]

  • Function. Returns the first unfinished requirment to make an object for a player. Same as the default/code version, except this version could potentially be modified to handle custom requirements.

Script Get Full Make Time[ | ]

  • Function. Returns the total amount of time required to make the specified object (including the time it would take to tech up to that object's requirements). Returned value is in sixteenths of a second. Same as the default/code version, except this version could potentially be modified to handle custom requirements.

Script Get Maker[ | ]

  • Function. Returns the ID of the unit type that directly makes the specified object for a player. Same as the default/code version, except this version could potentially be modified to handle custom requirements.

Script Get Object Type[ | ]

  • Function. Takes an Object ID and returns 0 if it is a unit, 1 if it is a building, 2 if it is an upgrade, and -1 if it does not fall into any of those categories. Same as the default/code version, except this version could potentially be modified to handle custom requirements.

Scouting[ | ]

Scout[ | ]

  • Action. Enables scouting for a player.

Set Num Scouts[ | ]

  • Action. Sets the number of scouts to use for a player.

Set Scout Times[ | ]

  • Action. Sets how frequently a player sends a scout to each type of map objective. The time specified will get set for each objective of that type. The AI will scout objectives with a smaller time set more often than those with a larger time set.

Get Next Scout Location[ | ]

  • Function. Returns the next location needing to be scouted for a player.

Get Scout[ | ]

  • Function. Returns a unit that will be the next scout for a player. The Previous Unit parameter is optional (pass null to it if it is undesired). If no Previous Unit is specified, then this will always return a new scout. If Previous Unit is specified, then this will return that unit, unless there is a better unit type available for scouting, in which case it will return a new unit of that type.

Tactical[ | ]

Call Original Tactical AI Think[ | ]

  • Action. SetThink can change a unit type's AI think routine to a trigger action. This action calls the original routine from before it was changed. This lets you override some behavior but still keep most AI intact. Nothing happens if the think data has not been changed.

Tactical AI - Cast[ | ]

  • Action. Suggests an order to a unit. Works the same as Issue AI Order, but with additional parameters. If the computer that controls the unit has the ability to execute the order (with respect to its current APM constraint), then it will do so. The order will eventually be dropped if the computer is unable to execute it for a few seconds after it was issued. If you need a unit to do something immediately, use Issue Order instead. The Marker parameter is optional, pass in null if you don't want to use it.

Tactical AI - Flee[ | ]

  • Action. Tells a unit to flee from another unit at least the specified distance. The Marker parameter is optional, pass in null if you don't want to use it.

Clear Cloaked Attacker[ | ]

  • Action. Clears the cloaked attack for a player near a point.

Set Ignored By Wave[ | ]

  • Action. Sets the specified unit to be ignored or unignored by its wave. An ignored unit does not receive any of the orders issued to a wave it belongs to.

Set Tactical AI Range[ | ]

  • Action. Overwrites the Tactical AI Range field for the specified unit's data for the specified player.

Set Tactical AI Think[ | ]

  • Action. Sets a tactical AI think function for the specified unit for the specified player.

Get Best Target Point On Group[ | ]

  • Function. Returns the best location to place an AOE attack on a group of units with the specified parameters.

Combat Diff Flag Sort Buildings Priority[ | ]

  • Action. When enabled, allows the combat AI to prioritize the order it will attack buildings in. (Check Link)

Combat Diff Flag Special High Priority[ | ]

  • Action. When enabled, allows the combat AI to target squishy high damage casters before certain other targets.

Combat Diff Flag Splash High Priority[ | ]

  • Action. When enabled, allows the combat AI to target AoE/Splash damage enemies before certain other targets.

Combat Diff Flag Timed Low Priority[ | ]

  • Action. When enabled, allows the combat AI to target limited time units below certain other targets.

Combat Diff Flag Workers Normal Priority[ | ]

  • Action. When enabled, allows the combat AI to target workers normally, instead of below most other targets.

Combat Diff Flag Bonus Damage[ | ]

  • Action. When enabled, allows the combat AI to target unit types it would do bonus damage to before certain other targets.

Combat Diff Flag Detector[ | ]

  • Action. When enabled, allows the combat AI to target detectors before certain other targets.

Combat Diff Flag Healers[ | ]

  • Action. When enabled, allows the combat AI to target healers before certain other targets.

Combat Diff Flag Injured[ | ]

  • Action. When enabled, allows the combat AI to target injured units before certain other targets.

Combat Diff Flag Low Health[ | ]

  • Action. When enabled, allows the combat AI to target low health units before certain other targets.

Combat Diff Flag Siege Range[ | ]

  • Action. When enabled, allows the combat AI to target siege range units before certain other targets.

Get Wants To Move Status[ | ]

  • Function. Returns true if the AI logic wants to move the specified unit.

Get Default Combat Priority[ | ]

  • Function. Returns a unit that is the best target for the specified attackers from the list of possible units in the specified enemy unit group. It then also changes the attackers group to only include the limited number of attackers wanting to switch to that target.

Find Units[ | ]

  • Function. Returns a group of all of the units of the specified type owned by a player within the specified range of a point up to max count units.

Get Cloaked Attacker[ | ]

  • Function. Returns the position of the last attack from a cloaked unit against a player specified by the Player parameter.

Is Ignored By Wave[ | ]

  • Function. Returns true if the specified unit is ignored by the wave it is in (for purposes of regrouping, etc.).

Last Attack[ | ]

  • Function. Returns the time the specified unit was last attacked.

Last Attacker[ | ]

  • Function. Returns the unit who last attacked the specified unit.

Same Command[ | ]

  • Function. Tells a unit to do the same action that another is currently doing. Returns true if the action succeeded.

Towns[ | ]

Declare Town Specific Slot[ | ]

  • Action. Sets the center of a player's town to be at the specified point.

Enable Harvesting[ | ]

  • Action. Start a new harvest job at a town for a player.

Set Harvest Rate[ | ]

  • Action. Set the harvest rate for a player.

Set Main Town[ | ]

  • Action. Sets the specified town to be the main town for a player.

Declare Next Town[ | ]

  • Action. Create a new town for player at the specified point.

Expand[ | ]

  • Action. Instructs the AI for a player to expand starting the search at the specified point, and builds the specified building at the new expansion. Returns the town index for the new town.

Get Building Count In Town[ | ]

  • Function. Returns the number of buildings of the specified type in the specified town for a player.

Get Closest Town[ | ]

  • Function. Returns the index of the town closest to the specified point.

Get Current Harvest Peon Count[ | ]

  • Function. Returns the number of peons currently harvesting in a town for a player.

Get Gas Amount Left[ | ]

  • Function. Returns the total gas left to be harvested in a town for a player.

Get Defense Gather Location[ | ]

  • Function. Returns the default defensive gather location for a town of a player.

Get Offense Gather Location[ | ]

  • Function. Returns the default offensive gather location for a town of a player.

Get Max Desired Harvest Peon Count[ | ]

  • Function. Returns the maximum number of peons the AI wants to have harvesting in a town for a player.

Get Min Desired Harvest Peon Count[ | ]

  • Function. Returns the minimum number of peons the AI wants to have harvesting in a town for a player.

Get Mineral Amount Left[ | ]

  • Function. Returns the total minerals left to be harvested in a town for a player.

Get Num Mineral Spots[ | ]

  • Function. Returns number of mineral locations in a town for a player.

Get Next Unused Town Slot[ | ]

  • Function. Returns the index of the next unused town slot for a player.

Get Num RawGas Spots[ | ]

  • Function. Returns number of raw gas locations in a town for a player. To get harvestable gas, query for the gas harvesting building in the town.

Get Town Location[ | ]

  • Function. Returns the location of a town for a player.

Get Town State[ | ]

  • Function. Returns the current state of a town for a player.

Get Town Threats[ | ]

  • Function. Returns a unit group of all the threats near the given town of a player.

Is Town Harvesting[ | ]

  • Function. Returns whether the given town for a player is harvesting.

Transports[ | ]

Transport Set Panic[ | ]

  • Action. Sets the percentage health at which a player's transports should flee. (Value range from 0 to 1).

Transport Set Return[ | ]

  • Function. Set the return location for a player's transports when they are done unloading / idle.

Utility[ | ]

Set Unit Evaluation Custom Index[ | ]

  • Action. Any values set using "Set Unit Custom Value" with the given index will override the standard unit strength evaluation performed by the AI for that unit.

Accept Surrender[ | ]

  • Action. If the computer already wants to surrender then it will quit the game. If it does not then this does nothing.

Init Melee AI[ | ]

  • Action. Initializes the melee AI for a specific player. Calling Start Melee AI For All Players will call this action for each computer player.

Release Unit[ | ]

  • Action. Releases a unit by setting it back to idle.

Set APM[ | ]

  • Action. Limits the actions per minute of a computer player.

Set All States[ | ]

  • Action. Sets the value of the state indexes for a player. The state is a per player integer array that can be useful to AI scripting.

Set Flag[ | ]

  • Action. Sets the value of the specified flag index for a player. The flag is a per player boolean array that can be useful to AI scripting.

Set State[ | ]

  • Action. Sets the value of the specified state index for a player. The state is a per player integer array that can be useful to AI scripting.

Start AI[ | ]

  • Action. Starts the AI for a player in either campaign or melee mode, limiting the computer's actions per minute to the specified number.

Set Tech Flag State[ | ]

  • Action. Sets the state of a flag for a player at the specified index based on whether the number of units of the type specified in the What parameter with the Tech Tree Count Type specified in the State parameter, is greater than or equal to the Count parameter.

Enable/Disable AI Option For Unit[ | ]

  • Action. Enables or disables an AI option for a unit.

Get Flag[ | ]

  • Action. Gets the current value of the specified flag index for a player. The flag is a per player boolean array that can be useful to AI scripting.

Wants To Surrender[ | ]

  • Action. Check if this player wants to concede a skirmish game.

Grab Unit[ | ]

  • Action. Finds a player's lowest priority unit of the specified unit type, closest to the specified location, and claims it for a task, setting the priority of the new task.

Is Campaign AI[ | ]

  • Function. Returns whether a player is running campaign AI (as opposed to melee AI).

AI Pathing Cost Map[ | ]

  • Function. Returns the map pathing cost between two points, ignores all units.<n/>

AI Pathing Cost Unit[ | ]

  • Function. Returns the pathing cost from a unit.

Get State[ | ]

  • Function. Gets the current value of the specified state index for a player. The state is a per player integer array that can be useful to AI scripting.

Unit Has AI Option[ | ]

  • Function. Returns true if the unit has the specified AI option enabled.

Waves[ | ]

Wave Add Unit[ | ]

  • Action. Adds a unit to a wave.

Wave Add Unit Priority[ | ]

  • Action. Adds a unit to a wave with a priority.

Wave Delete[ | ]

  • Action. Deletes a wave.

Wave Add Info[ | ]

  • Action. Add units of the specified type to the specified wave info.

Wave Info Attack[ | ]

  • Action. Instructs a wave to attack with the specified parameters.

Wave Info Suicide[ | ]

  • Action. Instructs a wave to suicide attack with the specified parameters.

Wave Merge[ | ]

  • Action. Merges two waves together. Waves are specified using a player's wave indexes.

Wave Remove Unit[ | ]

  • Action. Removes a unit from a wave.

Wave Set[ | ]

  • Action. Associate a wave with an index for a player.

Wave Set Type[ | ]

  • Action. Sets the wave type and wave target for a wave.

Wave Target Add Waypoint[ | ]

  • Action. Adds a waypoint to the specified wave target. In Force Transport Mode, the wave units will attempt to load up in transports before approaching this waypoint. If there are not enough transports available for all of the units, the stranded units will be dropped from the wave.

Wave Target Clear Waypoints[ | ]

  • Action. Clears all waypoints for a wave target.

Eval Ratio[ | ]

  • Function. Returns the global eval ratio for a player.

Get Best Attack Target Point[ | ]

  • Action. Get the best target point to attack for a player, optionally considering only the specified enemies.

Create Wave[ | ]

  • Action. Create a wave from the specified wave info for a player. Returns the wave.

Wave Eval[ | ]

  • Function. Returns the eval of the specified wave.

Wave Eval Ratio[ | ]

  • Function. Returns the eval ratio of the specified wave against enemies within the specified range.

Wave Get[ | ]

  • Function. Returns the wave at the specified index for a player.

Wave Get Target[ | ]

  • Function. Returns the wave target for the specified wave.

Wave Target Harass Retreat[ | ]

  • Action. Creates a new wave target set to harass and retreat. Returns the wave target.

Create Wave Info From Wave[ | ]

  • Function. Returns a new wave info from the specified wave.

Create Wave Info[ | ]

  • Function. Returns a newly initialized Wave Info object.

Is Wave In Combat[ | ]

  • Function. Returns true if the specified wave is in combat.

Wave State[ | ]

  • Function. Returns the state of a wave.

Wave Target Escort[ | ]

  • Function. Creates a new wave target set to escort the specified unit group. Returns the wave target.

Wave Target Region[ | ]

  • Function. Creates a new wave target set to defend the specified region. Returns the wave target.

Wave Target Escort No Leash[ | ]

  • Function. Creates a new wave target set to escort the specified unit group. Returns the wave target.

Wave Target Gather Defense[ | ]

  • Function. Creates a new wave target set to gather at the defensive gather point of the specified town. Returns the wave target.

Wave Target Gather Offense[ | ]

  • Function. Creates a new wave target set to gather at the offensive gather point of the specified town. Returns the wave target.

Wave Target Melee[ | ]

  • Function. Creates a new wave target set to attack enemies of the specified player. Returns the wave target.

Wave Target Melee Harass[ | ]

  • Function. Creates a new wave target set to harass enemies of the specified player. Returns the wave target.

Wave Target Merge[ | ]

  • Function. Creates a new wave target set to merge with the specified wave. Returns the wave target.

Wave Target Patrol[ | ]

  • Function. Creates a new wave target set to repeatedly patrol through its waypoint list. Returns the wave target.

Wave Target Player[ | ]

  • Function. Creates a new wave target set to attack a player group. Returns the wave target.

Wave Target Point[ | ]

  • Function. Creates a new wave target set to attack a point. Returns the wave target.

Wave Target Unit[ | ]

  • Function. Creates a new wave target set to attack a unit. Returns the wave target.

Wave Target UnitGroup[ | ]

  • Function. Creates a new wave target set to attack a unit group. Returns the wave target.

Wave Target Unit Point[ | ]

  • Function. Creates a new wave target set to attack the location where a unit currently resides. Returns the wave target.

Wave Time In Combat[ | ]

  • Function. Returns how long the specified wave has been in combat.

Wave Time Since Combat[ | ]

  • Function. Returns how long since the specified wave has been in combat.

Wave Time Since Ordered[ | ]

  • Function. Returns how long since the specified wave has been ordered.

Wave To String[ | ]

  • Action. Converts a wave tag to a string.

Wave To Text[ | ]

  • Action. Converts a wave tag to text.<n/>

Wave Type[ | ]

  • Function. Returns the wave type of a wave.

Wave Unit Count[ | ]

  • Function. Returns the number of units in a wave.
Advertisement