range check not working

deathblade

New Member
Reaction score
4
Code:
Master Check
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Master Marker 
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                And - All (Conditions) are true
                    Conditions
                        (Number of units in (Units within 400.00 of (Target point of ability being cast) matching (((Unit-type of (Matching unit)) Equal to Death Marker) and ((Unit-type of (Matching unit)) Equal to Master Marker)))) Equal to 0
                        (Number of units in (Units in (Entire map) matching ((Unit-type of (Matching unit)) Equal to Master Marker))) Equal to 0
            Then - Actions
                Unit - Create 1 Master Marker for (Owner of (Triggering unit)) at (Target point of ability being cast) facing Default building facing degrees
            Else - Actions
                Custom script:   call SimError(GetOwningPlayer(GetTriggerUnit()), "You can place a marker here.")

everything works exept when i cast the spell again (within 400 range) it just goes on as if i didnt put that range check line
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
A unit can't be of two different types at once.
Change that "and" in the matching part to "or".
Or just remove the second part, as the next condition already checks that type.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top