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

[Trigger] Eraser Cannon

Status
Not open for further replies.
Level 9
Joined
Dec 26, 2010
Messages
475
hey guys i need help again :ogre_haosis:

  • Eraser Cannon
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Eraser Cannon
    • Actions
      • Set EraserCannon_Unit[1] = (Triggering unit)
      • Set EraserCannon_Point[1] = (Position of (Triggering unit))
      • Set EraserCannon_Point[2] = (Target point of ability being cast)
      • Unit - Make EraserCannon_Unit[1] face EraserCannon_Point[2] over 3.00 seconds
      • Set EraserCannon_Point[3] = ((Position of EraserCannon_Unit[1]) offset by 50.00 towards (Facing of EraserCannon_Unit[1]) degrees)
      • Set EraserCannon_Real[1] = ((Real((Level of Eraser Cannon for EraserCannon_Unit[1]))) x 200.00)
      • Animation - Play EraserCannon_Unit[1]'s Stand 3 animation
      • Unit - Pause EraserCannon_Unit[1]
      • Unit - Create 1 Eraser Cannon Dummy_Ball for (Owner of EraserCannon_Unit[1]) at EraserCannon_Point[3] facing Default building facing degrees
      • Set EraserCannon_Unit[2] = (Last created unit)
      • Trigger - Turn on Eraser Cannon Loop <gen>
  • Eraser Cannon Loop
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Set EraserCannon_Point[4] = (Position of EraserCannon_Unit[2])
      • Set EraserCannon_Point[4] = (EraserCannon_Point[4] offset by 25.00 towards (Facing of EraserCannon_Unit[1]) degrees)
      • Unit - Move EraserCannon_Unit[2] instantly to EraserCannon_Point[4]
      • Special Effect - Create a special effect at EraserCannon_Point[4] using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
      • Special Effect - Destroy (Last created special effect)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between (Position of EraserCannon_Unit[2]) and EraserCannon_Point[2]) Less than or equal to 50.00
        • Then - Actions
          • Unit - Unpause EraserCannon_Unit[1]
          • Set EraserCannon_Point[5] = (Position of EraserCannon_Unit[2])
          • Set EraserCannon_UnitGroup[1] = (Units within 500.00 of (Position of EraserCannon_Unit[2]) matching (((Matching unit) belongs to an ally of (Owner of EraserCannon_Unit[1])) Equal to False))
          • Unit Group - Pick every unit in EraserCannon_UnitGroup[1] and do (Unit - Cause EraserCannon_Unit[4] to damage (Picked unit), dealing EraserCannon_Real[1] damage of attack type Chaos and damage type Magic)
          • Unit - Remove EraserCannon_Unit[2] from the game
          • Special Effect - Create a special effect at (Position of EraserCannon_Unit[2]) using war3mapImported\Explosion.mdx
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at (Position of EraserCannon_Unit[2]) using war3mapImported\NewDirtEXNofire.mdx
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at (Position of EraserCannon_Unit[2]) using war3mapImported\NuclearExplosion.mdx
          • Special Effect - Destroy (Last created special effect)
          • Environment - Create a 3.00 second Normal ripple deformation at EraserCannon_Point[5] with starting radius 500.00, ending radius 500.00, and depth 100.00, using 2.00 second ripples spaced 400.00 apart
          • Custom script: call RemoveLocation(udg_EraserCannon_Point[1])
          • Custom script: call RemoveLocation(udg_EraserCannon_Point[2])
          • Custom script: call RemoveLocation(udg_EraserCannon_Point[3])
          • Custom script: call RemoveLocation(udg_EraserCannon_Point[4])
          • Custom script: call DestroyGroup(udg_EraserCannon_UnitGroup[1])
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Custom script: call RemoveLocation(udg_EraserCannon_Point[4])
when i target a point my spell works fine but when i target a unit it doesn't works! need help! +Rep
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
  • Set TargetUnit = Target unit of ability being cast
  • If TargetUnit equal to no unit
    • Then
      • EraserCannon_Point[2] = Position of TargetUnit
    • Else
      • EraserCannon_Point[2] = Target point of ability being cast
Set EraserCannon_Point[3] uses position of...when it should use Set EraserCannon_Point[2].

You leak a lot, you need to learn proper indexing to prevent that and to make it MUI.
 
Status
Not open for further replies.
Top