• 🏆 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!

[Trigger] Unit range

Status
Not open for further replies.
Level 11
Joined
Sep 12, 2008
Messages
657
Is it possible to make a trigger do this:

  • Unit Group - Pick every unit in (Units within 350.00 of (Position of (Picked unit))) and do (Actions)
    • Loop - Actions
then inside the loop, make it pick every range inside,
the higher the range is, the less damage you get.. is it possible?

Btw, damage is damaged like this:
  • Unit - Cause (Picked unit) to damage circular area after 0.00 seconds of radius 350.00 at (Position of (Picked unit)), dealing 0.00 damage of attack type Spells and damage type Normal
i want to make the 350 radius stay, but damage the unit less if range is example from Casting unit to the picked unit 350, so damage 100,and if range is 127, damage 175.. for example..

hope you understended.. thanks =]
 
Level 9
Joined
May 22, 2009
Messages
276
this is very unclear, you should state what the ability you're casting does, I woudn't use 'damage area', but rather 'damage target' in the loop, else you'll damage the same area multiple times equal to the units in the area

The damage part I understood, you'll just have to make a formula that lowers the damage when the range is higher:
  • Set Point_Centre = Target Point of Ability being cast
  • Unit Group - Pick every unit in (Units within 350.00 of (Point_Centre) and do (Actions)
    • Loop - Actions
      • Unit - Cause (Triggering unit) to damage (Picked Unit) dealing (500-(distance between (Position of (Picked unit)) and (Position of (Point_Centre))) damage of attack type Spells and damage type Normal
Even tho this trigger leaks, it will do 150 damage to units that are 350 range away from the centre, and 500 to units nearby (you can change the values (decrease 500, and do the distance/2 or more)
 
Level 11
Joined
Sep 12, 2008
Messages
657
Well.. thats exactly what i wanted.
and thats not really an "casting unit"
since well.. its a time bomb, setted to kill it self after 10 seconds, with a floating text goes 10,9,8 so on.. then it auto does an effect.. and i want it to hit higher the most your in, and lower the most your out =]
 
Level 9
Joined
May 22, 2009
Messages
276
so the Event would be: A unit dies
Condition: Unit-type=bomb

  • Set Point_Centre = Position of (Triggering Unit)
  • Unit Group - Pick every unit in (Units within 350.00 of (Point_Centre) and do (Actions)
  • Loop - Actions
  • Unit - Cause (Triggering unit) to damage (Picked Unit) dealing (500-(distance between (Position of (Picked unit)) and (Position of (Point_Centre))) damage of attack type Spells and damage type Normal
 
Status
Not open for further replies.
Top