• 0

    posted a message on Can't get (what I thought was) a fairly basic trigger to work

    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:

       Events
            Unit - Any Unit is issued an order to SCV - Build Command Center
        Local Variables
        Conditions
            1 <= (Number of Living units in (Command Center units in (Region((Target point for (Triggering order)), 20.0)) owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount)) <= 100
        Actions
            Unit - Order (Triggering unit) to (SCV - Cancel) (Replace Existing Orders)
            Unit - Order (Triggering unit) to ( Stop) (Replace Existing Orders)
            Unit - Cancel progress bar of ((Triggering unit)) slot 1 
            UI - Display "You can't place a new colony that c..." and play UI_GenericError for (All players)
    

    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.

    Posted in: Triggers
  • To post a comment, please or register a new account.