SCAIEdit III list of commands

Help - Resources - AI Scripting - Grafting - Plugins - Modding Projects
Ojan
Posts: 2
Joined: Thu Feb 28, 2008 10:23 pm

SCAIEdit III list of commands

Postby Ojan » Tue Apr 24, 2007 1:24 am

While I'm quite experienced in most aspects of StarCraft modding, I haven't touched AI scripting at all. My question is simple. How good is ScAIEdit III? Does it have many unknowns? Is it able to edit the whole aiscript.bin file, or only some parts of it? Compiling a good and complete list with up to date descriptions of every command, and a list of commands that still are unknown should be high priority. It's really the unknown hunting that I find most exciting /wink.gif' class='bbc_emoticon' alt=';)' />



June 02 2007:
[spoiler]Updated SCAIEditIII known commands:

If there's a command that is still confusing ask here.



Header commands



farms_notiming

Build necessary farms only when it hits the maximum supply available.



farms_timing

Build necessary farms with a correct timing, so nothing is paused by a maximum supply limit hit.



start_areatown

Starts the AI Script for area town management.



start_campaign

Starts the AI Script for Campaign.



start_town

Starts the AI Script for town management.



transports_off

Computer will not manage/build transports on its own.




check_transports

Informs computer to use transports up to the defined Max#. Used with header transports_off.

* was noted in old forum that 5 was max transport. Needs to be confirmed.






Build/Attack/Defense order commands



attack_add (byte) (military)

Add %1(byte) %2(military) to the current attacking party.



attack_clear

Clear the attack data.



attack_do

Attack the enemy with the current attacking party.



attack_prepare

Prepare the attack.



build (byte) (building) (byte)

Build %2(building) until it commands %1(byte) of them, at priority %3(byte).



defensebuild_aa (byte) (military)

Build %1(byte) %2(military) to defend against enemy attacking air units.



defensebuild_ag (byte) (military)

Build %1(byte) %2(military) to defend against enemy attacking air units.



defensebuild_ga (byte) (military)

Build %1(byte) %2(military) to defend against enemy attacking ground units.



defensebuild_gg (byte) (military)

Build %1(byte) %2(military) to defend against enemy attacking ground units.



defenseclear_aa

Clear defense against enemy attacking air units.



defenseclear_ag

Clear defense against enemy attacking air units.



defenseclear_ga

Clear defense against enemy attacking ground units.



defenseclear_gg

Clear defense against enemy attacking ground units.



defenseuse_aa (byte) (military)

Use %1(byte) %2(military) to defend against enemy attacking air units.



defenseuse_ag (byte) (military)

Use %1(byte) %2(military) to defend against enemy attacking air units.



defenseuse_ga (byte) (military)

Use %1(byte) %2(military) to defend against enemy attacking ground units.



defenseuse_gg (byte) (military)

Use %1(byte) %2(military) to defend against enemy attacking ground units.



do_morph (byte) (military)

Morph %2(military) until it commands %1(byte) of them.




get_oldpeons (byte)

This command takes X number of workers from the main to move to the expansion. Should be used after the expansion is completed.




guard_all

Uses all available units to guard the town.




guard_resources (military)

Send units of type %1(military) to guard as many resources spots as possible(1 per spot).



place_guard (unit) (byte)

Place %2(byte) guards using %1(unit) to guard town.

* index starts at 0 for first guard

for example place_guard medic 0 = place 1 medic to guard town.




player_need (byte) (building)

If the player does not own %1(byte) number of %2(building), then build it at priority 80, otherwise ignore this opcode.

This command is different from build because it is global and not local to the town.




prep_down (byte) (byte) (military)

Add all %3(military) to the current attacking party except for %1(byte) of them, however it must send a minimum of %2(byte) of them.




tech (tech) (byte)

Research technology %1(technology), at priority %2(byte).



train (byte) (military)

Train %2(military) until it commands %1(byte) of them.



upgrade (byte) (upgrade) (byte)

Research upgrade %2(upgrade) up to level %1(byte), at priority %3(byte).



wait (word)

Wait for %1(word) tenths of second in normal game speed.

* NOTE normal game speed. Fastest game speed is still undetermined.

see this post for further details. Does your Ai crash?.




wait_finishattack

