On spells: If I figure something out, I'll get back to you.
Script: If it works in game, and it satisfies you, then it's fine. All I'll say is that if you have code blocks that are the exact same besides in label name, you should probably erase the duplicate blocks and point the animations to only one copy of the code to avoid wasteful bits. iscript.bin has a file size limit, although I don't remember what it is.
Building units with units: Just try it out.
Ensnare:
Set the flag, 1, to something you don't care about not getting ensnared, like 8192 = 0x00002000, for resource containers (mineral fields and geysers).
//Based on BWAPI; for use with units_dat::BaseProperty[]
namespace UnitProperty {
enum Enum {
Building = 0x00000001,
Addon = 0x00000002,
Flyer = 0x00000004,
Worker = 0x00000008,
Subunit = 0x00000010,
FlyingBuilding = 0x00000020,
Hero = 0x00000040,
RegeneratesHP = 0x00000080,
AnimatedIdle = 0x00000100,
Cloakable = 0x00000200,
TwoUnitsIn1Egg = 0x00000400,
NeutralAccessories = 0x00000800, //AKA "Single entity" (prevents multi-select, set on all pickup items)
ResourceDepot = 0x00001000,
ResourceContainer = 0x00002000,
RoboticUnit = 0x00004000,
Detector = 0x00008000,
Organic = 0x00010000,
CreepBuilding = 0x00020000,
Unused = 0x00040000,
RequiredPsi = 0x00080000,
Burrowable = 0x00100000,
Spellcaster = 0x00200000,
PermanentCloak = 0x00400000,
NPCOrAccessories = 0x00800000, //AKA "Pickup item" (data disc, crystals, mineral chunks, gas tanks, etc.)
MorphFromOtherUnit = 0x01000000,
MediumOverlay = 0x02000000, //Used to determine overlay for various spells and effects
LargeOverlay = 0x04000000, //Used to determine overlay for various spells and effects
AutoAttackAndMove = 0x08000000,
Attack = 0x10000000, /**< Can attack */
Invincible = 0x20000000,
Mechanical = 0x40000000,
ProducesUnits = 0x80000000, /**< It can produce units directly (making buildings doesn't count) */
};
}