hey guys, I wonder where should I put functions to make sure it is only executed once.
For example, I write a function DenfendDropReaver() for defending protoss reaver strategy, the function works like this:
1.When I find the opponent's shuttle in my area, I want all my units gather and follow it.
2.If the shuttle drops a reaver, I order all my units go and attack it.
3. After that, I want my units stay idle.
Because I don't know when opponent's shuttle will come, so I have to put this function in OnFrame().
However, anything related to unit control in the function Onframe() works terrible because it is called each frame, so all units just stuck.
Even if I try to use unit->getOrder() to fix that, it still works bad.
So how could I realize the effect as I choose my units and right click just for one time, and then the units stay idle?
By the way, I've tried many ways to find a polygon's boundary but failed.....