• 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.

Doesn''t Kill the unit behind the target

Status
Not open for further replies.
Level 5
Joined
Aug 8, 2008
Messages
113
SUppose when you attack the target another unit is created that attacks the unit behind the target but it doesn't do that.



  • Shooter
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • (Unit-type of DamageEventTarget) Equal to Scout
      • (Unit-type of DamageEventSource) Equal to Sniper
      • DamageEventOverride Equal to False
    • Actions
      • Set DamageEventOverride = True
      • Custom script: call ExecuteFunc("shackle")
      • Custom script: endfunction
      • Custom script: function shackle takes nothing returns nothing
      • Wait until ((Unit-type of DamageEventSource) Equal to Sniper), checking every 1.00 seconds
      • Wait until ((Unit-type of DamageEventTarget) Equal to Scout), checking every 1.00 seconds
      • Set ShackleCasterPosition = (Position of DamageEventSource)
      • Set ShackleTargetPosition = (Position of (Triggering unit))
      • Set ShackleGroup = (Units within 550.00 of ShackleTargetPosition)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked unit) is A structure) Equal to False
          • ((Picked unit) belongs to an enemy of (Owner of DamageEventSource)) Equal to True
          • (Angle from ShackleTargetPosition to ShacklePickedUnitPosition) Greater than or equal to ((Angle from ShackleCasterPosition to ShackleTargetPosition) - 3.00)
          • (Angle from ShackleTargetPosition to ShacklePickedUnitPosition) Less than or equal to ((Angle from ShackleCasterPosition to ShackleTargetPosition) + 3.00)
          • ((Picked unit) is alive) Equal to True
          • (Picked unit) Not equal to (Triggering unit)
          • (Picked unit) Not equal to DamageEventSource
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in ShackleTargetsBehind) Equal to 0
            • Then - Actions
              • Unit Group - Add (Picked unit) to ShackleTargetsBehind
            • Else - Actions
        • Else - Actions
      • Set ShackleTargetPick = (Random 1 units from ShackleTargetsBehind)
      • Unit Group - Remove all units of ShackleTargetsBehind from ShackleTargetsBehind
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in ShackleTargetPick) Greater than 0
        • Then - Actions
          • Unit - Create 1 Shooter for (Owner of DamageEventSource) at ShackleTargetPosition facing ShackleTargetPosition2
          • Set TempUnit = (Last created unit)
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Unit Group - Pick every unit in ShackleTargetPick and do (Actions)
            • Loop - Actions
              • Unit Group - Remove (Picked unit) from ShackleTargetsBehind
              • Set ShacklePickedUnitPosition2 = (Position of (Picked unit))
              • Unit - Order TempUnit to Attack (Picked unit)
          • Custom script: call RemoveLocation(udg_ShacklePickedUnitPosition2)
          • Set ShackleInstances[0] = (ShackleInstances[0] + 1)
          • Set ShackleInstances[1] = (ShackleInstances[1] + 1)
          • Custom script: if udg_ShackleInstances[0] >= 8000 then
          • Set ShackleInstances[0] = 0
          • Custom script: call RemoveLocation(udg_ShackleCasterPosition)
          • Custom script: call RemoveLocation(udg_ShackleTargetPosition)
          • Custom script: call RemoveLocation(udg_ShacklePickedUnitPosition)
          • Custom script: call RemoveLocation(udg_ShacklePickedTreePosition)
          • Custom script: call DestroyGroup(udg_ShackleTargetPick)
          • Custom script: call DestroyGroup(udg_ShackleGroup)
          • Custom script: endif
        • Else - Actions
          • Set ShackleTargetPosition2 = (ShackleTargetPosition offset by 353.55 towards (Angle from ShackleCasterPosition to ShackleTargetPosition) degrees)
          • Destructible - Pick every destructible in (Region centered at ShackleTargetPosition2 with size (500.00, 500.00)) and do (Actions)
            • Loop - Actions
              • Set ShacklePickedTreePosition = (Position of (Picked destructible))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked destructible) is alive) Equal to True
                  • (Angle from ShackleTargetPosition to ShacklePickedTreePosition) Greater than or equal to ((Angle from ShackleCasterPosition to ShackleTargetPosition) - 3.00)
                  • (Angle from ShackleTargetPosition to ShacklePickedTreePosition) Less than or equal to ((Angle from ShackleCasterPosition to ShackleTargetPosition) + 3.00)
                • Then - Actions
                  • Unit - Create 1 Shooter for (Owner of DamageEventSource) at ShackleTargetPosition facing ShackleTargetPosition2
                  • Set TempUnit = (Last created unit)
                  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                  • Unit - Order TempUnit to Attack (Picked unit)
                  • Custom script: if udg_ShacklePickedTree == null then
                  • Set ShacklePickedTree = (Picked destructible)
                  • Set ShacklePickedTreePosition2 = (Position of ShacklePickedTree)
                  • Custom script: endif
                • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ShacklePickedTree Not equal to No destructible
            • Then - Actions
              • Custom script: call RemoveLocation(udg_ShackleCasterPosition)
              • Custom script: call RemoveLocation(udg_ShackleTargetPosition)
              • Custom script: call RemoveLocation(udg_ShacklePickedUnitPosition)
              • Custom script: call RemoveLocation(udg_ShacklePickedTreePosition)
              • Custom script: call DestroyGroup(udg_ShackleTargetPick)
              • Custom script: call DestroyGroup(udg_ShackleGroup)
            • Else - Actions
 
Level 5
Joined
Aug 8, 2008
Messages
113
maybe cause of your Wait Action

response
no its not that because it still creates the unit.
question
how do you make it so that the scout is created 600 units infront of the damage source instead of 600 units away and to the side or behind?.
 
Status
Not open for further replies.
Top