Taranok wrote:Under Maelstrom AI Blacklist there are no Terran Units?
Nope. I'm afraid it's a hardcoded thing -- because the particular function (and many others) use switch tables, the range of controllable units is limited. It can be changed to include Terran units, but at the cost of removing many Protoss units (which are at the far end of the switch table). Besides, it would be too complex and too specific for FireGraft.
I'd also like to explain how the new "inclusion flag checks" and "exclusion flag checks" work.
Flag Checks(For those who don't know what a bitfield is, see the Wikipedia article on
bitfields and
masks.)
In StarCraft, each unit has several distinct properties. A Marine is a Terran unit, on ground, and organic. A Shuttle is a Protoss unit, in air, and is both mechanical and robotic. These properties are used to determine which unit is affected by certain abilities and spells, such as Irradiate and Lockdown. How does StarCraft do this?
If you open DatEdit and go to the Advanced tab in units.dat, you will see many checkboxes that control a unit's properties. In StarCraft, this information is saved into a single bitfield that is known as the
Unit Prototype Flag, aka the Special Ability Flag. Each property (checkbox) is represented as:
(Data copied from IDA Pro)
Code: Select all
; enum unitSpecialAbilityFlags (bitfield)
00000001 USAFlag_Building = 1
00000002 USAFlag_Addon = 2
00000004 USAFlag_Flyer = 4
00000008 USAFlag_Worker = 8
00000010 USAFlag_Subunit = 10h
00000020 USAFlag_Flying_Building = 20h
00000040 USAFlag_Hero = 40h
00000080 USAFlag_Regen_HP = 80h
00000100 USAFlag_Ani_Idle = 100h
00000200 USAFlag_Cloak = 200h
00000400 USAFlag_2_in_1 = 400h
00000800 USAFlag_Neut_Access__Neutral__Single_Entity = 800h
00001000 USAFlag_Resource_Depot = 1000h
00002000 USAFlag_Resource = 2000h
00004000 USAFlag_Robotic = 4000h
00008000 USAFlag_Detector = 8000h
00010000 USAFlag_Organic = 10000h
00020000 USAFlag_Creep = 20000h
00040000 USAFlag_Unused = 40000h
00080000 USAFlag_Req_Psi = 80000h
00100000 USAFlag_Burrowable = 100000h
00200000 USAFlag_Spell_Mana = 200000h
00400000 USAFlag_PermaCloak = 400000h
00800000 USAFlag_NPC_Access__Powerup = 800000h
01000000 USAFlag_Morph_from_Unit__Check_Supply_Count = 1000000h
02000000 USAFlag_Med_overlay = 2000000h
04000000 USAFlag_Large_overlay = 4000000h
08000000 USAFlag_Auto_attk__Battle_React = 8000000h
10000000 USAFlag_Attack__Direct_attk = 10000000h
20000000 USAFlag_Invincible = 20000000h
40000000 USAFlag_Mech = 40000000h
80000000 USAFlag_Wide_radius_creep = 80000000h
For example, a Marine has the following checked in DatEdit: Organic, Battle Reactions, and Full-Auto Attack. In-game, this would combine into
Code: Select all
USAFlag_Organic | USAFlag_Auto_attk__Battle_React | USAFlag_Attack__Direct_attk
= 0x10000 | 0x8000000 | 10000000
= 0x18010000
= 402718720
Now, let's look at the actual EXE edits. Example: AI Management > Tech > Irradiate AI > High-priority flag check (special ability)
This EXE edit controls which units are selectively Irradiated when a Science Vessel is not under attack. The default value is
8 = 0x8 = USAFlag_Worker, which means that Vessels will hunt (organic) worker units when they aren't being attacked.
Now, let's say we want SVs to hunt ALL Zerg units when they are idle. How do we do this? Because all zerg units (except the eggs and cocoons) regenerate HP, it would be best to use the USAFlag_Regen_HP flag. Thus, we would have to set the new value to...
Code: Select all
USAFlag_Worker | USAFlag_Regen_HP = 0x8 | 0x80 = 0x88 = 136
There! Now your SVs are much more active versus Zerg.
You can also do things like this with the
Unit Status Flag, which tells you whether a unit is burrowed, is a hallucination, or is currently cloaked, etc.
(Data copied from IDA Pro)
Code: Select all
; enum unitStatusFlags (bitfield)
00000001 USFlag_Completed = 1
00000002 USFlag_GroundedBuilding = 2
00000004 USFlag_InAir = 4
00000008 USFlag_DisabledUnit = 8
00000010 USFlag_Burrowed = 10h
00000020 USFlag_InBuilding = 20h
00000040 USFlag_InTransport = 40h
00000080 USFlag_Unknown0x80 = 80h
00000100 USFlag_RequiresDetector = 100h
00000200 USFlag_Cloaked = 200h
00000400 USFlag_DisabledDoodad = 400h
00000800 USFlag_NoCloakingEnergyDecrease = 800h
00001000 USFlag_NoOrdersAllowed = 1000h
00002000 USFlag_NoBrkCodeSection = 2000h
00004000 USFlag_Unknown0x4000 = 4000h
00008000 USFlag_CannotAttack = 8000h
00010000 USFlag_IsAUnit = 10000h
00020000 USFlag_IsABuilding = 20000h
00040000 USFlag_IgnoreTileCollision = 40000h
00080000 USFlag_Unmovable = 80000h
00100000 USFlag_IsNormal = 100000h
00200000 USFlag_NoCollide = 200000h
00400000 USFlag_Unknown0x400000 = 400000h
00800000 USFlag_IsGathering = 800000h
01000000 USFlag_Unknown0x1000000 = 1000000h
02000000 USFlag_Unknown0x2000000 = 2000000h
04000000 USFlag_Invincible = 4000000h
08000000 USFlag_HoldingPosition = 8000000h
10000000 USFlag_SpeedUpgrade = 10000000h
20000000 USFlag_cooldownUpgrade = 20000000h
40000000 USFlag_IsHallucination = 40000000h
80000000 USFlag_IsSelfDestructing = 80000000h
A fair warning: many of these flags may have unknown properties. Use with caution!
For those who want to deal with flags, I have made a small tool that decodes flag masks into individual bits. Just download, extract and double-click the
sc_flags.hta file, and it will work like any normal Windows program.