Wait until attacking party has finished to attack.



wait_force (byte) (unit)

Wait until computer commands %1(byte) %2(unit).




wait_build (byte) (building)

Wait until computer commands %1(byte) %2(building).



wait_buildstart (byte) (building)

Wait until construction of %1(byte) %2(building) has started.



wait_train (byte) (military)

Wait until computer commands %1(byte) %2(military).





Flow control commands



call (block)

Call %1(block) as a sub-routine. Only one call can be made in the game at a time.

If an AI owned by player 1 makes a call, then player 2 makes a call, will override player 1's call and controls the flow of the return statement.

Be sure that there is no wait command inside the call to have it function correctly.



enemyowns_jump (unit) (block)

If enemy has a %1(unit), jump to %2(block).



enemyresources_jump (word) (word) (block)

If enemy has at least %1(word) minerals and %2(word) gas then jump in %3(block).



goto (block)

Jump to %1(block).



groundmap_jump (block)

If it is a ground map(in other words, if the enemy is reachable without transports), jump to %1(block).



if_owned (unit) (block)

If the player owns a %1(unit) (includes incomplete) then jump to %2(block).




killable

Allows the current thread to be killed by another one.



kill_thread

Kills all threads that have the killable attribute (including threads owned by other players).



notowns_jump (unit) (block)

If computer doesn't have a %1(unit), jump to %2(block).



race_jump (block) (block) (block)

According to the enemy race, jump in %1(block) if enemy is Terran, %2(block) if Zerg or %3(block) if Protoss.



random_jump (byte) (block)

There is %1(byte) chances out of 256 to jump to %2(block).



resources_jump (word) (word) (block)

If computer has at least %1(word) minerals and %2(word) gas then jump in %3(block).



return

Return to the flow point of the call command.



rush (byte) (block)

will jump to %2(block) if %1(byte) conditions exist.

see post #76 for updated conditions




stop

Stop script code execution. Often used to close script blocks called simultaneously.



time_jump (byte) (block)

Jumps to %2(block) if %1(byte) normal game minutes have passed in the game.



try_townpoint (byte) (block)

Jump to %2(block) when the AI owns %1 number of expansions.






Multiple threads commands



expand (byte) (block)

Run code at %2(block) for expansion number %1(byte)



multirun (block)

Run simultaneously code at %1(block).





Miscellaneous commands



create_nuke

Create a nuke. Should only be used in campaign scripts.



create_unit (unit) (word) (word)

Create %1(unit) at map position (x,y) where x = %2(word) and y = %3(word). Should only be used in campaign scripts.



creep (flag)

Builds structures(towers?) far if the flag is set to 4, or near if the flag is anything else.

The creep command is used for expanding the zerg creep.




debug (block) (string)

