Say I want to detect when a drone unburrows as a means of activating a revive.
What method could I use to detect whether burrowed or unburrowed?
None.
Math + Physics + StarCraft = Zoan
Here are the steps you need to have the triggers follow:
1: center a small 1 pixel by 1 pixel location on the drone
2: move an arbitrary but small unit owned by a computer player, say a terran civilian, from an arbitrary, isolated location to the 1 pixel by 1 pixel location you centered on the drone
3: in a separate trigger, detect whether the terran civilian is at the 1 pixel by 1 pixel location. If he is, the drone is burrowed. If he is not, the drone is unburrowed.
4: move the civilian back to it's arbitrary, isolated location, using a 'move all terran marine for -computer player- at location anywhere to 'isolated location''.
Post has been edited 1 time(s), last time on Dec 11 2014, 8:31 pm by Zoan.
An artist's depiction of an Extended Unit Death
Yes. From
Unitnode Structure:
+0xDC - DWORD dwStatus
00000001(0x1) - Is Completed
00000010(0x2) - Is on ground? or is it is unit...
00000100(0x4) - Is in air
00001000(0x8) - Checked for disabled, if it is 00001000, then the unit is disabled(/unpowered?)
00010000(0x10) - Checked for burrowing purposes, if it is 00010000, then the unit is burrowed
00100000(0x20) - Unit is entering a building
01000000(0x40) - unit is entering a transport
10000000(0x80) -
00000001(0x100) - Checked for invisible purposes, if it is 00000001, then the unit requires a detector?
00000010(0x200) - checked for cloak?
00000100(0x400) - deals with doodad states? if set, is disabled
00001000(0x800) - Unit cloaking doesn't need energy decrease
00010000(0x1000) - Unit is in unbreakable code section? Cannot receive orders
00100000(0x2000) - Set by nobrkcodestart
01000000(0x4000) -
10000000(0x8000) - cannot attack if set
00000001(0x10000)
00000010(0x20000) - Is a Building?
00000100(0x4000000) - Invincible
00010000(0x10000000) - Speed upgrade
00100000(0x20000000) - cooldown upgrade
You'll have to see what other flags are set on these bytes for the unit of interest to get the exact values, and of course +0xDC means how far it is from the start of the unit struct at a particular index. I'd probably opt for the method Zoan suggested for the sake of simplicity, though (it's what I used for Fireball's burrow detection).
I find using scarabs, interceptors, or siege tanks infinitely easier than a burrowed unit.
"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"
You could put a power-up (owned by player 12) over the drone. Detect when the player brings the power-up to the location. When the worker picks up the power-up, it will be read as being owned by the player's worker. Killing the unit drops the power-up, returning its ownership to player 12.
Supposing this is in some controlled environment where you don't have to worry about anyone else picking it up. It won't be as fast as other methods listed above though, since there is a delay between when the drone unburrows and when it picks up the power-up.
None.