I'm looking for a way to 'disappear' a given unit or structure from the map entirely. Looking at HFL, it seems like UnitEx.DoPoof() should do this, but it doesn't work for me. Has anyone gotten this method to work?
From the doc:
DoPoof causes a unit to disappear, or 'poof' from the map immediately.
void DoPoof();
DoPoof will cause a minor graphics glitch. (The unit graphics will not disappear until the map viewport is moved). It is best to take the unit to the edge of the map before poofing it.
Even if I move the viewport, it doesn't disappear my units. For instance, here's some code I'm trying just as a test:
SCRIPT_API void CheckEarthworker()
{
UnitEx unit;
PlayerVehicleEnum enum1(0);
while(enum1.GetNext(unit)) {
if(unit.IsVehicle()) {
if(unit.GetType() == mapEarthworker) {
TethysGame::AddMessage(1248, 576, "Earthworker found!", -1, 89);
unit.DoPoof();
}
}
}
}
I get the message above, but no poof.