Show debug string %2(string) and continue in %1(block). (unsupported by scAIEditIII




define_max (byte) (unit)

Define maximum number of %2(unit) to %1(byte).



fatal_error

Crashes starcraft with a fatal error and the message "Illegal AI script executed.".




give_money

Gives 2000 ore if ore is currently below 500 and gives 2000 gas if gas is currently below 500. This is executed immediately, the AI does not wait until it falls below 500 resources. This will be skipped entirely of no resource is below 500.



nuke_pos (word) (word)

Launch a nuke at map position (x,y) where x = %1(word) and y = %2(word). Should only be used in campaign scripts.



nuke_rate (byte)

Builds nukes every %1(byte) minutes.


*see post#27 for further details



send_suicide (byte)

Send all units to suicide mission. %1(byte) determines which type: 0 = Strategic suicide; 1 = Random suicide.

* 1 = includes workers too.



set_randomseed (dword)

Set random seed to %1(dword).



StarEdit commands



clear_combatdata

Clears all AI attack data for all units in the location.



disruption_web

Orders a Protoss Corsair to cast Disruption Web in the location.



enter_bunker

Orders units in the location to enter the closest bunker.



enter_transport

Orders units in the location to enter the closest transport.



exit_transport

Orders transports in the location to unload their units.



harass_location

AI Harass at selected location. (Needs definition)



junkyard_dog

Orders the unit to run on "Junk Yard Dog" (similar to critter).



make_patrol

Orders the units to patroll to the Generic Command Target.



move_dt

Orders the computer to move all Dark Templars to the specified region.



nuke_location

Orders a computer player to nuke the selected location.



player_ally

Makes all players in a specified location an ally of the trigger owner.



player_enemy

Makes all players in a specified location an enemy of the trigger owner.



recall_location

Orders an Arbiter to use recall at this location.



sharedvision_off (player)

Orders the specified player to unvision the trigger owner.



sharedvision_on (player)

Orders the specified player to give vision to the trigger owner.



value_area

Causes the computer to value a specified area higher than any other area. It may guard the area with units.







Unused commands



if_towns

Does not exist in memory.




scout_with (military)

This command has no action associated with it and therefore cannot be used.






List of unknown or unclear commands

Unknown purpose commands

Note: These are the most interesting commands to make research on. With the accurate opcode name list, they're now easier to decipher, but many still don't act as expected, or are still too obscure.



allies_watch (byte) (block)

The use of this command is unknown. Takes %1(byte) and %2(block) as parameters.

Byte might represent expansion number.



capt_expand

Causes the AI to expand using a default expansion block. Takes no parameter.

The actual expansion block is unknown and needs research.




default_min (byte)

The use of this command is unclear. Takes %1(byte) as parameter.

Racine used this command in our BWARAi War I.

see his scripts in this post for more details:

BWAi War I

Update/Suggestion: perhaps it specifies minimum number of expansions to acquire




defaultbuild_off

The use of this command is unknown. Takes no parameter.

"default build" is on by default."



fake_nuke

The use of this command is unknown. Takes no parameters.

Resets the AI nuke timer. Behaviour is unknown.



max_force (word)

Takes %1(word) as parameter. Unknown.



panic (block)

Appears to trigger (block) if attacked. Still unclear.



region_size (byte) (block)

Jump to block %2 if the computer's region tile count is below %1. Untested.




set_attacks (byte)

The use of this command is unknown. Takes %1(byte) as parameter.



target_expansion

The use of this command is unknown. Takes no parameter.

appeared in vanilla SC scripts. Looks like was a general "attack" command not necessarily expansions.

Update: This only sets a flag. The actual effects from that flag are unknown.



build_bunkers

Supposedly builds bunkers. Takes no parameters.



build_turrets

Supposedly builds turrets. Takes no parameters.



default_build

The use of this command is unknown. Takes no parameter.

[color=blue]"default build" is on by default."




easy_attack (byte) (unit)

The definition of this command is unknown. Supposedly attacks the enemy with %1 units of type %2 without having to do attack_add, attack_prepare, and attack_do.



eval_harass (block)

Jumps to a block when an unknown condition related to the town and attack manager are met. Also uses enemy unit ground/air strength values to compare with something.



harass_factor (word)

Something related to unit strengths in a region.



if_dif (byte) (byte) (block)

Jumps to block %3 if value %2 is different than an unknown internal value (related to attacking?), using modifier %1(0 = greater than, 1 = less than).



implode

The definition of this command is unknown. Takes no parameter.



quick_attack

Supposedly perform an attack quickly without preparing it. (?) Takes no parameter.



wait_bunkers

Supposedly waits for the command build_bunkers to finish. Takes no parameters.



wait_secure

The definition of this command is unknown. Takes no parameters.



wait_turrets

Supposedly waits for the command build_turrets to finish. Takes no parameters.



wait_upgrades

Supposedly waits for all upgrades to finish. Takes no parameter.

[/color][/spoiler]


Gluck w/ your discoveries.
Dreadkillz
Posts: 13
Joined: Wed May 30, 2007 9:13 pm

Postby Dreadkillz » Thu May 31, 2007 10:41 pm

[quote name='Ojan' post='13' date='Apr 23 2007, 05:24 PM']If you haven't heard of it, there is SCU - a wiki for StarCraft modding. The AI section hasn't been started yet, so we could use your help if you would like to contribute :) This is a community project, so feel free to "hijack" the AI section and improve it any way that you see fit. If you guys want to contribute and don't like the proposed page layout, then change it into something better :)[/quote]
Shame that the webpage no longer exist. I have just started AI scripting, and I would really like to know what the unknowns do. Has anyone ever found out their exact functions yet?
lifestyl3
Posts: 36
Joined: Mon Apr 23, 2007 11:38 pm

