SCAIEdit III list of commands

Help - Resources - AI Scripting - Grafting - Plugins - Modding Projects
User avatar
Taranok
Posts: 256
Joined: Tue Sep 07, 2010 9:41 pm

Postby Taranok » Tue Jan 11, 2011 2:32 am

for the get_oldpeons thing, it only sends them and for me does not rebuild them.

sigh... if only there was a "micro like bisu" command
Heinermann
Posts: 362
Joined: Thu Apr 26, 2007 12:42 am

Postby Heinermann » Sun May 08, 2011 5:11 am

Added some suggestions, and defined try_townpoint.
Heinermann
Posts: 362
Joined: Thu Apr 26, 2007 12:42 am

Postby Heinermann » Fri May 20, 2011 10:05 pm

New info.

target_expansion is only used with set_attacks. Additionally, it only works when you DO NOT use start_campaign.
User avatar
Taranok
Posts: 256
Joined: Tue Sep 07, 2010 9:41 pm

Postby Taranok » Fri Jun 17, 2011 6:14 pm

so does the guard_all command use all units including workers?
Heinermann
Posts: 362
Joined: Thu Apr 26, 2007 12:42 am

Postby Heinermann » Sun Jun 19, 2011 11:51 pm

Probably just military.
superone
Posts: 3
Joined: Mon Nov 21, 2011 8:37 am

Postby superone » Mon Nov 21, 2011 6:47 pm

After some experiments with the commands, here is what I found out:

check_transports - also trains a minimum of 2 observers for protoss.

attack_prepare - if there is enough time before an attack_clear command for the attacking party to reach it's destination, the attack will commence even without the attack_do command.

place_guard (unit) (byte) - Place 1 (unit) to guard town for each line of this command. (byte) specifies the guard position: 0 = Start location for the AI/Expansion Town; 1 = Mineral line; 2 = Refinery/Extractor/Assimilator. If there is no Mineral line place_guard (unit) (1) is ignored, if there is no Refinery place_guard (unit) (2) is ignored. Numbers greater than (2) are sent to the Refinery guard position.
Example:
place_guard(medic, 0)
place_guard(medic, 0)

Place 2 medics to guard the AI start location, or if used in an expansion block - the location of the expansion's command center

try_townpoint (byte) (block) - similar to the notowns_jump command, will jump to (block) if the AI does not own (byte) number of expansions. If expansions quota is met, the command is ignored. When used in a loop, some kind of an expansion command is required otherwise try_townpoint malfunctions.
Example:
--loop123--
expand(2, Expand)

wait(5500)

try_townpoint(2, loop123)
build(1, missile_turret, 80)
stop()
The AI will continue to loop until it owns (2) expansions, then it will build (1) missile turret.

allies_watch (byte) (block) - expands at (byte) Player's start location using (block). If (byte) start location is occupied the command is ignored. When the used value equals a player without a placed start location or is 9 or 10, expand location is chosen at a resource source. Chosen location is always the same if no changes are made to the map. If a value greater than 10 is used, the AI expands at the most upper left corner of the map.
Example:
allies_watch(2, Expand)

The AI will expand at player 2's start location if the region is vacant. Random Start locations in StarEdit have no effect on this.

capt_expand - this command has several functions.
(1) Causes almost all owned overlords and observers to patrol the perimeter of the base. Independent of race.
(2) The AI will start training the unit defined first by the defensebuild_gg command until it reaches the define_max value/supply limit runs out/resources run out. Trained unit can be changed using defenseclear_gg. Trained units are placed all around the perimeter of the base.
The same function works with the defensebuild_aa command, but the total produced units are around 8 for terran, 4 for protoss, and none for zerg. Trained units are placed on a wider perimeter than that of defensebuild_gg.
default_min (byte), when (byte) = 0, disables function (2).
Example:
defenseclear_gg
defenseclear_aa
defensebuild_aa(1, valkyrie)
defensebuild_aa(1, wraith)
defensebuild_gg(1, firebat)
defensebuild_gg(1, ghost)
capt_expand()

capt_expand will apply to valkyries and firebats.

default_min (byte) - defines how much standing army (from defenseuse commands) will be placed at expansions. The greater the value, more units will be sent. If (byte) = 0, no army at expansions, will send units only if expansion is under attack.

panic (block) - If AI has not expanded yet and total unmined minerals in the mineral line are less than 7500 will expand using (block). If AI has expanded before, the command triggers everytime there are less than 7500 unmined minerals total in owned bases, or there are less than 2 owned Refineries that are not depleted.

