• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

How can I make an ability that shoots in a straight line, anything that gets in the way gets killed?

Status
Not open for further replies.
Level 8
Joined
Jul 17, 2004
Messages
283
I'm trying to make an ability that shoots in a straight line, and any unit that gets hit dies. I tried using Carrion Swarm, but I can't reduce the area of effect/"line width". I basically just want it to be like a projectile, that if you are in the way, then you die. How can I achieve this?
 
Level 5
Joined
Jun 13, 2017
Messages
83
make a dummy unit and change the model of the unit to look like the ability you want, then when the ability is cast, create 1 dummy unit in position of caster and order it to move to target point of ability, in another trigger every 0.1 sec pick every unit in lets say 100 range of dummy unit and kill picked unit or deal damage.
 
This should work:

  • Example Spell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to YourAbility
    • Actions
      • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
      • Set Dummy = (Last created unit)
      • Set TargetPoint = (Target point of ability being cast)
      • Unit - Create 1 DummyTarget for (Owner of Dummy) at TargetPoint facing Default building facing degrees
      • Set DummyTarget = (Last created unit)
      • Unit - Order Dummy to Move To TargetPoint
      • Trigger - Add to Example Spell 3 <gen> the event (Unit - A unit comes within 50.00 of DummyTarget)
      • Trigger - Turn on Example Spell 2 <gen>
      • Trigger - Turn on Example Spell 3 <gen>
  • Example Spell 2
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units within 100.00 of (Position of Dummy) matching ((Owner of (Matching unit)) Not equal to Player 1 (Red))) and do (Actions)
        • Loop - Actions
          • Unit - Kill (Picked unit)
  • Example Spell 3
    • Events
    • Conditions
      • (Triggering unit) Equal to Dummy
    • Actions
      • Unit - Remove Dummy from the game
      • Unit - Remove DummyTarget from the game
      • Trigger - Turn off Example Spell 2 <gen>

Edit: It doesn't remove the dummy units, and I have no idea why. It's almost like "Trigger - Add to Example Spell 3 <gen> the event (Unit - A unit comes within 50.00 of DummyTarget)" doesn't actually add the event to the specified trigger, idk. I will let someone more seasoned help you.

Edit 2:

Did this instead and then it worked:

  • Example Spell 3
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
      • (Distance between (Position of Dummy) and (Position of DummyTarget)) Less than or equal to 100.00
    • Actions
      • Unit - Remove Dummy from the game
      • Unit - Remove DummyTarget from the game
      • Trigger - Turn off Example Spell 2 <gen>
      • Trigger - Turn off (This trigger)
 
Last edited:
Status
Not open for further replies.
Top