Postby lifestyl3 » Fri Jun 01, 2007 1:35 pm

I might be able to help with a few of these. I may be wrong, so feel free to correct my mistakes.

check_transports - I'm pretty sure that most of us at least have a basic idea of what this is. Once this is a called, the AI will build and keep as many transports as was set by the define_max. The AI will then use these transports for drops and expanding.

creep (byte) - This has to do with tower placement. I'm not really sure exactly how it affects placement, but if you leave it out, sometimes it will cause script crashes, or at least I think it will. It always takes a 3 or 4 in blizz scripts.

place_guard (unit) (byte) - this is used to tell a unit to guard a town. I'm not really sure what the byte value is for, but I think it is a counter of the units that are defending. For example,

Code: Select all

place_guard high_templar 0
place_guard high_templar 1
sets 2 temps to guard the area.

player_need (byte) (building) - this is a lot like build. I'm honestly not sure what the exact difference is.

nuke_rate (byte) - sets the amount of time between nuclear launches. It would take a bit of testing to learn the time units for this.

transports_off - tells the AI to not worry about managing transports until check_transports is called.

wait_force - I usually use this before an attack_add to make sure I have the units made first. It seems to serve the same purpose as wait_train.


hopefully that is enough to get people started. I'm pretty new at this. I want to know what some of you more experienced guys have discovered. :)
Heinermann
Posts: 362
Joined: Thu Apr 26, 2007 12:42 am

Postby Heinermann » Fri Jun 01, 2007 11:23 pm

I thought the value in "creep" determines the distance towers are placed from each other.


I think "prep_down" has to do with Siege Tanks, as both Tank Mode and Siege Mode are compared in memory.

"if_towns" doesn't exist.

"fatal_error" causes a fatal AI script error. "Illegal AI script executed."
EasyChat
Posts: 60
Joined: Mon Apr 23, 2007 9:49 pm

Postby EasyChat » Sat Jun 02, 2007 11:51 am

Baja, if you load up the QOB / zbath combined, and watch them both. I use my creep command a bit differently to you i believe. Your ai builds 1 infront and 1 on the side (sunkens). Mine builds 1 at the front and one at the very back.

And also my spore colonies, they are built more or less all round. I have no idea how it works, i just shoved different creep commands in and off we go ^^.
Scourge_Splitter
Posts: 36
Joined: Fri May 11, 2007 12:56 pm

Postby Scourge_Splitter » Sat Jun 02, 2007 12:25 pm

the scout_with command does work
however it's a little tricky to see it in the works.

guard_resources is easy (and works very good) however I haven't succeeded yet at making more as 1 particular unit gaurd the same spot of resources.
also I've seen they are prepping guards for ALL unguarded resource locations

get_oldpeons (byte). this command is used in blizzard scripts in expansion and has something to do with recalling workers from the main base to prebuild several building or collect resources, at least, this is what i've seen so far.
what the amount stands for I'm not really sure, but I assume the amount of workers.

I must say, I've not been so experimental because my first wish was getting working scripts for my mods instead of experimenting too much.
Heinermann
Posts: 362
Joined: Thu Apr 26, 2007 12:42 am

Postby Heinermann » Sat Jun 02, 2007 1:06 pm

I took some time to get the values for "rush".
Sunkens/spores count as 2 units