default_build - If AI has more than 600 minerals and 300 gas, it will start training race specific units until it reaches the define_max value/supply limit runs out/resources get lower than 600/300.
Units trained for terran: marine, ghost, siege tank, goliath, wraith, battlecruiser.
Units trained for zerg: hydralisk, mutalisk.
Units trained for protoss: zealot, dragoon, reaver, scout, carrier.

default_build() and defaultbuild_off() can be entered at any time in the script.
User avatar
Archon_Wing
Posts: 901
Joined: Wed Jul 25, 2007 11:22 pm

Postby Archon_Wing » Mon Nov 21, 2011 11:34 pm

Wow, that sounds amazing. It's too bad I never managed to test these, but you could definitely come up with some creative use of these commands.
Heinermann
Posts: 362
Joined: Thu Apr 26, 2007 12:42 am

Postby Heinermann » Mon Nov 28, 2011 9:26 pm

[quote name='superone' date='21 November 2011 - 06:47 PM' timestamp='1321901278' post='10481']
place_guard (unit) (byte) - Place 1 (unit) to guard town for each line of this command. (byte) specifies the guard position: 0 = Start location for the AI/Expansion Town; 1 = Mineral line; 2 = Refinery/Extractor/Assimilator. If there is no Mineral line place_guard (unit) (1) is ignored, if there is no Refinery place_guard (unit) (2) is ignored. Numbers greater than (2) are sent to the Refinery guard position.
Example:
place_guard(medic, 0)
place_guard(medic, 0)

Place 2 medics to guard the AI start location, or if used in an expansion block - the location of the expansion's command center
[/quote]
Did some checking and this is confirmed.
0 = position of the town owned by the current script thread
1 = I guess I will label this a pointer to a mineral patch near the town?
default = The town's refineries, is the default case and doesn't actually have a value.

[quote name='superone' date='21 November 2011 - 06:47 PM' timestamp='1321901278' post='10481']
allies_watch (byte) (block) - expands at (byte) Player's start location using (block). If (byte) start location is occupied the command is ignored. When the used value equals a player without a placed start location or is 9 or 10, expand location is chosen at a resource source. Chosen location is always the same if no changes are made to the map. If a value greater than 10 is used, the AI expands at the most upper left corner of the map.
Example:
allies_watch(2, Expand)

The AI will expand at player 2's start location if the region is vacant. Random Start locations in StarEdit have no effect on this.
[/quote]
I don't think this is the case. I am sure now that (BYTE) is the specific base location, which can be any of 250 maximum base locations. The Start Locations just happen to be registered as base locations first. For fun you can use a number >= 250 for a buffer overflow.

[quote name='superone' date='21 November 2011 - 06:47 PM' timestamp='1321901278' post='10481']
default_build - If AI has more than 600 minerals and 300 gas, it will start training race specific units until it reaches the define_max value/supply limit runs out/resources get lower than 600/300.
Units trained for terran: marine, ghost, siege tank, goliath, wraith, battlecruiser.
Units trained for zerg: hydralisk, mutalisk.
Units trained for protoss: zealot, dragoon, reaver, scout, carrier.

default_build() and defaultbuild_off() can be entered at any time in the script.
[/quote]
Confirmed this in code.

Really nice. But I am not sure where capt_expand's expansion block is though.

EDIT: Can you test
region_size (byte) (block)
Jump to block %2 if the computer's region tile count is below %1. Untested.
Heinermann
Posts: 362
Joined: Thu Apr 26, 2007 12:42 am

Postby Heinermann » Sun Jan 01, 2012 7:33 am

Saw something in this thread about wait_upgrades not working.

The code appears to require that the script be a campaign script in order to use wait_upgrades.
It also works for research/tech as well.

I also found out while digging into this that the maximum upgrade level supported by a script is 31.
See the following structure.

Code: Select all

struct townQueue
{
  BYTE bFlags; // a bit complicated
  BYTE bPriority;
  WORD wType;
};

// in msvc, expanded using bit fields
struct _townQueue
{
  BYTE parameter : 5; // the upgrade level or building count
  BYTE method : 2;
  BYTE need : 1;    // Set when player_need is called
  BYTE bPriority;
  WORD wType;
};

enum townQueueMethods
{
  build,
  upgrade,
  tech
};



EDIT: I may have gotten the bitfield backwards, but you get the picture.
It might be good if we got all this data into a wiki, where each command has its own unique page.

Return to “StarCraft Modding”

Who is online

Users browsing this forum: No registered users and 1 guest