Reference Section

This section will provide detail about different strategy editor commands that can be used.

Use ctrl + f to search the reference section of a statement or condition.

The Strategy Manager:

1. Change version of AMAI currently working on.
2. Change race strategies to strategies of another race.
3. Edit the racial builds that build no matter what strategy is being used
4. Edit the global settings to change a variety of options
5. Edit settings of the particular race which provides a variety of options
6. Compile your ai
7. Create new strategy or profile
8. Extract strategy or profile to hard disk
9. Insert strategy or profile from hard disk
10. Copy strategy or Profile
11. Remove strategy or Profile
12. Edit strategy or Profile
13. Lock computer to selected strategy or profile
14. Unlock computers so they use all strategies and profiles again
15. Quit
16. Window displaying different strategies or profiles
17. List strategies of race
18. List profiles of current version
19. Compiles and optimises the ai scripts so that they are smaller and more effecient.
20. Compile the AMAI vs AI version that uses the TFT data to create version allowing you to pit AMAI against the original AI.

Statements:

AddBlock Statement:

    call AddBlock(1, BLACKSMITH, false, 1, HOUSE, 60)

call AddBlock([How many must it build or start to build], [What must it have built or started to build], [Should the first value count started to build(false) or completed build(true)], [How many is it allowed to build before it has to obey the condition stated in the 3 first parameters],[What is it it is allowed to build this many of at a maximum], [How many game seconds *5 shall pass before this block is turned off])

AddRBlock Statement:

    call AddRBlock(360, 160, 0, ANCIENT_WAR, 60)

call AddRBlock([Amount of gold to have more of ], [Amount of wood to have more of ], [Cannot build more than this value of unit], [Unit type in question], [How many seconds * 5 shall pass before this block is turned off])

AddHarass Statement:

    call AddHarass(1, 2, FOOTMAN)

call AddHarass([Harrass group], [How many to add to group], [What unit type is being added to group])

Harass_Target Statement:

    call Harass(1, HARASS_TARGET_PEONS, true, 5, 0.25, 0, true, 50, 80)

call Harass([Harass group to use], [A Harass command], [ Will it avoid towers (true or false) ], [It will flee if it encounters strength of this amount], [Amount of hp left on units to abort harass], [If this many units left abort harass], [Any condition to include with harass (leave as true so harass always can run)], [Repeat harass this many seconds * 5], [Start harass at this many seconds * 5])

Harass Targets:
HARASS_TARGET_PEONS - Enemy workers
HARASS_TARGET_EXPANSION - Enemy expansion
HARASS_TARGET_MAIN_HALL - Enemy main hall
HARASS_TARGET_LOCATION - An enemy around a certain location // NOT YET IMPLEMENTED

distraction_group Statement:

    set distraction_group = 2

set distraction_group = [Harass group]

Sets which harass group is used for distractions. These are attacks that occur to confuse enemy to get them to use up a town portal etc. Distraction attacks only occur if you own 3 times the amount of forces needed for the distraction

BuiltUnit Statement:

    call BuildUnit(8, RIFLEMAN, 50)

call BuildUnit([Number to build], [Unit type to build], [End priority])

Start proity = [End priority] + ([Number to build-1] * 2)

So this would build 8 rifleman but first one is built with a priority of 64.

BuildUpgr Statement:

    call BuildUpgr(2, UPG_RANGED, 34)

call BuildUpgr([Number of time to research], [Research Type], [End priority])

BuildAdvUpgr Statement:

    call BuildAdvUpgr(1, UPG_BOMBS, 2,TownCountDone(COPTER), 10, 5 ,10)

call BuildAdvUpgr([Quantity to build and decides how many versions depending on current tier], [Research Type],[Start tier],[Count of units], [Maximum number of units to provide the max priority], [Bonus added to the research prority per tier], [Base prority of upgrade])

The total priority of the upgrade is equal to the (Base +Tier Bonus) and is only this high once you have the full amount of units. Less and this priority is proportionally less.

e.g. in example above lets say we have 10 copters we build upgrade at priority 10 at tier 2. If we only have 5 it builds upgrade at priority 5. If we have 0 copters the upgrade will not occur.

basic_melee Statement:

    call basic_melee(50, 36)

call basic_melee([Total food value of knights and footmen], [End priority])

This only works for human races unless you have customly allowed this command to work for other races by changing properties in the racialsettings.txt.

DefendTownsDone

    call DefendTownsDone(2, ANCIENT_PROTECT, 75)

call DefendTownsDone([Number to build], [Unit or building], [priority])

Will build these amounts of units at all the expansions.

BuildItem Statement:

    call BuildItem(2, HEALING_POTION, 40)

call BuiltItem([Total items to get], [Item type], [End priority])

