• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Cancel Building Ability

Status
Not open for further replies.
I have a system that successfully cancels an ability being cast by a unit. This means the mana is not spent and the cooldown is not started. When I apply this to a building it does not work. Why are spells cast by buildings different?

  • Unit Cannon Try
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Cannon Fodder
    • Actions
      • Set Unit_Cannon_Pos = (Target point of ability being cast)
      • Set Unit_Cannon_Pos_B = (Position of (Triggering unit))
      • Custom script: set udg_Unit_Cannon_AoE=GetLocationZ(udg_Unit_Cannon_Pos)
      • Set ErrorPlayer = (Owner of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between Unit_Cannon_Pos and Unit_Cannon_Pos_B) Less than 1500.00
        • Then - Actions
          • Unit - Order (Triggering unit) to Stop
          • Set ErrorMessage = Target is inside minimum range.
          • Custom script: call ErrorMessage(udg_ErrorMessage,udg_ErrorPlayer)
        • Else - Actions
      • Destructible - Pick every destructible within 450.00 of Unit_Cannon_Pos and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Destructible-type of (Picked destructible)) Equal to Unit Cannon Deep Sea Blocker (Small)
            • Then - Actions
              • Unit - Order (Triggering unit) to Stop
              • Set ErrorMessage = Unable to target deep water.
              • Custom script: call ErrorMessage(udg_ErrorMessage,udg_ErrorPlayer)
            • Else - Actions
      • Destructible - Pick every destructible within 800.00 of Unit_Cannon_Pos and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Destructible-type of (Picked destructible)) Equal to Unit Cannon Deep Sea Blocker (Large)
            • Then - Actions
              • Unit - Order (Triggering unit) to Stop
              • Set ErrorMessage = Unable to target deep water.
              • Custom script: call ErrorMessage(udg_ErrorMessage,udg_ErrorPlayer)
            • Else - Actions
      • Destructible - Pick every destructible within 300.00 of Unit_Cannon_Pos and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Destructible-type of (Picked destructible)) Equal to Ashenvale Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Barrens Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Barrens Canopy Tree
                  • (Destructible-type of (Picked destructible)) Equal to Black Citadel Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Cityscape Fall Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Cityscape Snowy Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Cityscape Summer Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Cityscape Winter Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Cityscape Ruined Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Dalaran Ruins Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Dungeon Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Felwood Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Felwood Canopy Tree
                  • (Destructible-type of (Picked destructible)) Equal to Icecrown Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Icecrown Canopy Tree
                  • (Destructible-type of (Picked destructible)) Equal to Northrend Canopy Tree
                  • (Destructible-type of (Picked destructible)) Equal to Fall Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Summer Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Snowy Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Winter Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Northrend Tree Wall (Normal)
                  • (Destructible-type of (Picked destructible)) Equal to Outland Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Ruins Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Ruins Canopy Tree
                  • (Destructible-type of (Picked destructible)) Equal to Underground Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Village Tree Wall
                  • (Destructible-type of (Picked destructible)) Equal to Northrend Tree Wall (Pathing Blocker)
                  • (Destructible-type of (Picked destructible)) Equal to Pathing Blocker [Outer]
            • Then - Actions
              • Unit - Order (Triggering unit) to Stop
              • Set ErrorMessage = Target area is obstructed.
              • Custom script: call ErrorMessage(udg_ErrorMessage,udg_ErrorPlayer)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit_Cannon_Pos is masked for (Owner of (Triggering unit))) Equal to True
        • Then - Actions
          • Unit - Order (Triggering unit) to Stop
          • Set ErrorMessage = Target area must be visible.
          • Custom script: call ErrorMessage(udg_ErrorMessage,udg_ErrorPlayer)
        • Else - Actions
      • Custom script: call RemoveLocation(udg_Unit_Cannon_Pos)
      • Custom script: call RemoveLocation(udg_Unit_Cannon_Pos_B)
 
As far as I can tell the stop order has no effect on buildings.

Pausing and unpausing causes it to cast the ability until it has no mana left.

I think buildings are just entirely different.

create 2 buildings at center of map with enemies around it. then make a trigger with the event player ends cinematic event. then in the action order those units to stop. when u press it once it appears to do nothing. but when u press esc fast enough ull notice that the units do stop attacking. pausing and unpausing doesnt do anything without a stop event. u can try putting the stop action after u pause the unit and b4 u unpause the unit. mybe this will work.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
It is because Buildings' Art - Animation - Cast Point is set to 0.000.
Units usually have this field filled with values ranging from 0.3 ~ 0.5.
This is the cast delay of a unit for it to successfully cast a spell.

By adjusting the value within the default range (0.3 ~ 0.5), it should solve the problem.
 
  • Like
Reactions: Kam
Status
Not open for further replies.
Top