HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

is a building building something?

10-29-2003, 10:28 AM#1
silverdrake
Is there an easy way to find out if a building is idle or not? The only way i have thought of is checking GetUnitCountDone(everything it can make) - GetUnitCount(everything it can make) but this will get cumbersome with 5 different buildings to check.
10-29-2003, 01:14 PM#2
Vexorian
You posted in this forum thinking that you could get a Isbuildingbuilding() function, but you can just use my gui method

Events:
A unit : Begins trainning a unit
Conditions
Actions
Set the custom value of (triggering unit) to 1


Events:
A unit : Finnishes trainning a unit
Conditions
Actions
Set the custom value of (triggering unit) to 0

Do the same with starts upgrading - researching and that stuff
then whenever you want to know if a building is idle, check its custom value, if it is 0 it is idle.
10-29-2003, 05:13 PM#3
PitzerMike
humm, Vex, he's talking about AI files, not triggers.

And yeah Silverdrake, this UnitCountDone and UnitCount comparison will be your best shot.

Just create a function that does the comparison and pass in the building type as input parameter and let the function do the rest.