Item Names:

Racial Items

HEALING_POTION
MANA_POTION
TOWN_PORTAL
LESSER_CLARITY_POTION
MECHANICAL_CRITTER
SCROLL_OF_REGENERATION
ORB_OF_FIRE
STAFF_OF_SANCTUARY
HEALING_SALVE
SCROLL_OF_SPEED
ORB_OF_LIGHTNING
TINY_GREAT_HALL
ROD_OF_NECROMANCY
SACRIFICIAL_SKULL
DUST_OF_APPEARANCE
ORB_OF_CORRUPTION
SCROLL_OF_HEALING
MOONSTONE
STAFF_OF_PRESERVATION
ORB_OF_VENOM
ANTI_MAGIC_POTION

Merchant Items
CIRCLET_OF_NOBILITY
PERIAPT_OF_VITALITY
BOOTS_OF_SPEED
M_DUST_OF_APPEARANCE
M_SCROLL_OF_HEALING
SCROLL_OF_PROTECTION
M_TOWN_PORTAL
POTION_OF_INVISIBILITY
TOME_OF_RETRAINING
STAFF_OF_TELEPORTATION
POTION_OF_LESSER_INVULNERBILITY

SetBuildReact Statement:

    call SetBuildReact(20, 3, HUNTRESS, 5, ARCHER, enemy_unarmored, 4, 12, 50)

call SetBuildReact([Amount of food to spread units over], [Build extra number of unit 1 at all times], [Unit 1 type to build], [Build extra number of unit 2 at all times], [Unit 2 type to build], [condition to calculate strength], [Less than this strength level from condition puts all food as unit 1], [More than this strength from condition puts all food at unit 2], [Base Priority])
Starting Priority of first unit = Base priority + (Number of Least food unit-1) *2)
So from above example Starting priority = 50 + (14 *2) = 78
This is always the case even if in the above archers no archers was built.
Both units are built simulationously but unit 1 will always be the first unit to attempt to be built.
NOTE: If the number to build of a certain unit is 0 amai will not try to build the requirements of that unit.

Strength Levels:

enemy_heavyarmor - Enemy heavy armor strength
enemy_lightarmor - Enemy light armor strength
enemy_mediumarmor - Enemy medium armor strength
enemy_casters - Enemy casters strength
enemy_towers - Enemy tower strength
enemy_unarmored - Enemy unarmored strength
enemy_magic - Enemy magic attackers strength
enemy_normal - Enemy normal attackers strength
enemy_piercing - Enemy piercing attackers strength
enemy_siege - Enemy siege attackers strength
enemy_air - Enemy air units strength

Conditional statements:
Note: You can use any jass native commands in the strategy editor windows. Go to a warcraft site for tutorials of basics of jass as i wont teach you here. www.wc3campaigns.net is a good place to find out information. Below is some commonly used conditionaly statements used in the strategy editor.

TownCountDone condition:

    TownCountDone(FOOTMAN)

TownCountDone([unit/building type])

Counts the number of a certain unit type owned.

EXAMPLES : If TownCountDone(FOOTMAN) > 5 then

Compound conditions:

This is having more than one condition in place.

    call SetBuildReact(15, 2, FOOTMAN, 4, RIFLEMAN, (enemy_unarmored + (enemy_air * 2) + enemy_magic - (enemy_normal * 2)), 4, 25, 50)

You must have brackets around an entire compound condition.

e.g. if (TownCountDone(Footman) + TownCountDone(Rifleman)) > 5 then

c_enemy Statement:

    if not (c_enemy_total == c_enemy[R_ELF]) then

c_enemy_total = Total amount of enemy players

c_enemy[R_ELF] = Total amount of elf race players

The example statement if the total amount of enemy players does not equal the total enemy elf players then....

Min condition:

    call SetBuildUpgr(Min((TownCountDone(FOOTMAN)/5),1), UPG_DEFEND, 70)

Min returns the smallest number out of two numbers.
The above command means if the number of footman / 5 is greater than 1 then do UPG_Defend with priority 70. Therefore 5 footmen or more are needed for this to work. This is basically acting as an if...then statement, but stays all on 1 line.

NOTE : Becareful when placing your brackets. Its easy to miss them out with this function

GetPlayerRace condition:

    GetPlayerRace(nearest_enemy) != RACE_UNDEAD

This gets the nearest enemies race. Very useful in harassment calls. != means not equal to.

GetPlayerUnitTypeCount condition:

    GetPlayerUnitTypeCount(Player(0), ORC_SHIPYARD) > 0

GetPlayerUnitTypeCount([Player Number. Player 0 is player 1], [Unit Type to count])

This counts the number of a unit type owned a specific player. Useful for campaign ai's.