HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Unit That Constructs a Building

08-30-2008, 09:50 PM#1
Panto
Greetings.

Who's tried to get the unit that makes the building in a "Unit Begins Construction" event? There's GetConstructingStructure() or GetTriggerUnit() for the building that's constructed but no obvious way to get the unit that made it.

I'm interested in hearing what routes you've taken to solve this issue.

Thanks!

08-30-2008, 10:34 PM#2
Anitarf
Detect when units are issued construction orders? I dunno.
08-31-2008, 02:29 AM#3
ToukoAozaki
I remember posting about this.

In case of human, you can check for the first "repair" order on the structure being constructed.

In case of orc, nightelf, you can check for workers' position and their order with 0 sec timer. The position of constructor should be identical to the structure, and current order should be equivalent to that unit type id.
08-31-2008, 11:08 PM#4
Panto
I suppose I could store the unit that "Starts the Effect" of a build ability as a global, or something similar to that. I thought I might unearth a good "Event Response"-style function like GetConstructedStructure() for the building unit from you fine forum-goers, but I'll take what I can get!