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

Damage first unit on the way to target

Status
Not open for further replies.
Level 9
Joined
Jan 23, 2008
Messages
384
Hi ! its have been a while from my last post in this section ...
So my question is ... i make an ability that fires a missile in a random direction and the first unit that it hits it gets stunned and damaged ... how can i do this ... tell me pls if i can do it via GUI cuz i am 0 at JASS -.-'

Ty for all yer time !
 
Level 13
Joined
Mar 16, 2008
Messages
941
Yes you can in GUI, bit I think it requires very good GUI skills to make this MUI.
The idea is to create a missle (dummy unit) and move it with a timer/trigger every 0.02-0.04 seconds (50-25 times per second in this case, 25 is fast enough). Whenever you move your missle forwards, you pick all units in range of... 50, 100? your choice :p and damage one. As soon as one is damaged, kill the missle.
 
Level 14
Joined
Nov 23, 2008
Messages
187
When your trigger moves projectile (aka missile), pick all units in small range within it, and if there is any unit, deal damage, stun him and remove projectile.

  • SpellRun
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • -------- moving stuff here --------
      • Custom script: call MoveLocation(udg_MissileLoc, GetUnitX(udg_Missile), GetUnitY(udg_Missile))
      • Set MissileGroup = (Units within 128.00 of MissileLoc matching (((Matching unit) belongs to an enemy of MissileOwner) equal to True))
      • Group - Pick every unit in MissileGroup and do (Actions)
        • Actions
          • Unit - Cause Missile to damage (Picked unit), dealing 100.00 damage of attack type Spell and damage type Normal
          • -------- dummy cast (stun) here --------
          • Unit - Remove Missile from the game
          • Trigger - Turn off SpellRun <gen>
However, this will be not MUI, you should use arrays for missile data and one timer (or periodic trigger) for doing actions.
 
Status
Not open for further replies.
Top