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

[Solved] not doing damage

Status
Not open for further replies.
Level 5
Joined
Sep 27, 2011
Messages
141
I have checked that the damage amount is correct and the damage unit group runs because the special effects are created. I know im terrible with local variables because i never use them but this is just ment to be a quick map for me and my friend otherwise i would do it without the wait so can someone please help me and tell me why it does not do damage.
  • Thunder Palace
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Palace
    • Actions
      • Custom script: local unit udg_TempUnit
      • Custom script: local location udg_Temp_Loc
      • Custom script: local real udg_Damage
      • Set TempUnit = (Triggering unit)
      • Set Temp_Loc = (Position of TempUnit)
      • Set Temp_Real = (Mana of TempUnit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Temp_Real Greater than or equal to 500.00
        • Then - Actions
          • Unit - Pause TempUnit
          • Set Temp_Real = (Temp_Real x 0.01)
          • Set Damage = ((40.00 + (10.00 x (Real((Level of Thunder Palace for TempUnit))))) x (Real((Integer(Temp_Real)))))
          • Unit - Set mana of TempUnit to 0.00
          • Set Temp_Angle = 0.00
          • For each (Integer Temp_Int) from 1 to (Integer(Temp_Real)), do (Actions)
            • Loop - Actions
              • Set TargetPoint = (Temp_Loc offset by 600.00 towards Temp_Angle degrees)
              • Unit - Create 1 Lightning Lacrima for (Owner of TempUnit) at TargetPoint facing Default building facing degrees
              • Unit - Add a 4.00 second Generic expiration timer to (Last created unit)
              • Unit - Make (Last created unit) Explode on death
              • Set Temp_Angle = (Temp_Angle + (360.00 / (Real((Integer(Temp_Real))))))
              • Custom script: call RemoveLocation(udg_TargetPoint)
          • Wait 4.00 seconds
          • Unit - Unpause TempUnit
          • Custom script: set bj_wantDestroyGroup=true
          • Unit Group - Pick every unit in (Units within 600.00 of Temp_Loc matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is Magic Immune) Equal to False) and (((Owner of (Matching unit)) is an ally of (Owner of TempUnit)) Equal to False)))) and do (Actions)
            • Loop - Actions
              • Set TempUnit2 = (Picked unit)
              • Custom script: call UnitDamageTarget(udg_TempUnit, udg_TempUnit2, udg_Damage, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, null)
              • Set TargetPoint = (Position of TempUnit2)
              • Special Effect - Create a special effect at TargetPoint using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Custom script: call RemoveLocation(udg_TargetPoint)
        • Else - Actions
          • Set Temp_Int = (Level of Thunder Palace for TempUnit)
          • Unit - Remove Thunder Palace from TempUnit
          • Unit - Add Thunder Palace to TempUnit
          • Unit - Set level of Thunder Palace for TempUnit to Temp_Int
      • Custom script: call RemoveLocation(udg_Temp_Loc)
      • Custom script: set udg_Damage=0
      • Custom script: set udg_TempUnit=null
 
Level 1
Joined
Feb 1, 2013
Messages
5
Try change this maybe it can work.
  • Events
  • Conditions
  • Actions
    • Custom script: call UnitDamageTarget(udg_TempUnit, udg_TempUnit2, udg_Damage, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, null)
Change with:
  • Events
  • Conditions
  • Actions
    • Unit - Cause TempUnit to damage TempUnit2, dealing Damage damage of attack type Normal and damage type Normal
Or you can try to put debug message showing the amount of Damage, if it shows 0 then something is wrong with your damage calculation.

  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units within 600.00 of Temp_Loc matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is Magic Immune) Equal to False) and (((Owner of (Matching unit)) is an ally of (Owner of TempUnit)) Equal to False)))) and do (Actions)
        • Loop - Actions
          • Set TempUnit2 = (Picked unit)
          • Game - Display to (All players) the text: (String(Damage))
          • Custom script: call UnitDamageTarget(udg_TempUnit, udg_TempUnit2, udg_Damage, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, null)
          • Set TargetPoint = (Position of TempUnit2)
          • Special Effect - Create a special effect at TargetPoint using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • Custom script: call RemoveLocation(udg_TargetPoint)
 
Level 5
Joined
Sep 27, 2011
Messages
141
I had already tried the debug message just before the unit group and it was correct but when inside the unit group it displayed 0. Also i thought waits worked fine with local variables tell me if thats not true because then ill have to do this the complicated way can someone tell me where or why it changes to 0 in that unit group?
 
Status
Not open for further replies.
Top