Y u no attack picked unit!?!?

Status
Not open for further replies.
Level 18
Joined
May 11, 2012
Messages
2,108
  • Lightning Ball
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Lightning Ball
    • Actions
      • Set LightningBall_TrigUnit = (Triggering unit)
      • Set LightningBall_TrigUnitLoc = (Position of LightningBall_TrigUnit)
      • Set TempPoint = (LightningBall_TrigUnitLoc offset by 256.00 towards 0.00 degrees)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Lightning Ball for LightningBall_TrigUnit) Equal to 1
        • Then - Actions
          • Unit - Create 1 Lightning Ball (Level 1) for (Owner of LightningBall_TrigUnit) at TempPoint facing Default building facing degrees
          • Unit - Add a 15.00 second Generic expiration timer to (Last created unit)
          • Unit - Turn collision for (Last created unit) Off
          • Unit - Make (Last created unit) Invulnerable
          • Set LightningBall_Dummy = (Last created unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Lightning Ball for LightningBall_TrigUnit) Equal to 2
            • Then - Actions
              • Unit - Create 1 Lightning Ball (Level 2) for (Owner of LightningBall_TrigUnit) at TempPoint facing Default building facing degrees
              • Unit - Add a 15.00 second Generic expiration timer to (Last created unit)
              • Unit - Turn collision for (Last created unit) Off
              • Unit - Make (Last created unit) Invulnerable
              • Set LightningBall_Dummy = (Last created unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Lightning Ball for LightningBall_TrigUnit) Equal to 3
                • Then - Actions
                  • Unit - Create 1 Lightning Ball (Level 3) for (Owner of LightningBall_TrigUnit) at TempPoint facing Default building facing degrees
                  • Unit - Add a 15.00 second Generic expiration timer to (Last created unit)
                  • Unit - Turn collision for (Last created unit) Off
                  • Unit - Make (Last created unit) Invulnerable
                  • Set LightningBall_Dummy = (Last created unit)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Lightning Ball for LightningBall_TrigUnit) Equal to 4
                    • Then - Actions
                      • Unit - Create 1 Lightning Ball (Level 4) for (Owner of LightningBall_TrigUnit) at TempPoint facing Default building facing degrees
                      • Unit - Add a 15.00 second Generic expiration timer to (Last created unit)
                      • Unit - Turn collision for (Last created unit) Off
                      • Unit - Make (Last created unit) Invulnerable
                      • Set LightningBall_Dummy = (Last created unit)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Level of Lightning Ball for LightningBall_TrigUnit) Equal to 5
                        • Then - Actions
                          • Unit - Create 1 Lightning Ball (Level 5) for (Owner of LightningBall_TrigUnit) at TempPoint facing Default building facing degrees
                          • Unit - Add a 15.00 second Generic expiration timer to (Last created unit)
                          • Unit - Turn collision for (Last created unit) Off
                          • Unit - Make (Last created unit) Invulnerable
                          • Set LightningBall_Dummy = (Last created unit)
                        • Else - Actions
      • Custom script: call RemoveLocation(udg_LightningBall_TrigUnitLoc)
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Trigger - Turn on Lightning Ball Moving <gen>
      • Trigger - Turn on Lightning Ball Damage <gen>
      • Wait 15.00 seconds
      • Trigger - Turn off Lightning Ball Moving <gen>
      • Trigger - Turn off Lightning Ball Damage <gen>
  • Lightning Ball Moving
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set LightningBall_Spinning = (LightningBall_Spinning + 5.00)
      • Set LightningBall_TrigUnitLoc = (Position of LightningBall_TrigUnit)
      • Set LightningBall_DummyPosition = (Position of LightningBall_Dummy)
      • Set LightningBall_Moving = (LightningBall_TrigUnitLoc offset by 256.00 towards LightningBall_Spinning degrees)
      • Unit - Move LightningBall_Dummy instantly to LightningBall_Moving
      • Custom script: call RemoveLocation(udg_LightningBall_TrigUnitLoc)
      • Custom script: call RemoveLocation(udg_LightningBall_DummyPosition)
      • Custom script: call RemoveLocation(udg_LightningBall_Moving)
  • Lightning Ball Damage
    • Events
      • Time - Every 0.60 seconds of game time
    • Conditions
    • Actions
      • Set LightningBall_DummyPosition = (Position of LightningBall_Dummy)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Random 1 units from (Units within 400.00 of LightningBall_DummyPosition)) and do (Actions)
        • Loop - Actions
          • Unit - Order LightningBall_Dummy to Attack (Picked unit)
      • Custom script: call RemoveLocation(udg_LightningBall_DummyPosition)
in here the dummy unit doesn't attack picked unit (the dummy is locust, tried removing locust, but still doesn't attacks) help..
 
No, it should be via Custom script:
  • Custom script: call SetUnitX(udg_LightningBall_Dummy, GetLocationX(udg_LightningBall_Moving))
Also, you're missing 1 more ')' at behind of the script.

Don't forget to do SetUnitY too, okay ?
  • Custom script: call SetUnitX(blablabla)
  • Custom script: call SetUnitY(blablabla)
For SetUnitY, just change all 'X' into 'Y' - such as GetLocationY instead of GetLocationX
 
Status
Not open for further replies.
Back
Top