0 = Barracks OR Spawning Pool OR Gateway (includes incomplete)
1 = At Least 17 Marines + Bunkers, OR at least 16 Sunken Colonies + Hydralisks, OR at least 7 Zealots
2 = At least 25 Marines + Bunkers, OR At least 11 Mutalisks + Spore Colonies + Hydralisks
3 = At least 6 Marines + Bunkers, OR At least 3 Sunken Colonies + Hydralisks, OR Hydralisk Den?, OR at least 2 Zealots
4 = At least 17 Marines + Bunkers, OR At least 16 Sunken Colonies + Hydralisks, OR at least 9 Zealots
5 = At least 7 Marines + Bunkers, OR at least 7 Sunken Colonies + Hydralisks, OR at least 4 Zealots
6 = At least 13 Marines + Bunkers, OR at least 2 Sunken Colonies, OR at least 2 Dragoons
7 = ?? Siege Tank, OR ?? Queen, OR at most 5 Zealots.
8 = At least 6 Marines + Bunkers, OR at least 3 Sunken Colonies + Hydralisks, OR at least 2 Zealots
9 = At least 10 Marines + Bunkers, OR at least 5 sunken colonies + Hydralisks, OR at least 6 Zealots
10= At least 5 Marines + Bunkers, OR at least 5 Sunken Colonies + Hydralisks, OR at least 3 Zealots
11= At least 10 Marines + Bunkers, OR at least 10 Sunken Colonies + Hydralisks, OR at least 6 Zealots
12= At Least 17 Marines + Bunkers, OR at least 6 Mutalisks + Spore Colonies + Hydralisks, OR at least 3 Dragoons + Scouts
13= At least 25 Marines + Bunkers, OR at least 11 Mutalisks + Spore Colonies + Hydralisks, OR at least 8 Dragoons + Scouts

Any other values don't exist.
Test them to see if they work.

*** NAMED OPCODES WITH MEANING ON RESEARCH *** [spoiler]op[0x10].desc = The use of this command is unknown. Takes no parameter.
op[0x10].cmd = capt_expand
op[0x10].parms = 0

op[0x22].desc = The use of this command is unknown. Takes %1(byte) as parameter.
op[0x22].cmd = default_min
op[0x22].parms = 1
op[0x22].parm[1].type = byte

op[0x23].desc = The use of this command is unknown. Takes no parameter.
op[0x23].cmd = defaultbuild_off
op[0x23].parms = 0

op[0x2B].desc = Causes the AI not to worry about transports until check_transports is called.
op[0x2B].cmd = transports_off
op[0x2B].parms = 0

op[0x2C].desc = Causes AI to build transports until its maximum, and use them more often.
op[0x2C].cmd = check_transports
op[0x2C].parms = 0

op[0x2D].desc = Sets the time interval between nuclear launches.
op[0x2D].cmd = nuke_rate
op[0x2D].parms = 1
op[0x2D].parm[1].type = byte

op[0x2E].desc = The use of this command is unknown. Takes %1(word) as parameter.
op[0x2E].cmd = max_force
op[0x2E].parms = 1
op[0x2E].parm[1].type = word

op[0x3B].desc = If unit is harvesting or using a worker command...
op[0x3B].cmd = get_oldpeons
op[0x3B].parms = 1
op[0x3B].parm[1].type = byte

op[0x3D].desc = Orders a unit to guard town.
op[0x3D].cmd = place_guard
op[0x3D].parms = 2
op[0x3D].parm[1].type = unit
op[0x3D].parm[2].type = byte

op[0x3E].desc = Waits until unit is completed.
op[0x3E].cmd = wait_force
op[0x3E].parms = 2
op[0x3E].parm[1].type = byte
op[0x3E].parm[2].type = unit

op[0x43].desc = Something to do with tower placement. Takes %1(byte) as parameter.
op[0x43].cmd = creep
op[0x43].parms = 1
op[0x43].parm[1].type = byte

op[0x44].desc = The use of this command is unknown. Takes %1(block) as parameter.
op[0x44].cmd = panic
op[0x44].parms = 1
op[0x44].parm[1].type = adress

op[0x45].desc = Same as Build.
op[0x45].cmd = player_need
op[0x45].parms = 2
op[0x45].parm[1].type = byte
op[0x45].parm[2].type = building

op[0x46].desc = Should take 3 params? ??
op[0x46].cmd = do_morph
op[0x46].parms = 0

op[0x49].desc = Jump if specific preset unit conditions are met
op[0x49].cmd = rush
op[0x49].parms = 2
op[0x49].parm[1].type = byte
op[0x49].parm[2].type = adress

op[0x4A].desc = Command appears to have no actions...
op[0x4A].cmd = scout_with
op[0x4A].parms = 1
op[0x4A].parm[1].type = military

op[0x4D].desc = The use of this command is unknown. Takes no parameter.
op[0x4D].cmd = target_expansion
op[0x4D].parms = 0

op[0x4F].desc = The use of this command is unknown. Takes %1(byte) as parameter.
op[0x4F].cmd = set_attacks
op[0x4F].parms = 1
op[0x4F].parm[1].type = byte

