• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

TrigUnit Doesn't damage Target Unit

Status
Not open for further replies.
Level 18
Joined
May 11, 2012
Messages
2,103
as said in the title: the Trig Unit doesn't damages Target Unit... Why is it so?

  • DeathHand Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set DeathHand_TrigUnitLoc = (Position of DeathHand_TrigUnit)
      • Set DeathHand_TargetUnitLoc = (Position of DeathHand_TargetUnit)
      • Set DeathHand_Angle = (Angle from DeathHand_TargetUnitLoc to DeathHand_TrigUnitLoc)
      • Set DeathHand_MovingTargetUnit = (DeathHand_TargetUnitLoc offset by 20.00 towards DeathHand_Angle degrees)
      • Special Effect - Create a special effect attached to the origin of DeathHand_TargetUnit using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Move DeathHand_TargetUnit instantly to DeathHand_MovingTargetUnit, facing DeathHand_Angle degrees
      • Unit - Cause DeathHand_TrigUnit to damage DeathHand_TargetUnit, dealing (30.00 / (100.00 x (Distance between DeathHand_TargetUnitLoc and DeathHand_TrigUnitLoc))) damage of attack type Spells and damage type Normal
      • Set DeathHand_UnitGroup = (Units within 125.00 of DeathHand_TrigUnitLoc)
      • Unit Group - Pick every unit in DeathHand_UnitGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Picked unit) Equal to DeathHand_TargetUnit
            • Then - Actions
              • Unit - Create 1 Dummy DeathHand for (Owner of DeathHand_TrigUnit) at DeathHand_TrigUnitLoc facing Default building facing degrees
              • Unit - Add Dummy Death Hand to (Last created unit)
              • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
              • Unit - Add a 0.30 second Generic expiration timer to (Last created unit)
            • Else - Actions
      • Custom script: call RemoveLocation(udg_DeathHand_TrigUnitLoc)
      • Custom script: call RemoveLocation(udg_DeathHand_TargetUnitLoc)
      • Custom script: call RemoveLocation(udg_DeathHand_MovingTargetUnit)
      • Custom script: call DestroyGroup(udg_DeathHand_UnitGroup)
 
Level 18
Joined
May 11, 2012
Messages
2,103
I did.... In the setup trigger

here it is:
  • DeathHand
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dragging to Death
    • Actions
      • Set DeathHand_TrigUnit = (Triggering unit)
      • Set DeathHand_TargetUnit = (Target unit of ability being cast)
      • Unit - Turn collision for DeathHand_TargetUnit Off
      • Trigger - Turn on DeathHand Loop <gen>
      • Trigger - Add to DeathHand Checking <gen> the event (Unit - A unit comes within 125.00 of DeathHand_TrigUnit)
      • Trigger - Turn on DeathHand Checking <gen>
 
Well, for starters the damage is a very minuscule amount.

30.00 / ( 100.00 * Distance ) < 1 for all values of distance that are > 0.30. That means that for you to deal at least 1 damage, the distance would have to be 0.30 units or lower. (which never happens unless the units have no pathing or are placed inside of each other) The formula you are using must be wrong. Are you sure you didn't mean to have it the other way around or something?
 
Level 18
Joined
May 11, 2012
Messages
2,103
Well, for starters the damage is a very minuscule amount.

30.00 / ( 100.00 * Distance ) < 1 for all values of distance that are > 0.30. That means that for you to deal at least 1 damage, the distance would have to be 0.30 units or lower. (which never happens unless the units have no pathing or are placed inside of each other) The formula you are using must be wrong. Are you sure you didn't mean to have it the other way around or something?

then, how can I make the formula to damage it for 30% of the distance moved?

You know, just like blood's rupture
 
30% would be 30 / 100. You want to multiply (30/100) by Distance instead of 30 / (100 * Distance). 30/100 = 0.3 Therefore you can just have 0.3 * Distance:
  • Unit - Cause DeathHand_TrigUnit to damage DeathHand_TargetUnit, dealing (0.30 x (Distance between DeathHand_TargetUnitLoc and DeathHand_TrigUnitLoc)) damage of attack type Spells and damage type Normal
Then that should deal 30% of the distance between the units as damage.
 
Status
Not open for further replies.
Top