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

damage engine

Status
Not open for further replies.
Level 7
Joined
Sep 19, 2020
Messages
190
Hi
I using the damage engine v3 (wc3 patch 1.26) and it's work very well by unit index but unit index change hero hitPoint to 50k
why it's happening and how to fix this problem?
  • Unit Indexer
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: call ExecuteFunc("InitializeUnitIndexer")
      • Custom script: endfunction
      • Custom script:
      • Custom script: function ClearUnitIndex takes nothing returns nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Custom value of UDexUnits[UDex]) Equal to 0
        • Then - Actions
          • Set UnitIndexLock[UDex] = (UnitIndexLock[UDex] - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • UnitIndexLock[UDex] Equal to 0
            • Then - Actions
              • Set UDexNext[UDexPrev[UDex]] = UDexNext[UDex]
              • Set UDexPrev[UDexNext[UDex]] = UDexPrev[UDex]
              • Set UDexPrev[UDex] = 0
              • Set UnitIndexEvent = 0.00
              • Set UnitIndexEvent = 2.00
              • Set UnitIndexEvent = 0.00
              • Set UDexUnits[UDex] = No unit
              • Set UDexNext[UDex] = UDexRecycle
              • Set UDexRecycle = UDex
            • Else - Actions
        • Else - Actions
      • Custom script: endfunction
      • Custom script:
      • Custom script: function IndexUnit takes nothing returns boolean
      • Custom script: local integer pdex = udg_UDex
      • Custom script: local integer ndex
      • -------- - --------
      • -------- You can customize the following block - if conditions are false the (Matching unit) won't be indexed. --------
      • -------- - --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • UnitIndexerEnabled Equal to True
          • (Custom value of (Matching unit)) Equal to 0
        • Then - Actions
          • Set UDexWasted = (UDexWasted + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • UDexWasted Equal to 32
            • Then - Actions
              • Set UDexWasted = 0
              • Set UDex = UDexNext[0]
              • Custom script: loop
              • Custom script: exitwhen udg_UDex == 0
              • Custom script: set ndex = udg_UDexNext[udg_UDex]
              • Custom script: call ClearUnitIndex()
              • Custom script: set udg_UDex = ndex
              • Custom script: endloop
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • UDexRecycle Equal to 0
            • Then - Actions
              • Set UDex = (UDexGen + 1)
              • Set UDexGen = UDex
            • Else - Actions
              • Set UDex = UDexRecycle
              • Set UDexRecycle = UDexNext[UDex]
          • Set UDexUnits[UDex] = (Matching unit)
          • Unit - Set the custom value of UDexUnits[UDex] to UDex
          • Set UDexPrev[UDexNext[0]] = UDex
          • Set UDexNext[UDex] = UDexNext[0]
          • Set UDexNext[0] = UDex
          • Set UnitIndexLock[UDex] = 1
          • Set UnitIndexEvent = 0.00
          • Set UnitIndexEvent = 1.00
          • Set UnitIndexEvent = 0.00
          • Custom script: set udg_UDex = pdex
        • Else - Actions
      • Custom script: return false
      • Custom script: endfunction
      • Custom script:
      • Custom script: function InitializeUnitIndexer takes nothing returns nothing
      • Custom script: local integer i = bj_MAX_PLAYER_SLOTS
      • Custom script: local boolexpr b = Filter(function IndexUnit)
      • Custom script: local region re = CreateRegion()
      • Custom script: local trigger t = GetTriggeringTrigger()
      • Custom script: local rect r = GetWorldBounds()
      • Custom script: call RegionAddRect(re, r)
      • Custom script: call TriggerRegisterEnterRegion(t, re, b)
      • Custom script: call TriggerClearActions(t)
      • Custom script: call TriggerAddAction(t, function ClearUnitIndex)
      • Set UnitIndexerEnabled = True
      • Custom script: loop
      • Custom script: set i = i - 1
      • Custom script: call GroupEnumUnitsOfPlayer(bj_lastCreatedGroup, Player(i), b)
      • Custom script: exitwhen i == 0
      • Custom script: endloop
      • Custom script: call RemoveRect(r)
      • Custom script: set re = null
      • Custom script: set r = null
      • Custom script: set t = null
      • Custom script: set b = null
      • Set UnitIndexEvent = 3.00
      • Set UnitIndexEvent = 0.00
 
Last edited:
Level 24
Joined
Jun 26, 2020
Messages
1,850
Yes, I think unit index have a problem because without unit index I don't have any problem in my map but damage engine not work without unit index
Won't be the problem is in the Damage Engine because you said it doesn't work without the unit index? so when you dissble the unit index also won't happen the thing that damage engine does, so I ask again, you set the values of the abilities properly? I mean in this way?
  • Set DamageBlockingAbility = Cheat Death Ability (+500,000)
  • -------- - --------
  • Set SpellDamageAbility = Detect Spell Damage
Because I think you did it like this
  • Set DamageBlockingAbility = Detect Spell Damage
  • -------- - --------
  • Set SpellDamageAbility = Cheat Death Ability (+500,000)
 
Level 7
Joined
Sep 19, 2020
Messages
190
Won't be the problem is in the Damage Engine because you said it doesn't work without the unit index? so when you dissble the unit index also won't happen the thing that damage engine does, so I ask again, you set the values of the abilities properly? I mean in this way?
  • Set DamageBlockingAbility = Cheat Death Ability (+500,000)
  • -------- - --------
  • Set SpellDamageAbility = Detect Spell Damage
Because I think you did it like this
  • Set DamageBlockingAbility = Detect Spell Damage
  • -------- - --------
  • Set SpellDamageAbility = Cheat Death Ability (+500,000)
tnx it's work :thumbs_up:
 
Level 24
Joined
Jun 26, 2020
Messages
1,850
tnx it's work :thumbs_up:
XD, you're welcome.
What is different between
DamageModifierEvent Becomes Equal to 4.00"
DamageModifierEvent Becomes Equal to 3.00".
DamageModifierEvent Becomes Equal to 2.00".
DamageModifierEvent Becomes Equal to 1.00".
?
I don't know, you should look into the code and see the comment parts.
 
Status
Not open for further replies.
Top