op[0x5C].desc = The use of this command is unknown. Takes no parameters.
op[0x5C].cmd = guard_all
op[0x5C].parms = 0

op[0x66].desc = The use of this command is unknown. Takes no parameters.
op[0x66].cmd = fake_nuke
op[0x66].parms = 0

op[0x6A].desc = The use of this command is unknown. Takes %1(unit) and %2(block) as parameters.
op[0x6A].cmd = if_owned
op[0x6A].parms = 2
op[0x6A].parm[1].type = unit
op[0x6A].parm[2].type = adress

op[0x6F].desc = The use of this command is unknown. Takes %1(byte) and %2(block) as parameters.
op[0x6F].cmd = allies_watch
op[0x6F].parms = 2
op[0x6F].parm[1].type = byte
op[0x6F].parm[2].type = adress

op[0x70].desc = The use of this command is unknown. Takes %1(byte) and %2(block) as parameters.
op[0x70].cmd = try_townpoint
op[0x70].parms = 2
op[0x70].parm[1].type = byte
op[0x70].parm[2].type = adress

; *** NAMED OPCODES WITH UNKNOWN DEFINITION ***

op[0x0F].desc = Points to wait_bunkers with alternate params.
op[0x0F].cmd = wait_secure
op[0x0F].parms = 0

op[0x11].desc = Memory mentions bunkers.
op[0x11].cmd = build_bunkers
op[0x11].parms = 0

op[0x12].desc = The definition of this command is unknown. It is never used in Blizzard scripts.
op[0x12].cmd = wait_bunkers
op[0x12].parms = 0

op[0x28].desc = Causes a fatal AI script error. "Illegal AI script executed."
op[0x28].cmd = fatal_error
op[0x28].parms = 0

op[0x34].desc = Memory mentions Missile Turrets.
op[0x34].cmd = build_turrets
op[0x34].parms = 0

op[0x35].desc = Points to wait_bunkers with alternate params.
op[0x35].cmd = wait_turrets
op[0x35].parms = 0

op[0x36].desc = The definition of this command is unknown. It is never used in Blizzard scripts.
op[0x36].cmd = default_build
op[0x36].parms = 0

op[0x37].desc = The definition of this command is unknown. It is never used in Blizzard scripts.
op[0x37].cmd = harass_factor
op[0x37].parms = 1 ?

op[0x3A].desc = The definition of this command is unknown. It is never used in Blizzard scripts.
op[0x3A].cmd = region_size
op[0x3A].parms = 1 ?

op[0x42].desc = The definition of this command is unknown. It is never used in Blizzard scripts.
op[0x42].cmd = eval_harass
op[0x42].parms = 1 ?

op[0x47].desc = The definition of this command is unknown. It is never used in Blizzard scripts.
op[0x47].cmd = wait_upgrades
op[0x47].parms = 0

op[0x53].desc = Something to do with Siege tanks(Tank and Siege modes)?
op[0x53].cmd = prep_down
op[0x53].parms = 3 ?

op[0x5B].desc = The definition of this command is unknown. It is never used in Blizzard scripts.
op[0x5B].cmd = implode
op[0x5B].parms = 0

op[0x5F].desc = The definition of this command is unknown. It is never used in Blizzard scripts.
op[0x5F].cmd = if_dif
op[0x5F].parms = 3 ?

op[0x60].desc = The definition of this command is unknown. It is never used in Blizzard scripts.
op[0x60].cmd = easy_attack
op[0x60].parms = 2 ?

op[0x64].desc = Seems to be a buffed up version of Attack_Prepare.
op[0x64].cmd = quick_attack
op[0x64].parms = 0

op[0x71].desc = Does not exist.
op[0x71].cmd = if_towns
op[0x71].parms = 0[/spoiler]
Scourge, can you truely confirm the scout_with command? It doesn't seem to even have actions associated with it in memory...
Heinermann
Posts: 362
Joined: Thu Apr 26, 2007 12:42 am

Postby Heinermann » Sat Jun 02, 2007 10:30 pm

Yeah, I looked at the assembly in ollydbg. :)

Return to “StarCraft Modding”

Who is online

Users browsing this forum: No registered users and 1 guest