I'm trying to construct a simple trigger that won't let a player build a command center within a radius of 20 of another command center, regardless of who owns it. The trigger I'm using is as follows:
EventsUnit-AnyUnitisissuedanordertoSCV-BuildCommandCenterLocalVariablesConditions1<=(NumberofLivingunitsin(CommandCenterunitsin(Region((Targetpointfor(Triggeringorder)),20.0))ownedbyplayerAnyPlayermatchingExcluded:Missile,Dead,Hidden,withatmostAnyAmount))<=100ActionsUnit-Order(Triggeringunit)to(SCV-Cancel)(ReplaceExistingOrders)Unit-Order(Triggeringunit)to(Stop)(ReplaceExistingOrders)Unit-Cancelprogressbarof((Triggeringunit))slot1UI-Display"You can't place a new colony that c..."andplayUI_GenericErrorfor(Allplayers)
Unfortunately, every I issue an order to an SCV to build a command center within 20 units of another unit, the order always gets canceled as if the unit type check failed, regardless of whether or not any of the nearby units are actually command centers. Attempting various different formulations (Pick Every Unit, and canceling the order if any are Command Centers, for instance) yield the same result. The funny thing is, it works fine if, e.g., there are a couple of other marines or SCVs in the target location, and they have to move out of the way first; the type check goes through fine, and construction only fails if the target location is within 20 units of another command center. That makes me think it's some kind of bug, but I can't figure out a workaround or an alternate way to construct the trigger to avoid it.
0
I'm trying to construct a simple trigger that won't let a player build a command center within a radius of 20 of another command center, regardless of who owns it. The trigger I'm using is as follows:
Unfortunately, every I issue an order to an SCV to build a command center within 20 units of another unit, the order always gets canceled as if the unit type check failed, regardless of whether or not any of the nearby units are actually command centers. Attempting various different formulations (Pick Every Unit, and canceling the order if any are Command Centers, for instance) yield the same result. The funny thing is, it works fine if, e.g., there are a couple of other marines or SCVs in the target location, and they have to move out of the way first; the type check goes through fine, and construction only fails if the target location is within 20 units of another command center. That makes me think it's some kind of bug, but I can't figure out a workaround or an alternate way to construct the trigger to avoid it.